Skip to content

Commit c363fe5

Browse files
committed
tests: Use fs.existsSync() instead of fs.lstatSync()
1 parent 56c176f commit c363fe5

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/tests/debug-tools-test.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const DebugToolsPlugin = require('../index');
44
const transform = require('babel-core').transform;
55
const expect = require('chai').expect;
66
const fs = require('fs');
7-
const lstatSync = fs.lstatSync;
87

98
const presets = [["latest", {
109
"es2015": false,
@@ -464,13 +463,7 @@ function test(caseName, cases, assertionName, ep) {
464463
let sample = fs.readFileSync(`./fixtures/${assertionName}/sample.js`, 'utf-8');
465464
let options = cases[caseName].transformOptions;
466465
let expectationPath = `./fixtures/${assertionName}/expectation.js`;
467-
let expectationExists = true;
468-
469-
try {
470-
lstatSync(expectationPath);
471-
} catch (e) {
472-
expectationExists = false
473-
}
466+
let expectationExists = fs.existsSync(expectationPath);
474467

475468
if (expectationExists) {
476469
let expectation = fs.readFileSync(`./fixtures/${assertionName}/expectation.js`, 'utf-8');

0 commit comments

Comments
 (0)