From 84c2458ea7df366230ff2ef0549dcca693fc235f Mon Sep 17 00:00:00 2001 From: JiaLiPassion Date: Mon, 20 Jan 2020 07:49:24 +0100 Subject: [PATCH] refactor: cleanup zone.js test instruction (#34860) PR Close #34860 --- packages/zone.js/DEVELOPER.md | 21 ++++--------------- .../karma-build-jasmine-phantomjs.conf.js | 9 -------- packages/zone.js/package.json | 6 +++--- .../{ => test/promise}/promise-adapter.js | 2 +- .../{ => test/promise}/promise-test.js | 0 .../promise}/promise.finally.spec.js | 0 6 files changed, 8 insertions(+), 30 deletions(-) delete mode 100644 packages/zone.js/karma-build-jasmine-phantomjs.conf.js rename packages/zone.js/{ => test/promise}/promise-adapter.js (89%) rename packages/zone.js/{ => test/promise}/promise-test.js (100%) rename packages/zone.js/{ => test/promise}/promise.finally.spec.js (100%) diff --git a/packages/zone.js/DEVELOPER.md b/packages/zone.js/DEVELOPER.md index 5f544eaff0..3956fe98da 100644 --- a/packages/zone.js/DEVELOPER.md +++ b/packages/zone.js/DEVELOPER.md @@ -34,23 +34,10 @@ Before Commit Please make sure you pass all following checks before commit -- gulp lint (tslint) -- gulp format:enforce (clang-format) -- gulp promisetest (promise a+ test) -- yarn test (karma browser test) -- gulp test-node (node test) - -You can run - -`yarn ci` - -to do all those checks for you. -You can also add the script into your git pre-commit hook - -``` -echo -e 'exec npm run ci' > .git/hooks/pre-commit -chmod u+x .git/hooks/pre-commit -``` +- yarn gulp lint (tslint) +- yarn gulp format (clang-format) +- yarn promisetest (promise a+ test) +- yarn bazel test //packages/zone.js/... (all tests) Webdriver Test -------------- diff --git a/packages/zone.js/karma-build-jasmine-phantomjs.conf.js b/packages/zone.js/karma-build-jasmine-phantomjs.conf.js deleted file mode 100644 index 54989858d1..0000000000 --- a/packages/zone.js/karma-build-jasmine-phantomjs.conf.js +++ /dev/null @@ -1,9 +0,0 @@ - -module.exports = function(config) { - require('./karma-build.conf.js')(config); - - config.plugins.push(require('karma-jasmine')); - config.plugins.push(require('karma-phantomjs-launcher')); - config.frameworks.push('jasmine'); - config.browsers.splice(0, 1, ['PhantomJS']); -}; diff --git a/packages/zone.js/package.json b/packages/zone.js/package.json index c47ada0cdd..768e130671 100644 --- a/packages/zone.js/package.json +++ b/packages/zone.js/package.json @@ -24,10 +24,10 @@ "typescript": "~3.4.2" }, "scripts": { - "promisetest": "tsc -p . && node ./promise-test.js", - "promisefinallytest": "tsc -p . && mocha promise.finally.spec.js", "electrontest": "cd test/extra && node electron.js", - "jesttest": "jest --config ./test/jest/jest.config.js ./test/jest/jest.spec.js" + "jesttest": "jest --config ./test/jest/jest.config.js ./test/jest/jest.spec.js", + "promisetest": "tsc -p . && node ./test/promise/promise-test.js", + "promisefinallytest": "tsc -p . && mocha ./test/promise/promise.finally.spec.js" }, "repository": { "type": "git", diff --git a/packages/zone.js/promise-adapter.js b/packages/zone.js/test/promise/promise-adapter.js similarity index 89% rename from packages/zone.js/promise-adapter.js rename to packages/zone.js/test/promise/promise-adapter.js index be9f9ac1eb..22e31addc5 100644 --- a/packages/zone.js/promise-adapter.js +++ b/packages/zone.js/test/promise/promise-adapter.js @@ -1,4 +1,4 @@ -require('./build/lib/node/rollup-main'); +require('../../build/lib/node/rollup-main'); Zone[Zone.__symbol__('ignoreConsoleErrorUncaughtError')] = true; module.exports.deferred = function() { const p = {}; diff --git a/packages/zone.js/promise-test.js b/packages/zone.js/test/promise/promise-test.js similarity index 100% rename from packages/zone.js/promise-test.js rename to packages/zone.js/test/promise/promise-test.js diff --git a/packages/zone.js/promise.finally.spec.js b/packages/zone.js/test/promise/promise.finally.spec.js similarity index 100% rename from packages/zone.js/promise.finally.spec.js rename to packages/zone.js/test/promise/promise.finally.spec.js