diff --git a/package-lock.json b/package-lock.json index 4ca3397f48..f9cad68a1d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,6 +41,7 @@ "govuk-prototype-kit": "bin/cli" }, "devDependencies": { + "cross-env": "^7.0.3", "cypress": "^10.6.0", "eslint-plugin-cypress": "^2.12.1", "extract-zip": "^2.0.1", @@ -3155,6 +3156,24 @@ "node": ">= 0.10" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -14590,6 +14609,15 @@ "vary": "^1" } }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/package.json b/package.json index ecab3c3305..3a3991f4fa 100644 --- a/package.json +++ b/package.json @@ -26,16 +26,16 @@ "scripts": { "tmp-kit": "mkdir -p $TMPDIR/govuk-prototype-kit-playground && cd $TMPDIR/govuk-prototype-kit-playground && rm -Rf ./* && govuk-prototype-kit create --version local . && npm start", "start": "echo 'This project cannot be started, in order to test this project please create a prototype kit using the cli.'", - "start:package": "KIT_TEST_DIR=tmp/test-prototype-package node cypress/scripts/run-starter-prototype", + "start:package": "cross-env KIT_TEST_DIR=tmp/test-prototype-package node cypress/scripts/run-starter-prototype", "lint": "standard '**/*.js' bin/cli scripts/create-release-archive lib/build/dev-server lib/build/generate-assets", "rapidtest": "jest --bail", "cypress:open": "cypress open", "test:heroku": "echo 'test:heroku' needs to be implemented", - "test:acceptance": "KIT_TEST_DIR=tmp/test-prototype-package start-server-and-test 'node cypress/scripts/run-starter-prototype' 3000 'cypress run'", - "test:acceptance:open": "KIT_TEST_DIR=tmp/test-prototype-package start-server-and-test 'node cypress/scripts/run-starter-prototype' 3000 'cypress open'", + "test:acceptance": "cross-env KIT_TEST_DIR=tmp/test-prototype-package start-server-and-test 'node cypress/scripts/run-starter-prototype' 3000 'cypress run'", + "test:acceptance:open": "cross-env KIT_TEST_DIR=tmp/test-prototype-package start-server-and-test 'node cypress/scripts/run-starter-prototype' 3000 'cypress open'", "test:smoke": "cypress run --spec \"cypress/integration/0-smoke-tests/*\"", "test:unit": "jest --detectOpenHandles lib", - "test:integration": "IS_INTEGRATION_TEST=true jest --detectOpenHandles --testTimeout=30000 __tests__", + "test:integration": "cross-env IS_INTEGRATION_TEST=true jest --detectOpenHandles --testTimeout=30000 __tests__", "test": "npm run test:unit && npm run test:integration && npm run lint" }, "dependencies": { @@ -69,6 +69,7 @@ "uuid": "^8.3.2" }, "devDependencies": { + "cross-env": "^7.0.3", "cypress": "^10.6.0", "eslint-plugin-cypress": "^2.12.1", "extract-zip": "^2.0.1",