diff --git a/.travis.yml b/.travis.yml index 7314d9fd9..9d4737da1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ addons: - google-chrome-stable env: - - TEST_COMMAND=test + - TEST_COMMAND="run test:unit" - TEST_COMMAND="run test:integration" language: node_js diff --git a/appveyor.yml b/appveyor.yml index 56f0829f9..a7131f2b6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,7 +12,7 @@ install: test_script: - node --version - npm --version - - npm run test:windows + - npm run test:unit:windows - npm run test:integration:windows # Don't actually build. diff --git a/package.json b/package.json index b01406698..7e9b9480b 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,12 @@ }, "scripts": { "bootstrap": "lerna bootstrap", - "build": "lerna run build", - "test": "lerna run test", - "test:windows": "lerna run test --ignore polyserve", - "test:integration": "lerna run test:integration", - "test:integration:windows": "lerna run test:integration" + "build": "lerna run build --stream", + "test": "npm run build && npm run test:unit", + "test:integration": "lerna run test:integration --stream", + "test:integration:windows": "lerna run test:integration --stream", + "test:unit": "lerna run test:unit --stream", + "test:unit:windows": "lerna run test:unit --stream --ignore polyserve" }, "devDependencies": { "lerna": "^2.10.1" diff --git a/packages/analyzer/package.json b/packages/analyzer/package.json index 461bfa5f4..6c472eef3 100644 --- a/packages/analyzer/package.json +++ b/packages/analyzer/package.json @@ -26,6 +26,7 @@ "quicktest": "export QUICK_TESTS=true; npm run build && mocha", "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", "prepublishOnly": "tsc && npm test" diff --git a/packages/browser-capabilities/package.json b/packages/browser-capabilities/package.json index 5809bbf63..9cb93a9a8 100644 --- a/packages/browser-capabilities/package.json +++ b/packages/browser-capabilities/package.json @@ -15,6 +15,7 @@ "build:watch": "tsc --watch", "format": "find src -name '*.ts' | xargs clang-format --style=file -i", "test": "npm run build && mocha", + "test:unit": "mocha", "test:watch": "watchy -w src -- npm run test" }, "devDependencies": { diff --git a/packages/build/gulpfile.js b/packages/build/gulpfile.js index 02d738673..0f2089bbd 100644 --- a/packages/build/gulpfile.js +++ b/packages/build/gulpfile.js @@ -52,7 +52,9 @@ gulp.task('compile', () => { .pipe(gulp.dest('lib')); }); -gulp.task('test', ['build'], function() { +gulp.task('test', ['build', 'test:unit']); + +gulp.task('test:unit', function() { return gulp.src('lib/test/**/*_test.js', {read: false}).pipe(mocha({ ui: 'tdd', reporter: 'spec', diff --git a/packages/build/package.json b/packages/build/package.json index e1b147953..1ecb8ece8 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -8,6 +8,7 @@ "lint": "gulp lint", "build": "gulp build", "test": "gulp lint test", + "test:unit": "gulp test:unit", "test:watch": "tsc-then -- mocha -c", "prepublishOnly": "npm test", "format": "find src/ -iname '*.ts' -o -iname '*.js' | xargs clang-format --style=file -i" diff --git a/packages/bundler/package.json b/packages/bundler/package.json index c58741704..77671b8d3 100644 --- a/packages/bundler/package.json +++ b/packages/bundler/package.json @@ -54,8 +54,9 @@ }, "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", - "format": "find src | grep '\\.js$\\|\\.ts$' | xargs ./node_modules/.bin/clang-format --style=file -i" + "test:unit": "mocha" }, "author": "The Polymer Project Authors", "license": "BSD-3-Clause", diff --git a/packages/cli/gulpfile.js b/packages/cli/gulpfile.js index 28a2e82e3..dfc425c79 100644 --- a/packages/cli/gulpfile.js +++ b/packages/cli/gulpfile.js @@ -43,23 +43,23 @@ gulp.task('compile', () => { gulp.task('copy', () => gulp.src(['src/**/.gitignore']).pipe(gulp.dest('lib'))); -gulp.task( - 'test', - ['build'], - () => gulp.src('lib/test/unit/**/*_test.js', {read: false}).pipe(mocha({ - ui: 'tdd', - reporter: 'spec', - }))); +gulp.task('test', ['build', 'test:unit']); gulp.task( 'test:integration', - ['build'], () => gulp.src(['lib/test/integration/**/*_test.js'], {read: false}) .pipe(mocha({ ui: 'tdd', reporter: 'spec', }))); +gulp.task( + 'test:unit', + () => gulp.src('lib/test/unit/**/*_test.js', {read: false}).pipe(mocha({ + ui: 'tdd', + reporter: 'spec', + }))); + gulp.task( 'tslint', () => gulp.src('src/**/*.ts') diff --git a/packages/cli/package.json b/packages/cli/package.json index a8ffb2b3f..855e5ae3e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -16,6 +16,7 @@ "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" }, diff --git a/packages/common/gulp-tasks.js b/packages/common/gulp-tasks.js index 0c222a839..d1a826851 100644 --- a/packages/common/gulp-tasks.js +++ b/packages/common/gulp-tasks.js @@ -154,13 +154,21 @@ module.exports.buildAll = function(options) { module.exports.test = function(options) { module.exports.buildAll(options); - task('test', ['build'], () => - gulp.src(['test/**/*_test.js', 'src/test/**/*_test.js'], {read: false}) + task('test', ['build', 'test:unit', 'test:integration']); + + task('test:integration', () => + gulp.src(['lib/test/integration/**/*_test.js'], {read: false}) .pipe(mocha({ ui: 'tdd', reporter: 'spec', - })) - ); + }))); + + task('test:unit', () => + gulp.src(['lib/test/unit/**/*_test.js'], {read: false}) + .pipe(mocha({ + ui: 'tdd', + reporter: 'spec', + }))); } module.exports.generateCompleteTaskgraph = function(options) { diff --git a/packages/common/package.json b/packages/common/package.json index 700c17789..90ae78f1e 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -10,6 +10,7 @@ "init": "gulp init", "build": "gulp build", "test": "gulp test", + "test:unit": "gulp test:unit", "prepublishOnly": "gulp build-all", "format": "find src/ test/ -iname '*.ts' -o -iname '*.js' | xargs clang-format --style=file -i" }, diff --git a/packages/common/package.template.json b/packages/common/package.template.json index 732ef6c92..156a092a3 100644 --- a/packages/common/package.template.json +++ b/packages/common/package.template.json @@ -7,7 +7,8 @@ "build": "gulp build --silent", "release": "npm run compile", "lint": "gulp lint", - "test": "npm run clean && npm run build && npm run lint && mocha", + "test": "npm run clean && npm run build && npm run lint && npm run test:unit", + "test:unit": "mocha", "test:watch": "watchy -w src/ -- npm test --loglevel=silent", "format": "find src test | grep '\\.js$\\|\\.ts$' | xargs ./node_modules/.bin/clang-format --style=file -i", "prepublish": "tsc && npm test" diff --git a/packages/editor-service/package.json b/packages/editor-service/package.json index 446ee6ddf..bc5d098ff 100644 --- a/packages/editor-service/package.json +++ b/packages/editor-service/package.json @@ -18,6 +18,7 @@ "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" }, diff --git a/packages/linter/package.json b/packages/linter/package.json index c2e6c3c8c..35c6ea2db 100644 --- a/packages/linter/package.json +++ b/packages/linter/package.json @@ -47,6 +47,7 @@ "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", "run-on-polymer": "npm run build && (cd test/integration && bower install --silent) && INTEGRATION_TEST=true mocha lib/test/integration_test.js" }, diff --git a/packages/polyserve/package.json b/packages/polyserve/package.json index beb11dd57..b2b5a3269 100644 --- a/packages/polyserve/package.json +++ b/packages/polyserve/package.json @@ -13,6 +13,7 @@ "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" }, diff --git a/packages/project-config/package.json b/packages/project-config/package.json index fda6c73e5..88bea69f3 100644 --- a/packages/project-config/package.json +++ b/packages/project-config/package.json @@ -17,6 +17,7 @@ "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" }, "dependencies": {