From 0df1e0d1affbadf9e9a3a4927048f179ee22763c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 18 Jan 2018 14:42:32 +0100 Subject: [PATCH] build: move shared mocha.opts to @loopback/build This removes the last direct reference to monorepo-wide config and allows example packages to be cloned independently from the rest of the monorepo. --- package.json | 2 +- packages/authentication/package.json | 8 ++++---- {test => packages/build}/mocha.opts | 0 packages/build/package.json | 2 +- packages/build/test/mocha.opts | 1 - packages/context/package.json | 6 +++--- packages/core/package.json | 8 ++++---- packages/metadata/package.json | 6 +++--- packages/openapi-v2/package.json | 2 +- packages/repository/package.json | 6 +++--- packages/rest/package.json | 8 ++++---- 11 files changed, 24 insertions(+), 25 deletions(-) rename {test => packages/build}/mocha.opts (100%) delete mode 100644 packages/build/test/mocha.opts diff --git a/package.json b/package.json index 6635607c6f6c..83b0d0116fb2 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "build:full": "npm run clean:full && npm run bootstrap && npm run build && npm run mocha && npm run lint", "pretest": "npm run clean && npm run build:current", "test": "node packages/build/bin/run-nyc npm run mocha", - "mocha": "node packages/build/bin/select-dist mocha --opts test/mocha.opts \"packages/*/DIST/test/**/*.js\" \"packages/cli/test\"", + "mocha": "node packages/build/bin/select-dist mocha --opts packages/build/mocha.opts \"packages/*/DIST/test/**/*.js\" \"packages/cli/test\"", "posttest": "npm run lint" }, "config": { diff --git a/packages/authentication/package.json b/packages/authentication/package.json index f783aad788f8..6ccc96119566 100644 --- a/packages/authentication/package.json +++ b/packages/authentication/package.json @@ -6,18 +6,18 @@ "node": ">=6" }, "scripts": { - "acceptance": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/acceptance/**/*.js'", + "acceptance": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/acceptance/**/*.js'", "build": "npm run build:dist && npm run build:dist6", "build:current": "lb-tsc", "build:dist": "lb-tsc es2017", "build:dist6": "lb-tsc es2015", "build:apidocs": "lb-apidocs", "clean": "lb-clean loopback-authentication*.tgz dist dist6 package api-docs", - "integration": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/integration/**/*.js'", + "integration": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/integration/**/*.js'", "prepare": "npm run build && npm run build:apidocs", "pretest": "npm run build:current", - "test": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/integration/**/*.js' 'DIST/test/acceptance/**/*.js'", - "unit": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js'", + "test": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/integration/**/*.js' 'DIST/test/acceptance/**/*.js'", + "unit": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js'", "verify": "npm pack && tar xf loopback-authentication*.tgz && tree package && npm run clean" }, "author": "IBM", diff --git a/test/mocha.opts b/packages/build/mocha.opts similarity index 100% rename from test/mocha.opts rename to packages/build/mocha.opts diff --git a/packages/build/package.json b/packages/build/package.json index ab344e413bca..40bbd5eec6e7 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -40,7 +40,7 @@ "prettier:check": "npm run prettier:cli -- -l", "prettier:fix": "npm run prettier:cli -- --write", "test": "npm run mocha", - "mocha": "node bin/select-dist mocha --timeout 30000 --opts test/mocha.opts \"test/integration/*.js\"", + "mocha": "node bin/select-dist mocha --timeout 30000 --opts mocha.opts \"test/integration/*.js\"", "posttest": "npm run lint" }, "devDependencies": { diff --git a/packages/build/test/mocha.opts b/packages/build/test/mocha.opts deleted file mode 100644 index 4a5232017818..000000000000 --- a/packages/build/test/mocha.opts +++ /dev/null @@ -1 +0,0 @@ ---recursive diff --git a/packages/context/package.json b/packages/context/package.json index 19e85703fb02..a77bdb84c5fb 100644 --- a/packages/context/package.json +++ b/packages/context/package.json @@ -6,7 +6,7 @@ "node": ">=6" }, "scripts": { - "acceptance": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/acceptance/**/*.js'", + "acceptance": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/acceptance/**/*.js'", "build": "npm run build:dist && npm run build:dist6", "build:current": "lb-tsc", "build:dist": "lb-tsc es2017", @@ -15,8 +15,8 @@ "clean": "lb-clean loopback-context*.tgz dist dist6 package api-docs", "prepare": "npm run build && npm run build:apidocs", "pretest": "npm run build:current", - "test": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/acceptance/**/*.js'", - "unit": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js'", + "test": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/acceptance/**/*.js'", + "unit": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js'", "verify": "npm pack && tar xf loopback-context*.tgz && tree package && npm run clean" }, "author": "IBM", diff --git a/packages/core/package.json b/packages/core/package.json index 19c5f4acacd5..6089f2039d11 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -6,7 +6,7 @@ "node": ">=6" }, "scripts": { - "acceptance": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/acceptance/**/*.js'", + "acceptance": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/acceptance/**/*.js'", "build": "npm run build:dist && npm run build:dist6", "build:current": "lb-tsc", "build:dist": "lb-tsc es2017", @@ -15,9 +15,9 @@ "clean": "lb-clean loopback-core*.tgz dist dist6 package api-docs", "prepare": "npm run build && npm run build:apidocs", "pretest": "npm run build:current", - "integration": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/integration/**/*.js'", - "test": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/integration/**/*.js' 'DIST/test/acceptance/**/*.js'", - "unit": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js'", + "integration": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/integration/**/*.js'", + "test": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/integration/**/*.js' 'DIST/test/acceptance/**/*.js'", + "unit": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js'", "verify": "npm pack && tar xf loopback-core*.tgz && tree package && npm run clean" }, "author": "IBM", diff --git a/packages/metadata/package.json b/packages/metadata/package.json index 0a25a7b2645b..e170e5e0f890 100644 --- a/packages/metadata/package.json +++ b/packages/metadata/package.json @@ -6,7 +6,7 @@ "node": ">=6" }, "scripts": { - "acceptance": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/acceptance/**/*.js'", + "acceptance": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/acceptance/**/*.js'", "build": "npm run build:dist && npm run build:dist6", "build:current": "lb-tsc", "build:dist": "lb-tsc es2017", @@ -15,8 +15,8 @@ "clean": "lb-clean loopback-metadata*.tgz dist dist6 package api-docs", "prepare": "npm run build && npm run build:apidocs", "pretest": "npm run build:current", - "test": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/acceptance/**/*.js'", - "unit": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js'", + "test": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/acceptance/**/*.js'", + "unit": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js'", "verify": "npm pack && tar xf loopback-metadata*.tgz && tree package && npm run clean" }, "author": "IBM", diff --git a/packages/openapi-v2/package.json b/packages/openapi-v2/package.json index f2e4472e348d..20581b0a856c 100644 --- a/packages/openapi-v2/package.json +++ b/packages/openapi-v2/package.json @@ -19,7 +19,7 @@ "clean": "rm -rf loopback-openapi-v2*.tgz dist* package", "prepare": "npm run build && npm run build:apidocs", "pretest": "npm run build:current", - "test": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js'", + "test": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js'", "verify": "npm pack && tar xf loopback-openapi-v2*.tgz && tree package && npm run clean" }, "author": "IBM", diff --git a/packages/repository/package.json b/packages/repository/package.json index d1ebdbc8e244..5e8ebb70ec3c 100644 --- a/packages/repository/package.json +++ b/packages/repository/package.json @@ -7,7 +7,7 @@ }, "main": "index", "scripts": { - "acceptance": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/acceptance/**/*.js'", + "acceptance": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/acceptance/**/*.js'", "build": "npm run build:dist && npm run build:dist6", "build:current": "lb-tsc", "build:dist": "lb-tsc es2017", @@ -16,8 +16,8 @@ "clean": "lb-clean loopback-repository*.tgz dist dist6 package api-docs", "prepare": "npm run build && npm run build:apidocs", "pretest": "npm run build:current", - "test": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/acceptance/**/*.js'", - "unit": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js'", + "test": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/acceptance/**/*.js'", + "unit": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js'", "verify": "npm pack && tar xf loopback-juggler*.tgz && tree package && npm run clean" }, "author": "IBM", diff --git a/packages/rest/package.json b/packages/rest/package.json index 1b42ca998184..907cf511688c 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -6,7 +6,7 @@ "node": ">=6" }, "scripts": { - "acceptance": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/acceptance/**/*.js'", + "acceptance": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/acceptance/**/*.js'", "build": "npm run build:dist && npm run build:dist6", "build:current": "lb-tsc", "build:dist": "lb-tsc es2017", @@ -15,9 +15,9 @@ "clean": "lb-clean loopback-rest*.tgz dist dist6 package api-docs", "prepare": "npm run build && npm run build:apidocs", "pretest": "npm run build:current", - "integration": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/integration/**/*.js'", - "test": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/integration/**/*.js' 'DIST/test/acceptance/**/*.js'", - "unit": "lb-dist mocha --opts ../../test/mocha.opts 'DIST/test/unit/**/*.js'", + "integration": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/integration/**/*.js'", + "test": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js' 'DIST/test/integration/**/*.js' 'DIST/test/acceptance/**/*.js'", + "unit": "lb-dist mocha --opts node_modules/@loopback/build/mocha.opts 'DIST/test/unit/**/*.js'", "verify": "npm pack && tar xf loopback-rest*.tgz && tree package && npm run clean" }, "author": "IBM",