diff --git a/packages/ember/package.json b/packages/ember/package.json index c85881bc278d..eb8d9048cc34 100644 --- a/packages/ember/package.json +++ b/packages/ember/package.json @@ -23,7 +23,7 @@ "lint:hbs": "ember-template-lint .", "lint:js": "eslint . --cache --cache-location '../../eslintcache/'", "start": "ember serve", - "test": "bash ./scripts/run_tests.sh", + "test": "node ./scripts/run_tests.js", "test:ember": "ember test", "test:ember-compatibility": "ember try:each", "prepublishOnly": "ember ts:precompile", diff --git a/packages/ember/scripts/run_tests.js b/packages/ember/scripts/run_tests.js new file mode 100644 index 000000000000..fb594689893a --- /dev/null +++ b/packages/ember/scripts/run_tests.js @@ -0,0 +1,15 @@ +// running compatibilty tests takes ~15 min on a 2019 2.6 GHz 6-Core Intel i7 16" MacBook Pro w 32 GB of RAM, vs ~25 sec +// for the regular tests + +/*eslint-env node*/ +const { spawnSync } = require('child_process'); + +if (process.env.TRAVIS || process.env.GITHUB_ACTIONS) { + console.log('In CI - running tests against multiple versions of Ember'); + const result = spawnSync('yarn npm-run-all lint:* test:*', { shell: true, stdio: 'inherit' }); + process.exit(result.status); +} else { + console.log('Tests running locally - will only run tests against default version of Ember'); + const result = spawnSync('yarn npm-run-all lint:* test:ember', { shell: true, stdio: 'inherit' }); + process.exit(result.status); +} diff --git a/packages/ember/scripts/run_tests.sh b/packages/ember/scripts/run_tests.sh deleted file mode 100644 index ac70e08d80b7..000000000000 --- a/packages/ember/scripts/run_tests.sh +++ /dev/null @@ -1,10 +0,0 @@ -# running compatibilty tests takes ~15 min on a 2019 2.6 GHz 6-Core Intel i7 16" MacBook Pro w 32 GB of RAM, vs ~25 sec -# for the regular tests - -if [[ $TRAVIS || $GITHUB_ACTIONS ]]; then - echo "In CI - running tests against multiple versions of Ember" - yarn npm-run-all lint:* test:* -else - echo "Tests running locally - will only run tests against default version of Ember" - yarn npm-run-all lint:* test:ember -fi diff --git a/packages/node/test/manual/release-health/runner.js b/packages/node/test/manual/release-health/runner.js index 0452239a0902..ecbcf7fe15bc 100644 --- a/packages/node/test/manual/release-health/runner.js +++ b/packages/node/test/manual/release-health/runner.js @@ -29,7 +29,7 @@ for (const dir of scenariosDirs) { const processes = scenarios.map(([filename, filepath]) => { return new Promise(resolve => { - const scenarioProcess = spawn('/usr/bin/env', ['node', filepath]); + const scenarioProcess = spawn('node', [filepath]); const output = []; const errors = []; diff --git a/packages/node/test/utils.test.ts b/packages/node/test/utils.test.ts index 73887aad7cd7..6c8bb3627852 100644 --- a/packages/node/test/utils.test.ts +++ b/packages/node/test/utils.test.ts @@ -8,24 +8,24 @@ import { deepReadDirSync } from '../src/utils'; describe('deepReadDirSync', () => { it('handles nested files', () => { + const expected = [ + // root level + 'debra.txt', + // one level deep + 'cats/eddy.txt', + 'cats/persephone.txt', + 'cats/piper.txt', + 'cats/sassafras.txt', + 'cats/teaberry.txt', + // two levels deep + 'dogs/theBigs/charlie.txt', + 'dogs/theBigs/maisey.txt', + 'dogs/theSmalls/bodhi.txt', + 'dogs/theSmalls/cory.txt', + ].map(p => (process.platform === 'win32' ? p.replace(/\//g, '\\') : p)); + // compare sets so that order doesn't matter - expect(new Set(deepReadDirSync('./test/fixtures/testDeepReadDirSync'))).toEqual( - new Set([ - // root level - 'debra.txt', - // one level deep - 'cats/eddy.txt', - 'cats/persephone.txt', - 'cats/piper.txt', - 'cats/sassafras.txt', - 'cats/teaberry.txt', - // two levels deep - 'dogs/theBigs/charlie.txt', - 'dogs/theBigs/maisey.txt', - 'dogs/theSmalls/bodhi.txt', - 'dogs/theSmalls/cory.txt', - ]), - ); + expect(new Set(deepReadDirSync('./test/fixtures/testDeepReadDirSync'))).toEqual(new Set(expected)); }); it('handles empty target directory', (done: (error?: Error) => void) => { diff --git a/packages/wasm/package.json b/packages/wasm/package.json index 1d3a50aaece5..2a5c40f6c440 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -24,6 +24,7 @@ "@sentry-internal/eslint-config-sdk": "6.10.0", "@types/jest-environment-puppeteer": "^4.4.0", "@types/puppeteer": "^5.4.0", + "cross-env":"^7.0.3", "express": "^4.17.1", "jest": "^24.7.1", "jest-puppeteer": "^4.4.0", @@ -54,7 +55,7 @@ "fix": "run-s fix:eslint fix:prettier", "fix:prettier": "prettier --write \"{src,test}/**/*.ts\"", "fix:eslint": "eslint . --format stylish --fix", - "test": "PORT=1337 jest", + "test": "cross-env PORT=1337 jest", "test:watch": "jest --watch", "pack": "npm pack", "circularDepCheck": "madge --circular src/index.ts" diff --git a/yarn.lock b/yarn.lock index 3c7f2668e046..d6fe0948e4fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7266,6 +7266,13 @@ create-react-context@^0.2.2: fbjs "^0.8.0" gud "^1.0.0" +cross-env@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" + integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== + dependencies: + cross-spawn "^7.0.1" + cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -7277,7 +7284,7 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0, cross-spawn@^7.0.2: +cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==