Skip to content

Commit da8a684

Browse files
committed
refactor manual test
1 parent 0d85661 commit da8a684

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
### Yalc changelog
22

3+
## 1.0.0-pre.54
4+
5+
- handle JSX extension
6+
37
## 1.0.0-pre.53 (2020-07-23)
48

59
- node-notifier to peerDeps

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
"ts-node-dev": "node ./bin/ts-node-dev",
3737
"tsnd": "yarn ts-node-dev",
3838
"test": "ts-node -T test/index.ts",
39-
"test-dev": "ts-node-dev --respawn -T test/index.ts",
39+
"test-dev": "ts-node-dev -T --respawn test/index.ts",
4040
"test-docker": "docker-compose up",
4141
"ci": "yarn test",
4242
"ci-local": "docker run --name travis-debug -dit quay.io/travisci/ci-nodejs",
43-
"manual": "node ./bin/ts-node-dev --rt 5 --exit-child --tree-kill --clear -r tsconfig-paths/register -r ./test/manual/add-require -r ./test/manual/add-require-2 -r esm -O \"{\\\"module\\\": \\\"es6\\\"}\" --preserve-symlinks --respawn --ignore-watch 'lib' --ignore-watch bin --prefer-ts --debug --poll --interval 1000 --cache-directory .ts-node --inspect -- test/manual/test-script test-arg --fd",
43+
"manual": "ts-node test/manual/run.ts",
4444
"postinstall": "echo If you want desktop-notifications you can run \"npm i node-notifier@^5.4.0\"!"
4545
},
4646
"dependencies": {

test/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ test('It allow watch arbitrary folder/file', async (t) => {
5353
})
5454

5555
test('It should report an error on start', async (t) => {
56-
const ps = spawnTsNodeDev('--respawn with-error.ts')
56+
const ps = spawnTsNodeDev('--respawn with-error.ts') //.turnOnOutput()
5757
await ps.waitForLine(/[ERROR]/)
5858
const out = ps.getStdout()
5959
t.ok(/Compilation error in/.test(out), 'Reports error file')
@@ -185,7 +185,7 @@ test('It should fail if not using --dir or --script-mode on dir-test/index.ts',
185185
`--compiler-options=${JSON.stringify(cOptions)}`,
186186
`dir-test/index.ts`,
187187
].join(' ')
188-
)//.turnOnOutput()
188+
) //.turnOnOutput()
189189
await ps.waitForLine(/has no default export./)
190190
t.pass('ok')
191191
await ps.exit()

test/manual/run.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { execSync } from 'child_process'
2+
3+
const cmd = [
4+
'node bin/ts-node-dev',
5+
'--exit-child',
6+
'--tree-kill',
7+
'--clear',
8+
'-r tsconfig-paths/register',
9+
'-r ./test/manual/add-require',
10+
'-r ./test/manual/add-require-2',
11+
'-r esm -O "{\\"module\\": \\"es6\\"}"',
12+
'--preserve-symlinks',
13+
'--respawn',
14+
'--ignore-watch',
15+
'lib',
16+
'--ignore-watch bin',
17+
'--prefer-ts',
18+
'--debug',
19+
'--poll',
20+
'--interval 1000',
21+
'--inspect',
22+
'-- test/manual/test-script',
23+
'test-arg',
24+
'--fd',
25+
].join(' ')
26+
27+
execSync(cmd, { stdio: 'inherit' })

0 commit comments

Comments
 (0)