Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add test for env integration #125

Merged
merged 5 commits into from
Jan 7, 2021
Merged

test: add test for env integration #125

merged 5 commits into from
Jan 7, 2021

Conversation

climba03003
Copy link
Member

@climba03003 climba03003 commented Dec 24, 2020

Resolve #102
I do not know if it is the right approach for testing ts-node and ts-node-dev integration. But I think it is the only way to see if it is working properly.

The two test case increase the test time from 1S to 8S and I think it is not worth for such two test case.

Checklist

@mcollina
Copy link
Member

are those needed to be jest-tests? I think these can get better with tap (as they'd run in parallel). I would also recommend using spawn instead of spawnSync and keep things asynchronous.

@climba03003
Copy link
Member Author

climba03003 commented Dec 24, 2020

are those needed to be jest-tests? I think these can get better with tap (as they'd run in parallel). I would also recommend using spawn instead of spawnSync and keep things asynchronous.

I can use tap for the ts-node test.
however, ts-node-dev always error when using tap

test/typescript/integration.ts 1>     Ignore watch: []
test/typescript/integration.ts 1>     [INFO] 22:32:09 ts-node-dev ver. 1.1.1 (using ts-node ver. 9.1.1, typescript ver. 3.9.7)
test/typescript/integration.ts 1>     [DEBUG] 22:32:09 Starting child process -r /tmp/ts-node-dev-hook-060858551201929734.js /fastify-autoload/node_modules/ts-node-dev/lib/wrap.js /fastify-autoload/test/typescript/basic/ts-node-dev.ts
test/typescript/integration.ts 1>     [DEBUG] 22:32:09 /fastify-autoload/test/typescript/basic/ts-node-dev.ts added to watcher
test/typescript/integration.ts 1>     [DEBUG] 22:32:11 /fastify-autoload/test/typescript/basic/ts-node-dev.ts compiled in 1595 ms
test/typescript/integration.ts 2> RangeError: Maximum call stack size exceeded
test/typescript/integration.ts 2>     at stringify (<anonymous>)
test/typescript/integration.ts 2>     at writeChannelMessage (internal/child_process/serialization.js:117:20)
test/typescript/integration.ts 2>     at process.target._send (internal/child_process.js:804:17)
test/typescript/integration.ts 2>     at process.target.send (internal/child_process.js:702:19)
test/typescript/integration.ts 2>     at Object.exports.send (/fastify-autoload/node_modules/ts-node-dev/lib/ipc.js:17:14)
test/typescript/integration.ts 2>     at /fastify-autoload/node_modules/ts-node-dev/lib/wrap.js:88:9
test/typescript/integration.ts 2>     at nodeDevHook (/fastify-autoload/node_modules/ts-node-dev/lib/hook.js:61:17)
test/typescript/integration.ts 2>     at /fastify-autoload/node_modules/append-transform/index.js:62:4
test/typescript/integration.ts 2>     at nodeDevHook (/fastify-autoload/node_modules/ts-node-dev/lib/hook.js:63:13)
test/typescript/integration.ts 2>     at /fastify-autoload/node_modules/append-transform/index.js:62:4
test/typescript/integration.ts 1>     [DEBUG] 22:32:11 Child error
test/typescript/integration.ts 1>     [ERROR] 22:32:11 RangeError: Maximum call stack size exceeded
test/typescript/integration.ts 1>     [DEBUG] 22:32:11 Disconnecting from child
test/typescript/integration.ts 1>     [DEBUG] 22:32:11 Sending SIGTERM kill to child pid 18281
test/typescript/integration.ts 1>     [DEBUG] 22:32:11 Child exited with code 0

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@climba03003
Copy link
Member Author

this PR is ignored in space.

@mcollina mcollina merged commit 026d686 into fastify:master Jan 7, 2021
@mcollina
Copy link
Member

mcollina commented Jan 7, 2021

Sorry for the delay, I hoped somebody else would take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create tests for ts-node and ts-node-dev
2 participants