You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No error occured, and use the new register instance compile the .ts file once when create a new register instance to cover an old one, the old one may be created by third-party library(e.g. karma cli).
The reason for create a new register is that, I want to use a special RegisterOptions for .test.ts files.
Actual Behavior
By debugging the source code, I found that if create two register, the require.extensions[.ts] handler was nested registration by registerExtensions function twice. And the .ts file was compiled twice, the old register's output as the new register's input, then some error occured, like below:
This is currently the expected behavior. It could be changed but there's always a possibility of double registration (e.g. if you had two ts-node instances we can't de-duplicate between them). A better solution is that you can ignore or only include certain paths with each instance registered.
Expected Behavior
No error occured, and use the new register instance compile the
.ts
file once when create a new register instance to cover an old one, the old one may be created by third-party library(e.g.karma cli
).The reason for create a new register is that, I want to use a special
RegisterOptions
for.test.ts
files.Actual Behavior
By debugging the source code, I found that if create two register, the
require.extensions[.ts]
handler was nested registration byregisterExtensions function
twice. And the.ts
file was compiled twice, the old register's output as the new register's input, then some error occured, like below:Steps to reproduce the problem
test.ts
for test the problem.index.js
, and create two register instances directly in order to simplify the problem, thenrequire
thetest.ts
file.node index.js
command.Minimal reproduction
ts-node-test
Specifications
The text was updated successfully, but these errors were encountered: