diff --git a/README.md b/README.md index 448744b..357de7b 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ npm install ``` npm run test:core:coverage npm run test:jest +npm run test:vitest npm run test:cypress npm run test:cra ``` diff --git a/package.json b/package.json index 604d074..5d237c1 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,9 @@ "lint": "npm run lint --workspaces --if-present", "test:core:coverage": "npm run test:coverage -w packages/core", "test:jest": "npm run build && npm run test:ks -w packages/jest-example-test-suite", + "test:vitest": "npm run build && npm run test:ks -w packages/vitest-example-test-suite", "test:cypress": "npm run build && npm run test:ks -w packages/cypress-example-test-suite", "test:cra": "cd packages/create-react-app-example && npm install && npm run test:ks", - "test:examples": "npm run test:jest && npm run test:cypress && npm run test:cra" + "test:examples": "npm run test:jest && npm run test:vitest && npm run test:cypress && npm run test:cra" } } diff --git a/packages/vitest-example-test-suite/bin/knapsack_pro_vitest b/packages/vitest-example-test-suite/bin/knapsack_pro_vitest new file mode 100755 index 0000000..58f6f74 --- /dev/null +++ b/packages/vitest-example-test-suite/bin/knapsack_pro_vitest @@ -0,0 +1,19 @@ +#!/bin/bash + +CI_BUILD_ID=$(openssl rand -base64 32) + +ENDPOINT=https://api-staging.knapsackpro.com +# ENDPOINT=http://api.knapsackpro.test:3000 + +LOG_LEVEL=info +# LOG_LEVEL=debug + +# TODO remove KNAPSACK_PRO_TEST_SUITE_TOKEN once we start using KNAPSACK_PRO_TEST_SUITE_TOKEN_VITEST +KNAPSACK_PRO_ENDPOINT=$ENDPOINT \ + KNAPSACK_PRO_TEST_SUITE_TOKEN=d264b4b40f900d79178ca63e7ffc971f \ + KNAPSACK_PRO_TEST_SUITE_TOKEN_VITEST=d264b4b40f900d79178ca63e7ffc971f \ + KNAPSACK_PRO_LOG_LEVEL=$LOG_LEVEL \ + KNAPSACK_PRO_CI_NODE_BUILD_ID=$CI_BUILD_ID \ + KNAPSACK_PRO_CI_NODE_TOTAL=${2:-2} \ + KNAPSACK_PRO_CI_NODE_INDEX=${1:-0} \ + npx @knapsack-pro/vitest --verbose diff --git a/packages/vitest-example-test-suite/package.json b/packages/vitest-example-test-suite/package.json index 41342b4..9e999a3 100644 --- a/packages/vitest-example-test-suite/package.json +++ b/packages/vitest-example-test-suite/package.json @@ -9,7 +9,8 @@ "vitest": "^2.1.6" }, "scripts": { - "test": "vitest" + "test": "vitest", + "test:ks": "bin/knapsack_pro_vitest" }, "repository": { "type": "git",