-
Notifications
You must be signed in to change notification settings - Fork 68
fix: tests location when calling list-tests cli command #1138
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
Conversation
const enableSourceMaps = (): void => { | ||
if (areSourceMapsEnabled) { | ||
return; | ||
} | ||
|
||
areSourceMapsEnabled = true; | ||
|
||
revertTransformHook(); | ||
|
||
revertTransformHook = addHook( | ||
(code, filename) => transformCode(code, { sourceFile: filename, sourceMaps: true, isSilent }), | ||
{ | ||
exts: TRANSFORM_EXTENSIONS, | ||
matcher: filename => !filename.includes("node_modules"), | ||
ignoreNodeModules: false, | ||
}, | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually we register transform hook without sourcemaps so we dont waste any time generating it
This function will re-register transform hook with sourcemaps
commit: |
src/utils/typescript.ts
Outdated
matcher: filename => !filename.includes("node_modules"), | ||
ignoreNodeModules: false, | ||
}, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we get rid of duplication here (only value of sourceMaps
flag changes)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
assert.notCalled(addHookStub); | ||
}); | ||
|
||
it("should re-register transform hook with source maps", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you didn't check that the flag sourceMap: true
is specified on second call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cant.
We just pass callback (code, filename) => transformCode(...)
to "addHook"
So "addHook" was just called with some function and thats all we can get.
"flag sourceMap: true" is internal detail of "registerTransformHook" function implementation
f657808
to
0e3c950
Compare
0e3c950
to
56a12cd
Compare
No description provided.