Skip to content

Commit 8caff2f

Browse files
authored
Merge pull request #75 from joliss/chores
Chores
2 parents 565a589 + c6ffd81 commit 8caff2f

4 files changed

Lines changed: 21 additions & 10 deletions

File tree

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test/fixtures/bar
77
test/fixtures/contains-cycle/symlink2
88
test/fixtures/contains-cycle/is-cycle
99
.vscode/
10-
**/*.js
11-
**/*.d.ts
10+
*.js
11+
*.d.ts
12+
*.js.map
1213
!test/fixture
13-
index.js.map

test/test.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/test.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,28 @@ function safeUnlink(path:string) {
3434
}
3535
}
3636

37+
function safeRmdir(path:string) {
38+
try {
39+
fs.rmdirSync(path);
40+
} catch (e) {
41+
if (typeof e === 'object' && e !== null && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {
42+
// handle
43+
} else {
44+
throw e;
45+
}
46+
}
47+
}
48+
3749
symlink('./some-other-dir', 'test/fixtures/symlink1');
3850
symlink('doesnotexist', 'test/fixtures/symlink2', true);
3951

52+
// https://github.com/joliss/node-walk-sync/pull/44
53+
safeRmdir(__dirname + '/fixtures/bar');
4054
safeUnlink(__dirname + '/fixtures/bar');
4155
safeUnlink(__dirname + '/fixtures/symlink3');
42-
43-
fs.mkdirSync('./bar');
44-
symlink('./bar/', 'test/fixtures/symlink3', true);
45-
fs.rmdirSync('./bar');
56+
// Create a broken link to a directory ...
57+
symlink('bar', __dirname + '/fixtures/symlink3', true);
58+
// ... and copy a file in its place
4659
fs.copyFileSync(__dirname + '/fixtures/dir/bar.txt', __dirname + '/fixtures/bar');
4760

4861
safeUnlink(__dirname + '/fixtures/contains-cycle/is-cycle');

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"moduleResolution": "node",
66
"module": "commonjs",
77
"target": "es2017",
8-
"sourceMap": true,
9-
"strict": true
8+
"sourceMap": true
109
},
1110
"exclude": ["index.d.ts"],
1211
"include": ["index.ts", "test/test.ts"]

0 commit comments

Comments
 (0)