diff --git a/.babelrc b/.babelrc index d347b6a..7823717 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,9 @@ { "presets": ["power-assert"], - "sourceMaps": "inline" + "sourceMaps": "inline", + "env": { + "test": { + "plugins": [ "istanbul" ] + } + } } diff --git a/package.json b/package.json index 556c8e6..c7303be 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ "postversion": "git push && git push --tags", "pretest": "npm run -s lint", "preversion": "npm test", - "test": "nyc --require babel-register npm run -s _mocha", - "watch": "npm run -s _mocha -- --require babel-register --watch --growl" + "test": "nyc npm run -s _mocha", + "watch": "npm run -s _mocha -- --watch --growl" }, "dependencies": { "co": "^4.6.0", @@ -39,12 +39,12 @@ }, "devDependencies": { "@mysticatea/eslint-plugin": "^5.0.1", + "babel-plugin-istanbul": "^5.1.1", "babel-preset-power-assert": "^2.0.0", - "babel-register": "^6.26.0", "codecov": "^3.0.2", "eslint": "^5.0.1", "mocha": "^5.2.0", - "nyc": "12.0.2", + "nyc": "^13.3.0", "opener": "^1.4.3", "p-event": "^2.0.0", "power-assert": "^1.6.0", diff --git a/test/copy.js b/test/copy.js index ca0893b..72a8b25 100644 --- a/test/copy.js +++ b/test/copy.js @@ -35,7 +35,8 @@ describe("The copy method", () => { "test-ws/a/b/this-is.txt": "A pen", "test-ws/a/b/that-is.txt": "A note", "test-ws/a/b/no-copy.dat": "no-copy", - })) + }) + ) afterEach(() => teardownTestDir("test-ws")) /** @@ -87,7 +88,8 @@ describe("The copy method", () => { "test-ws/a/b/no-copy.dat": "no-copy", "test-ws/b/b/remove.txt": "remove", "test-ws/b/b/no-remove.dat": "no-remove", - })) + }) + ) afterEach(() => teardownTestDir("test-ws")) /** @@ -231,7 +233,8 @@ describe("The copy method", () => { "test-ws/a/hello.txt": "Hello", "test-ws/a/b/pen.txt": "A pen", "test-ws/a/c": null, - })) + }) + ) afterEach(() => teardownTestDir("test-ws")) /** @@ -279,7 +282,8 @@ describe("The copy method", () => { "test-ws/a/hello.txt": "Hello", "test-ws/a/b/pen.txt": "A pen", "test-ws/a/c": null, - })) + }) + ) afterEach(() => teardownTestDir("test-ws")) /** @@ -324,7 +328,8 @@ describe("The copy method", () => { "test-ws/a/b/this-is.txt": "A pen", "test-ws/a/b/that-is.txt": "A note", "test-ws/a/b/no-copy.dat": "no-copy", - })) + }) + ) afterEach(() => teardownTestDir("test-ws")) /** @@ -673,7 +678,8 @@ describe("The copy method", () => { describe("should copy specified files with globs even if there are parentheses:", () => { beforeEach(() => - setupTestDir({ "test-ws/a(paren)/hello.txt": "Hello" })) + setupTestDir({ "test-ws/a(paren)/hello.txt": "Hello" }) + ) afterEach(() => teardownTestDir("test-ws")) /** diff --git a/test/util/util.js b/test/util/util.js index 39d5c73..a461c2c 100644 --- a/test/util/util.js +++ b/test/util/util.js @@ -73,11 +73,10 @@ const readFile = (module.exports.content = function content(path) { */ module.exports.setupTestDir = function setupTestDir(dataset) { return Promise.all( - Object.keys(dataset).map( - path => - dataset[path] == null - ? fs.ensureDir(path) - : writeFile(path, dataset[path]) + Object.keys(dataset).map(path => + dataset[path] == null + ? fs.ensureDir(path) + : writeFile(path, dataset[path]) ) ).then(() => delay(250)) } diff --git a/test/watch.js b/test/watch.js index 134d90c..c7b4f1e 100644 --- a/test/watch.js +++ b/test/watch.js @@ -115,7 +115,8 @@ describe("The watch method", () => { "test-ws/a/b/this-is.txt": "A pen", "test-ws/a/b/that-is.txt": "A note", "test-ws/a/b/no-copy.dat": "no-copy", - })) + }) + ) /** * Verify. @@ -267,7 +268,8 @@ describe("The watch method", () => { "test-ws/a/b/this-is.txt": "A pen", "test-ws/a/b/that-is.txt": "A note", "test-ws/a/b/no-copy.dat": "no-copy", - })) + }) + ) /** * Verify. @@ -319,7 +321,8 @@ describe("The watch method", () => { "test-ws/a/b/no-copy.dat": "no-copy", "test-ws/b/b/remove.txt": "remove", "test-ws/b/b/no-remove.dat": "no-remove", - })) + }) + ) /** * Verify. @@ -373,7 +376,8 @@ describe("The watch method", () => { "test-ws/a/b/this-is.txt": "A pen", "test-ws/a/b/that-is.txt": "A note", "test-ws/a/b/no-copy.dat": "no-copy", - })) + }) + ) /** * Verify. @@ -540,7 +544,8 @@ describe("The watch method", () => { setupTestDir({ "test-ws/a/hello.txt": "Hello", "test-ws/a/hello.dat": "Hello", - })) + }) + ) /** * Verify. @@ -591,7 +596,8 @@ describe("The watch method", () => { setupTestDir({ "test-ws/a/hello.txt": "Hello", "test-ws/a/b/hello.txt": "Hello", - })) + }) + ) /** * Verify. @@ -638,7 +644,8 @@ describe("The watch method", () => { "test-ws/a/hello.txt": "Hello", "test-ws/a/b/hello.txt": "Hello", "test-ws/a/c": null, - })) + }) + ) /** * Verify. @@ -684,7 +691,8 @@ describe("The watch method", () => { setupTestDir({ "test-ws/a/hello.txt": "Hello", "test-ws/a/b/hello.txt": "Hello", - })) + }) + ) /** * Verify. @@ -730,7 +738,8 @@ describe("The watch method", () => { setupTestDir({ // "test-ws/a(paren)/hello.txt": "Hello", - })) + }) + ) /** * Verify.