diff --git a/.gitignore b/.gitignore index 2f139fe..b2738a3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules npm-debug.log package-lock.json +yarn.lock # WebStorm user-specific .idea/workspace.xml diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..d4a43dd --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run pre-commit diff --git a/gulpfile.js b/gulpfile.js index d8528f8..129190a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -37,19 +37,20 @@ module.exports = { "generate-third-party": generateThirdParty, }; -function test(done) { +async function test() { const jasmine = new Jasmine(); jasmine.loadConfigFile("specs/jasmine.json"); + jasmine.exitOnCompletion = false; jasmine.addReporter( new JasmineSpecReporter({ displaySuccessfulSpec: !defined(argv.suppressPassed) || !argv.suppressPassed, }) ); - jasmine.execute(); - jasmine.onComplete(function (passed) { - done(argv.failTaskOnError && !passed ? 1 : 0); - }); + const results = await jasmine.execute(); + if (argv.failTaskOnError && results.overallStatus === "failed") { + process.exitCode = 1; + } } function testWatch() { diff --git a/package.json b/package.json index 1bae769..709daf7 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,9 @@ "dependencies": { "bluebird": "^3.7.2", "cesium": "^1.86.1", - "fs-extra": "^10.0.0", + "fs-extra": "^11.0.0", "jpeg-js": "^0.4.3", - "mime": "^2.5.2", + "mime": "^3.0.0", "pngjs": "^6.0.0", "yargs": "^17.2.1" }, @@ -42,21 +42,23 @@ "eslint-config-prettier": "^8.3.0", "eslint-plugin-node": "^11.1.0", "gulp": "^4.0.2", - "husky": "^4.3.8", - "jasmine": "^3.10.0", + "husky": "^8.0.3", + "jasmine": "^4.5.0", "jasmine-spec-reporter": "^7.0.0", - "jsdoc": "^3.6.7", + "jsdoc": "^4.0.0", "nyc": "^15.1.0", "open": "^8.3.0", - "prettier": "2.3.2", + "prettier": "2.8.4", "pretty-quick": "^3.1.1" }, "husky": { "hooks": { - "pre-commit": "eslint && pretty-quick --staged" + } }, "scripts": { + "prepare": "husky install", + "pre-commit": "eslint && pretty-quick --staged", "jsdoc": "jsdoc ./lib -R ./README.md -d doc", "eslint": "eslint \"./**/*.js\" --cache --quiet", "test": "gulp test",