Skip to content

Commit

Permalink
ci: Enable and fix tests on MacOS
Browse files Browse the repository at this point in the history
For ava tests, register ts-node with adapted typescript config adaptions
via a javascript file. Before, the typescript config adaptions were
loaded via an environment variable not working on mac and Windows
via one configuration.
  • Loading branch information
lucas-koehler authored and sdirix committed Aug 16, 2023
1 parent e685ae8 commit 9694a70
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: pnpm run lint

- name: Test
if: matrix.os == 'windows-latest'
if: matrix.os == 'windows-latest' || matrix.os == 'macos-latest'
run: |
set NODE_OPTIONS=--max_old_space_size=4096
pnpm run test
Expand Down
6 changes: 3 additions & 3 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"report": "nyc report --reporter=html",
"test": "cross-env TS_NODE_COMPILER_OPTIONS={\\\"module\\\":\\\"commonjs\\\"} ava",
"test-cov": "cross-env TS_NODE_COMPILER_OPTIONS={\\\"module\\\":\\\"commonjs\\\"} nyc ava",
"test": "ava",
"test-cov": "nyc ava",
"doc": "typedoc --name 'JSON Forms Angular Core' --out docs src"
},
"nyc": {
Expand All @@ -61,7 +61,7 @@
"ts"
],
"require": [
"ts-node/register",
"./test-config/ts-node.config.js",
"source-map-support/register"
]
},
Expand Down
6 changes: 6 additions & 0 deletions packages/angular/test-config/ts-node.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Register ts-node and override ts options for ava
require('ts-node').register({
compilerOptions: {
module: 'commonjs',
},
});
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"report": "nyc report --reporter=html",
"test": "cross-env TS_NODE_COMPILER_OPTIONS={\\\"module\\\":\\\"commonjs\\\",\\\"target\\\":\\\"es5\\\"} ava",
"test-cov": "rimraf -rf .nyc_output && cross-env TS_NODE_COMPILER_OPTIONS={\\\"module\\\":\\\"commonjs\\\",\\\"target\\\":\\\"es5\\\"} nyc ava",
"test": "ava",
"test-cov": "rimraf -rf .nyc_output && nyc ava",
"doc": "typedoc --name 'JSON Forms Core' --excludeExternals --theme ../../typedoc-jsonforms --out docs src"
},
"ava": {
Expand All @@ -55,7 +55,7 @@
"ts"
],
"require": [
"ts-node/register",
"./test-config/ts-node.config.js",
"source-map-support/register"
]
},
Expand Down
7 changes: 7 additions & 0 deletions packages/core/test-config/ts-node.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Register ts-node and override ts options for ava
require('ts-node').register({
compilerOptions: {
module: 'commonjs',
target: 'es5',
},
});

0 comments on commit 9694a70

Please sign in to comment.