Skip to content

Commit 00058bb

Browse files
authored
feat: Add Support for Windows hosts (#224)
* fix(templates): fix lint command * test: add support for Windows Test Enviornment By using platform from node process, we can support executing test for Windows host * chore: replace single quotes by double ones Single quotes fail in Windows Hosts * chore(tsconfig): enable importHelpers The compiler option "importHelpers" should be enabled to reduce the output size. See more: https://www.typescriptlang.org/tsconfig#importHelpers
1 parent d0a1889 commit 00058bb

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"test:coverage": "npm run test -- --coverage",
1818
"test:ci": "npm run test -- --colors --coverage --ci",
1919
"lint": "eslint --ext .ts,.js .",
20-
"format": "prettier 'src/**' --write --ignore-unknown",
21-
"format:check": "prettier --check 'src/**' --ignore-unknown"
20+
"format": "prettier \"src/**\" --write --ignore-unknown",
21+
"format:check": "prettier --check \"src/**\" --ignore-unknown"
2222
},
2323
"engines": {
2424
"node": ">=16"

src/index.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ describe('Example Test', function () {
1111
process.env.PORT = '0'
1212

1313
const index = Path.resolve(__dirname, 'index.ts')
14-
const proc = await spawn('ts-node', [index])
14+
const tsNodeExe = process.platform === 'win32' ? './node_modules/.bin/ts-node.cmd' : './node_modules/.bin/ts-node'
15+
const proc = await spawn(tsNodeExe, [index])
1516

1617
expect(proc.pid).toBeDefined()
1718

templates/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
2828
- name: Lint
2929
run: |
30-
npm run lint:ci
30+
npm run lint
3131
3232
- name: Test
3333
run: |

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"moduleResolution": "node",
66
"allowSyntheticDefaultImports": true,
77
"esModuleInterop": true,
8-
"importHelpers": false,
8+
"importHelpers": true,
99
"resolveJsonModule": true,
1010
"sourceMap": true,
1111
"declaration": true,

0 commit comments

Comments
 (0)