10000 cd to the original CWD after each test · shelljs/shelljs@946ab48 · GitHub
[go: up one dir, main page]

Skip to content

Commit 946ab48

Browse files
committed
cd to the original CWD after each test
1 parent 9392c55 commit 946ab48

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

test/ln.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ test.beforeEach(t => {
1616
});
1717

1818
test.afterEach.always(t => {
19+
process.chdir(CWD);
1920
shell.rm('-rf', t.context.tmp);
2021
});
2122

@@ -53,7 +54,6 @@ test('destination already exists inside directory', t => {
5354
const result = shell.ln('-s', 'file1', './');
5455
t.truthy(shell.error());
5556
t.is(result.code, 1);
56-
shell.cd('..');
5757
});
5858

5959
test('non-existent source', t => {
@@ -142,7 +142,6 @@ test('To current directory', t => {
142142
t.truthy(fs.existsSync('dest/testfile.txt'));
143143
t.truthy(fs.existsSync('dir1/insideDir.txt'));
144144
t.falsy(fs.existsSync('dest/insideDir.txt'));
145-
shell.cd('..');
146145
});
147146

148147
test('Inside existing directory', t => {
@@ -156,7 +155,6 @@ test('Inside existing directory', t => {
156155
fs.readFileSync('external/node_script.js').toString(),
157156
fs.readFileSync('node_script.js').toString()
158157
);
159-
shell.cd('..');
160158
});
161159

162160
test('-f option', t => {

0 commit comments

Comments
 (0)
0