|
1 | | -/* globals describe, it, before, afterEach */ |
| 1 | +/* globals describe, it, before, beforeEach, afterEach */ |
2 | 2 | const origShell = require('shelljs'); |
3 | 3 | const assert = require('assert'); |
4 | 4 | const fs = require('fs'); |
@@ -31,8 +31,14 @@ describe('proxy', function describeproxy() { |
31 | 31 | shell.config.silent = true; |
32 | 32 | }); |
33 | 33 |
|
| 34 | + beforeEach(() => { |
| 35 | + shell.mkdir('-p', 'test_data'); |
| 36 | + shell.cd('test_data'); |
| 37 | + }); |
| 38 | + |
34 | 39 | afterEach(() => { |
35 | | - shell.rm('-f', '*.txt'); |
| 40 | + shell.cd('..'); |
| 41 | + shell.rm('-rf', 'test_data'); |
36 | 42 | }); |
37 | 43 |
|
38 | 44 | it('appropriately handles inspect() and valueOf()', () => { |
@@ -222,10 +228,10 @@ describe('proxy', function describeproxy() { |
222 | 228 | }); |
223 | 229 |
|
224 | 230 | it('can use subcommands with options', (done) => { |
225 | | - fs.existsSync('package.json').should.equal(true); |
| 231 | + fs.existsSync('../package.json').should.equal(true); |
226 | 232 |
|
227 | 233 | // dont' actually remove this file, but do a dry run |
228 | | - const ret = shell.git.rm('-qrnf', 'package.json'); |
| 234 | + const ret = shell.git.rm('-qrnf', '../package.json'); |
229 | 235 | ret.code.should.equal(0); |
230 | 236 | ret.stdout.should.equal(''); |
231 | 237 | ret.stderr.should.equal(''); |
|
0 commit comments