diff --git a/packages/analyzer/package.json b/packages/analyzer/package.json index 34973ff09..d9c414965 100644 --- a/packages/analyzer/package.json +++ b/packages/analyzer/package.json @@ -23,13 +23,13 @@ "release": "npm run compile", "lint": "gulp lint", "tslint": "tslint -p .", - "test": "npm run clean && npm run build && npm run lint && mocha", - "quicktest": "export QUICK_TESTS=true; npm run build && mocha", + "test": "npm run clean && npm run build && npm run lint && mocha \"lib/test/**/*_test.js\"", + "quicktest": "export QUICK_TESTS=true; npm run build && mocha \"lib/test/**/*_test.js\"", "initBench": "if [ ! -d bower_components ]; then bower install -s -f PolymerElements/app-elements PolymerElements/iron-elements PolymerElements/gold-elements PolymerElements/paper-elements PolymerElements/neon-elements GoogleWebComponents/google-web-components ; fi", "benchmark": "npm run build && npm run initBench && node --expose-gc lib/perf/parse-all-benchmark.js", - "test:unit": "mocha", - "test:watch": "tsc-then -- mocha -c", - "format": "find src test | grep '\\.js$\\|\\.ts$' | xargs clang-format --style=file -i", + "test:unit": "mocha \"lib/test/**/*_test.js\"", + "test:watch": "tsc-then -- mocha \"lib/test/**/*_test.js\"", + "format": "find src test | grep \"\\.js$\\|\\.ts$\" | xargs clang-format --style=file -i", "prepublishOnly": "tsc && npm test" }, "devDependencies": { diff --git a/packages/analyzer/test/mocha.opts b/packages/analyzer/test/mocha.opts index 97032c0da..64a50a639 100644 --- a/packages/analyzer/test/mocha.opts +++ b/packages/analyzer/test/mocha.opts @@ -1,4 +1,4 @@ --ui tdd +--colors --require source-map-support/register --timeout 5000 -lib/test/**/*_test.js diff --git a/packages/browser-capabilities/package.json b/packages/browser-capabilities/package.json index 2fd1dc1a9..f37190755 100644 --- a/packages/browser-capabilities/package.json +++ b/packages/browser-capabilities/package.json @@ -13,9 +13,9 @@ "scripts": { "build": "rm -Rf lib/ && tsc", "build:watch": "tsc --watch", - "format": "find src -name '*.ts' | xargs clang-format --style=file -i", - "test": "npm run build && mocha", - "test:unit": "mocha", + "format": "find src -name \"*.ts\" | xargs clang-format --style=file -i", + "test": "npm run build && mocha \"lib/test/**/*_test.js\"", + "test:unit": "mocha \"lib/test/**/*_test.js\"", "test:watch": "watchy -w src -- npm run test" }, "devDependencies": { diff --git a/packages/browser-capabilities/test/mocha.opts b/packages/browser-capabilities/test/mocha.opts index 97032c0da..64a50a639 100644 --- a/packages/browser-capabilities/test/mocha.opts +++ b/packages/browser-capabilities/test/mocha.opts @@ -1,4 +1,4 @@ --ui tdd +--colors --require source-map-support/register --timeout 5000 -lib/test/**/*_test.js diff --git a/packages/build/package.json b/packages/build/package.json index 0689f705b..1e2a90ab3 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -8,10 +8,10 @@ "lint": "gulp lint", "build": "gulp build", "test": "gulp lint test", - "test:unit": "gulp test:unit", - "test:watch": "tsc-then -- mocha -c", + "test:unit": "mocha \"lib/test/**/*_test.js\"", + "test:watch": "tsc-then -- mocha \"lib/test/**/*_test.js\"", "prepublishOnly": "npm test", - "format": "find src/ -iname '*.ts' -o -iname '*.js' | xargs clang-format --style=file -i" + "format": "find src/ -iname \"*.ts\" -o -iname \"*.js\" | xargs clang-format --style=file -i" }, "repository": { "type": "git", diff --git a/packages/build/test/mocha.opts b/packages/build/test/mocha.opts index 97032c0da..64a50a639 100644 --- a/packages/build/test/mocha.opts +++ b/packages/build/test/mocha.opts @@ -1,4 +1,4 @@ --ui tdd +--colors --require source-map-support/register --timeout 5000 -lib/test/**/*_test.js diff --git a/packages/bundler/package.json b/packages/bundler/package.json index 8dc8c844f..b2752719e 100644 --- a/packages/bundler/package.json +++ b/packages/bundler/package.json @@ -55,10 +55,10 @@ }, "scripts": { "build": "tsc", - "format": "find src | grep '\\.js$\\|\\.ts$' | xargs ./node_modules/.bin/clang-format --style=file -i", - "test": "npm run build && tslint -c tslint.json src/*.ts src/**/*.ts && mocha", - "test:unit": "mocha", - "test:watch": "tsc-then -- mocha" + "format": "find src | grep \"\\.js$\\|\\.ts$\" | xargs ./node_modules/.bin/clang-format --style=file -i", + "test": "npm run build && tslint -c tslint.json \"src/**/*.ts\" && mocha \"lib/test/**/*_test.js\"", + "test:unit": "mocha \"lib/test/**/*_test.js\"", + "test:watch": "tsc-then -- mocha \"lib/test/**/*_test.js\"" }, "author": "The Polymer Project Authors", "license": "BSD-3-Clause", diff --git a/packages/bundler/test/mocha.opts b/packages/bundler/test/mocha.opts index 867b4ed6f..05962f5da 100644 --- a/packages/bundler/test/mocha.opts +++ b/packages/bundler/test/mocha.opts @@ -1,4 +1,4 @@ --ui tdd +--colors --require source-map-support/register --timeout 20000 -lib/test diff --git a/packages/cli/package.json b/packages/cli/package.json index 24f27e2de..828376290 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -15,10 +15,10 @@ "test": "gulp test lint", "test:smoke": "gulp test", "test:smoke-lint": "gulp test lint", - "test:integration": "gulp test:integration", - "test:unit": "gulp test:unit", - "format": "find src gulpfile.js \\( -iname '*.ts' -o -iname '*.js' \\) -not -path '*fixtures*' | xargs clang-format --style=file -i", - "test:watch": "tsc-then -- mocha -c --ui tdd lib/test/integration/*_test.js lib/test/unit/*_test.js lib/test/unit/*/*_test.js" + "test:integration": "mocha \"lib/test/integration/**/*_test.js\"", + "test:unit": "mocha \"lib/test/unit/**/*_test.js\"", + "format": "find src gulpfile.js \\( -iname \"*.ts\" -o -iname \"*.js\" \\) -not -path \"*fixtures*\" | xargs clang-format --style=file -i", + "test:watch": "tsc-then -- mocha \"lib/test/**/*_test.js\"" }, "repository": { "type": "git", diff --git a/packages/cli/test/mocha.opts b/packages/cli/test/mocha.opts index 4f179a309..64a50a639 100644 --- a/packages/cli/test/mocha.opts +++ b/packages/cli/test/mocha.opts @@ -1,4 +1,4 @@ --ui tdd +--colors --require source-map-support/register --timeout 5000 - diff --git a/packages/editor-service/package.json b/packages/editor-service/package.json index 9475d8c5f..cfb1c21d8 100644 --- a/packages/editor-service/package.json +++ b/packages/editor-service/package.json @@ -17,10 +17,10 @@ "build": "tsc", "prepublishOnly": "npm run clean && npm run build", "lint": "tslint --project ./tsconfig.json", - "test": "npm run clean && npm run build && mocha && npm run lint", - "test:unit": "mocha", - "test:watch": "tsc-then -- mocha", - "format": "find src test | grep '\\.js$\\|\\.ts$' | xargs ./node_modules/.bin/clang-format --style=file -i" + "test": "npm run clean && npm run build && mocha \"lib/test/**/*_test.js\" && npm run lint", + "test:unit": "mocha \"lib/test/**/*_test.js\"", + "test:watch": "tsc-then -- mocha \"lib/test/**/*_test.js\"", + "format": "find src test | grep \"\\.js$\\|\\.ts$\" | xargs ./node_modules/.bin/clang-format --style=file -i" }, "devDependencies": { "@types/chai": "=4.0.5", diff --git a/packages/editor-service/test/mocha.opts b/packages/editor-service/test/mocha.opts index 89240f395..46f5f3754 100644 --- a/packages/editor-service/test/mocha.opts +++ b/packages/editor-service/test/mocha.opts @@ -1,5 +1,5 @@ --ui tdd +--colors --require source-map-support/register --retries 3 --timeout 5000 -lib/test/*_test.js lib/test/**/*_test.js diff --git a/packages/linter/package.json b/packages/linter/package.json index c9dd4b250..25c3c5836 100644 --- a/packages/linter/package.json +++ b/packages/linter/package.json @@ -46,9 +46,9 @@ "clean": "touch lib && rm -rf lib && mkdir lib", "format": "find src | grep \"\\.[jt]s$\" | xargs clang-format --style=file -i", "lint": "tslint -c tslint.json src/*.ts src/**/*.ts", - "test": "npm run build && mocha && npm run lint", - "test:unit": "mocha", - "test:watch": "tsc-then -- mocha", + "test": "npm run build && mocha \"lib/test/**/*_test.js\" && npm run lint", + "test:unit": "mocha \"lib/test/**/*_test.js\"", + "test:watch": "tsc-then -- mocha \"lib/test/**/*_test.js\"", "run-on-polymer": "npm run build && (cd test/integration && bower install --silent) && INTEGRATION_TEST=true mocha lib/test/integration_test.js" }, "repository": { diff --git a/packages/linter/test/mocha.opts b/packages/linter/test/mocha.opts index d91b4b17c..8c6d7ac8e 100644 --- a/packages/linter/test/mocha.opts +++ b/packages/linter/test/mocha.opts @@ -1,4 +1,3 @@ --c --ui tdd +--colors --timeout 5000 -lib/test/*.js lib/test/**/*.js diff --git a/packages/polyserve/package.json b/packages/polyserve/package.json index 55d07e1e6..cedd8f862 100644 --- a/packages/polyserve/package.json +++ b/packages/polyserve/package.json @@ -12,10 +12,10 @@ "start": "./bin/polyserve", "clean": "rimraf lib", "build": "npm run clean && tsc", - "test": "npm run build && mocha && tslint \"src/**/*.ts\"", - "test:unit": "mocha", - "test:watch": "tsc-then -- mocha -c", - "format": "find src test -iname '*.ts' | xargs clang-format --style=file -i" + "test": "npm run build && mocha \"lib/test/**/*_test.js\" && tslint \"src/**/*.ts\"", + "test:unit": "mocha \"lib/test/**/*_test.js\"", + "test:watch": "tsc-then -- mocha \"lib/test/**/*_test.js\"", + "format": "find src test -iname \"*.ts\" | xargs clang-format --style=file -i" }, "keywords": [ "polymer", diff --git a/packages/polyserve/test/mocha.opts b/packages/polyserve/test/mocha.opts index 3a654bee7..64a50a639 100644 --- a/packages/polyserve/test/mocha.opts +++ b/packages/polyserve/test/mocha.opts @@ -1,4 +1,4 @@ --ui tdd +--colors --require source-map-support/register --timeout 5000 -lib/test/*_test.js lib/test/**/*_test.js diff --git a/packages/project-config/package-lock.json b/packages/project-config/package-lock.json index c6a577905..556b2ae21 100644 --- a/packages/project-config/package-lock.json +++ b/packages/project-config/package-lock.json @@ -91,6 +91,11 @@ "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=" }, + "buffer-from": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", + "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==" + }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -720,6 +725,20 @@ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "source-map-support": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.5.tgz", + "integrity": "sha512-mR7/Nd5l1z6g99010shcXJiNEaf3fEtmLhRB/sBcQVJGodcHCULPp2y4Sfa43Kv2zq7T+Izmfp/WHCR6dYkQCA==", + "requires": { + "buffer-from": "1.0.0", + "source-map": "0.6.1" + } + }, "spdx-correct": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", diff --git a/packages/project-config/package.json b/packages/project-config/package.json index a4cc2f3ac..98ec8a803 100644 --- a/packages/project-config/package.json +++ b/packages/project-config/package.json @@ -16,9 +16,9 @@ "homepage": "https://github.com/Polymer/polymer-project-config#readme", "scripts": { "build": "tsc && typescript-json-schema src/index.ts ProjectOptions --ignoreErrors -o lib/schema.json", - "test": "npm run build && mocha --ui tdd", - "test:unit": "mocha --ui tdd", - "format": "find src test \\( -iname '*.ts' -o -iname '*.js' \\) | xargs clang-format --style=file -i" + "test": "npm run build && mocha \"test/**/*_test.js\"", + "test:unit": "mocha \"test/**/*_test.js\"", + "format": "find src test \\( -iname \"*.ts\" -o -iname \"*.js\" \\) | xargs clang-format --style=file -i" }, "dependencies": { "@types/node": "^9.6.4", @@ -31,6 +31,7 @@ "clang-format": "1.0.49", "mocha": "^3.0.2", "polymer-analyzer": "^3.0.0-pre.22", + "source-map-support": "^0.5.5", "tslint": "^5.9.1", "typescript": "^2.0.2", "typescript-json-schema": "^0.9.0" diff --git a/packages/project-config/test/mocha.opts b/packages/project-config/test/mocha.opts new file mode 100644 index 000000000..64a50a639 --- /dev/null +++ b/packages/project-config/test/mocha.opts @@ -0,0 +1,4 @@ +--ui tdd +--colors +--require source-map-support/register +--timeout 5000 diff --git a/packages/web-component-tester/mocha.opts b/packages/web-component-tester/mocha.opts new file mode 100644 index 000000000..64a50a639 --- /dev/null +++ b/packages/web-component-tester/mocha.opts @@ -0,0 +1,4 @@ +--ui tdd +--colors +--require source-map-support/register +--timeout 5000 diff --git a/packages/web-component-tester/package.json b/packages/web-component-tester/package.json index 8ff35123b..f97af4e22 100644 --- a/packages/web-component-tester/package.json +++ b/packages/web-component-tester/package.json @@ -49,10 +49,10 @@ "build": "tsc && gulp build", "test": "tsc && gulp test", "prepublishOnly": "gulp prepublish", - "test:unit": "gulp test:unit", - "test:integration": "gulp test:integration", - "test:watch": "watch 'gulp test:unit' runner/ browser/ bin/ test/ tasks/", - "format": "find runner test | grep '\\.js$\\|\\.ts$' | xargs ./node_modules/.bin/clang-format --style=file -i" + "test:unit": "mocha \"test/unit/**/*.js\"", + "test:integration": "gulp bower && mocha \"test/integration/**/*.js\" --timeout 90000", + "test:watch": "watch \"mocha \\\"test/unit/**/*.js\\\"\" runner/ browser/ bin/ test/ tasks/", + "format": "find runner test | grep \"\\.js$\\|\\.ts$\" | xargs ./node_modules/.bin/clang-format --style=file -i" }, "dependencies": { "@polymer/sinonjs": "^1.14.1", @@ -126,6 +126,7 @@ "rimraf": "^2.5.4", "rollup": "^0.25.1", "run-sequence": "^1.0.1", + "source-map-support": "^0.5.4", "tslint": "^5.9.1", "typescript": "^2.1.4", "watch": "^0.18.0", diff --git a/packages/web-component-tester/test/mocha.opts b/packages/web-component-tester/test/mocha.opts new file mode 100644 index 000000000..64a50a639 --- /dev/null +++ b/packages/web-component-tester/test/mocha.opts @@ -0,0 +1,4 @@ +--ui tdd +--colors +--require source-map-support/register +--timeout 5000