Skip to content

Commit d9de728

Browse files
authored
chore: Unify ts-node/register config in one place; Be more verbose when storing spectron debug metadata (#2421)
* chore: Normalize TS_NODE_FILES usage across packages * ci(github): Provide a distinct name for spectron debug files based on the os and workflow name * chore(@mongodb-js/mocha-config-compass): Call register directly and provide options so that packages that depend on it doesn't need to provide env vars manually
1 parent 6e365d2 commit d9de728

File tree

7 files changed

+7
-8
lines changed

7 files changed

+7
-8
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,5 @@ jobs:
104104
uses: actions/upload-artifact@v2
105105
if: ${{ cancelled() || failure() }}
106106
with:
107-
name: Spectron Debug Log ${{ runner.os }}
107+
name: Spectron Debug Files ${{ github.workflow }} ${{ runner.os }}
108108
path: packages/compass-e2e-tests/.log/**/*

.github/workflows/check-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ jobs:
7777
uses: actions/upload-artifact@v2
7878
if: ${{ cancelled() || failure() }}
7979
with:
80-
name: Spectron Debug Log ${{ runner.os }}
80+
name: Spectron Debug Files ${{ github.workflow }} ${{ runner.os }}
8181
path: packages/compass-e2e-tests/.log/**/*

configs/mocha-config-compass/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
colors: true,
55
timeout: 15000,
66
require: [
7-
'ts-node/register',
7+
path.resolve(__dirname, 'tsnode-register.js'),
88
path.resolve(__dirname, 'sinon-chai-register.js'),
99
],
1010
spec: 'src/**/*.spec.*',
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require('ts-node').register({ files: true });

packages/compass-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"check": "npm run lint && npm run depcheck",
2828
"check-ci": "npm run check",
2929
"test": "mocha",
30-
"test-cov": "cross-env TS_NODE_FILES=true nyc -x \"**/*.spec.*\" npm run test",
30+
"test-cov": "nyc -x \"**/*.spec.*\" npm run test",
3131
"test-watch": "npm run test -- --watch",
3232
"test-ci": "npm run test-cov",
3333
"reformat": "npm run prettier -- --write ."

packages/data-service/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
"lint": "npm run eslint . && npm run prettier -- --check .",
4343
"check": "npm run lint && npm run depcheck",
4444
"check-ci": "npm run check",
45-
"test": "mocha --timeout 15000 -r ts-node/register **/*.spec.*",
4645
"pretest": "npm run compile && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar",
46+
"test": "mocha",
4747
"posttest": "mongodb-runner stop --port=27018",
4848
"test-cov": "nyc -x \"**/*.spec.*\" npm run test",
4949
"test-watch": "npm run test -- --watch",
@@ -91,7 +91,6 @@
9191
"rimraf": "^3.0.2",
9292
"sinon": "^9.2.3",
9393
"sinon-chai": "^3.5.0",
94-
"ts-node": "^10.1.0",
9594
"typescript": "^4.3.5"
9695
}
9796
}

scripts/create-workspace.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ async function main(argv) {
173173
'check-ci': 'npm run check',
174174
test: 'mocha',
175175
'test-cov':
176-
'cross-env TS_NODE_FILES=true nyc -x "**/*.spec.*" npm run test',
176+
'nyc -x "**/*.spec.*" npm run test',
177177
'test-watch': 'npm run test -- --watch',
178178
'test-ci': 'npm run test-cov',
179179
reformat: 'npm run prettier -- --write .'
@@ -188,7 +188,6 @@ async function main(argv) {
188188
'@types/chai': '*',
189189
'@types/mocha': '*',
190190
'@types/sinon-chai': '*',
191-
'cross-env': '*',
192191
chai: '*',
193192
depcheck: '*',
194193
eslint: '*',

0 commit comments

Comments
 (0)