diff --git a/.changeset/fuzzy-cheetahs-approve.md b/.changeset/fuzzy-cheetahs-approve.md new file mode 100644 index 0000000000..10d6e49624 --- /dev/null +++ b/.changeset/fuzzy-cheetahs-approve.md @@ -0,0 +1,5 @@ +--- +"@medusajs/medusa": patch +--- + +feat(tests): harmonize and clean-up yarn test commands convention diff --git a/integration-tests/api/package.json b/integration-tests/api/package.json index 34a357e1ab..e7845eb3af 100644 --- a/integration-tests/api/package.json +++ b/integration-tests/api/package.json @@ -5,7 +5,7 @@ "license": "MIT", "private": true, "scripts": { - "test": "jest --silent=false --runInBand --bail --detectOpenHandles --forceExit", + "test:integration": "jest --silent=false --runInBand --bail --detectOpenHandles --forceExit", "build": "babel src -d dist --extensions \".ts,.js\"" }, "dependencies": { diff --git a/integration-tests/package.json b/integration-tests/package.json index ac81eadba5..fec2c881df 100644 --- a/integration-tests/package.json +++ b/integration-tests/package.json @@ -5,7 +5,7 @@ "main": "jest.config.js", "private": true, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test:integration": "echo \"Error: no test specified\" && exit 1" }, "author": "Zakaria S. El Asri", "license": "ISC", diff --git a/integration-tests/plugins/package.json b/integration-tests/plugins/package.json index ec9d1a6bd9..9872484a31 100644 --- a/integration-tests/plugins/package.json +++ b/integration-tests/plugins/package.json @@ -5,7 +5,7 @@ "license": "MIT", "private": true, "scripts": { - "test": "jest --silent=false --runInBand --bail --detectOpenHandles --forceExit", + "test:integration": "jest --silent=false --runInBand --bail --detectOpenHandles --forceExit", "build": "babel src -d dist --extensions \".ts,.js\"" }, "dependencies": { diff --git a/integration-tests/repositories/package.json b/integration-tests/repositories/package.json index 4e527b981f..6db8f577c4 100644 --- a/integration-tests/repositories/package.json +++ b/integration-tests/repositories/package.json @@ -5,7 +5,7 @@ "license": "MIT", "private": true, "scripts": { - "test": "jest --silent=false --runInBand --bail --detectOpenHandles --forceExit" + "test:integration": "jest --silent=false --runInBand --bail --detectOpenHandles --forceExit" }, "dependencies": { "@medusajs/medusa": "1.8.0-rc.6", diff --git a/package.json b/package.json index bd0a13c44c..223f1891d4 100644 --- a/package.json +++ b/package.json @@ -70,11 +70,11 @@ "lint:docs": "eslint -c docs/.eslintrc.js --ignore-path docs/.eslintignore docs/content", "prettier": "prettier", "jest": "jest", - "test": "turbo run test --no-daemon --filter=!integration-tests-api --filter=!integration-tests-plugins --filter=!integration-tests-repositories", - "test:integration": "turbo run test --no-daemon --filter=integration-tests-api --filter=integration-tests-plugins --filter=integration-tests-repositories", - "test:integration:api": "turbo run test --no-daemon --filter=integration-tests-api", - "test:integration:plugins": "turbo run test --no-daemon --filter=integration-tests-plugins", - "test:integration:repositories": "turbo run test --no-daemon --filter=integration-tests-repositories", + "test": "turbo run test --no-daemon", + "test:integration": "turbo run test:integration --no-daemon", + "test:integration:api": "turbo run test:integration --no-daemon --filter=integration-tests-api", + "test:integration:plugins": "turbo run test:integration --no-daemon --filter=integration-tests-plugins", + "test:integration:repositories": "turbo run test:integration --no-daemon --filter=integration-tests-repositories", "openapi:generate": "yarn ./packages/oas/oas-github-ci run ci", "medusa-oas": "yarn ./packages/oas/medusa-oas-cli run medusa-oas", "generate:services": "typedoc --options typedoc.services.js", diff --git a/packages/cache-inmemory/package.json b/packages/cache-inmemory/package.json index 48af9e388e..870678d9dc 100644 --- a/packages/cache-inmemory/package.json +++ b/packages/cache-inmemory/package.json @@ -27,8 +27,7 @@ "watch": "tsc --build --watch", "prepare": "cross-env NODE_ENV=production yarn run build", "build": "tsc --build", - "test": "jest --passWithNoTests", - "test:unit": "jest --passWithNoTests" + "test": "jest --passWithNoTests" }, "dependencies": { "@medusajs/modules-sdk": "0.1.0-rc.4" diff --git a/packages/cache-redis/package.json b/packages/cache-redis/package.json index f8e1901cb2..87e9a3b43e 100644 --- a/packages/cache-redis/package.json +++ b/packages/cache-redis/package.json @@ -27,8 +27,7 @@ "watch": "tsc --build --watch", "prepare": "cross-env NODE_ENV=production yarn run build", "build": "tsc --build", - "test": "jest --passWithNoTests", - "test:unit": "jest --passWithNoTests" + "test": "jest --passWithNoTests" }, "dependencies": { "@medusajs/modules-sdk": "0.1.0-rc.4", diff --git a/packages/event-bus-local/package.json b/packages/event-bus-local/package.json index 0b1b205d2b..888025de3a 100644 --- a/packages/event-bus-local/package.json +++ b/packages/event-bus-local/package.json @@ -27,8 +27,7 @@ "watch": "tsc --build --watch", "prepare": "cross-env NODE_ENV=production yarn run build", "build": "tsc --build", - "test": "jest --passWithNoTests", - "test:unit": "jest --passWithNoTests" + "test": "jest --passWithNoTests" }, "dependencies": { "@medusajs/modules-sdk": "0.1.0-rc.4", diff --git a/packages/event-bus-redis/package.json b/packages/event-bus-redis/package.json index de4c56151d..73cd1b792f 100644 --- a/packages/event-bus-redis/package.json +++ b/packages/event-bus-redis/package.json @@ -28,8 +28,7 @@ "watch": "tsc --build --watch", "prepare": "cross-env NODE_ENV=production yarn run build", "build": "tsc --build", - "test": "jest --passWithNoTests", - "test:unit": "jest --passWithNoTests" + "test": "jest --passWithNoTests" }, "dependencies": { "@medusajs/modules-sdk": "0.1.0-rc.4", diff --git a/packages/inventory/package.json b/packages/inventory/package.json index 28339c0135..c5bc49a71a 100644 --- a/packages/inventory/package.json +++ b/packages/inventory/package.json @@ -33,7 +33,6 @@ "watch": "tsc --build --watch", "prepare": "cross-env NODE_ENV=production yarn run build", "build": "tsc --build", - "test": "jest --passWithNoTests", - "test:unit": "jest --passWithNoTests" + "test": "jest --passWithNoTests" } } diff --git a/packages/medusa/package.json b/packages/medusa/package.json index a154a454aa..eec0e3a67f 100644 --- a/packages/medusa/package.json +++ b/packages/medusa/package.json @@ -35,8 +35,7 @@ "prepare": "cross-env NODE_ENV=production yarn run build", "build": "tsc --build", "serve": "node dist/app.js", - "test": "jest", - "test:unit": "jest" + "test": "jest" }, "peerDependencies": { "@medusajs/types": "0.0.2-rc.1", diff --git a/packages/modules-sdk/package.json b/packages/modules-sdk/package.json index 79c6a8423e..9d5876e35c 100644 --- a/packages/modules-sdk/package.json +++ b/packages/modules-sdk/package.json @@ -33,7 +33,6 @@ "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", "build": "tsc --build", - "test": "jest", - "test:unit": "jest" + "test": "jest" } } diff --git a/packages/oas/medusa-oas-cli/package.json b/packages/oas/medusa-oas-cli/package.json index 51091f5b64..59edb5dd1f 100644 --- a/packages/oas/medusa-oas-cli/package.json +++ b/packages/oas/medusa-oas-cli/package.json @@ -32,8 +32,7 @@ "prepare": "cross-env NODE_ENV=production yarn run build", "build": "tsc --build", "medusa-oas": "ts-node src/index.ts", - "test": "jest src", - "test:unit": "jest src" + "test": "jest src" }, "dependencies": { "@medusajs/medusa": "1.8.0-rc.6", diff --git a/packages/oas/oas-github-ci/package.json b/packages/oas/oas-github-ci/package.json index 336fd5df36..3978858bc0 100644 --- a/packages/oas/oas-github-ci/package.json +++ b/packages/oas/oas-github-ci/package.json @@ -18,8 +18,7 @@ "ci": "node scripts/build-openapi.js", "preview:admin": "yarn redocly preview-docs ../../../docs/api/admin/openapi.yaml --config=../../../docs-util/redocly/config.yaml", "preview:store": "yarn redocly preview-docs ../../../docs/api/store/openapi.yaml --config=../../../docs-util/redocly/config.yaml", - "test": "jest --passWithNoTests", - "test:unit": "jest --passWithNoTests" + "test": "jest --passWithNoTests" }, "dependencies": { "@medusajs/medusa-oas-cli": "0.2.0-rc.6", diff --git a/packages/oas/openapi-typescript-codegen/package.json b/packages/oas/openapi-typescript-codegen/package.json index c2cbcdcbfc..989673dfea 100644 --- a/packages/oas/openapi-typescript-codegen/package.json +++ b/packages/oas/openapi-typescript-codegen/package.json @@ -22,8 +22,7 @@ "prepare": "cross-env NODE_ENV=production yarn run release", "build": "rollup --config --environment NODE_ENV:development", "release": "rollup --config --environment NODE_ENV:production", - "test": "jest --passWithNoTests", - "test:unit": "jest --passWithNoTests" + "test": "jest --passWithNoTests" }, "dependencies": { "camelcase": "^6.3.0", diff --git a/packages/stock-location/package.json b/packages/stock-location/package.json index ca6b45116a..7eeaf0b64d 100644 --- a/packages/stock-location/package.json +++ b/packages/stock-location/package.json @@ -33,7 +33,6 @@ "watch": "tsc --build --watch", "prepare": "cross-env NODE_ENV=production yarn run build", "build": "tsc --build", - "test": "jest --passWithNoTests", - "test:unit": "jest --passWithNoTests" + "test": "jest --passWithNoTests" } } diff --git a/turbo.json b/turbo.json index fce50a9f6a..ea6e7c1025 100644 --- a/turbo.json +++ b/turbo.json @@ -16,6 +16,12 @@ "build" ], "outputs": [] + }, + "test:integration": { + "dependsOn": [ + "build" + ], + "outputs": [] } }, "globalDependencies": [