-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
TSX file with JSX element can not be instrumented #1334
Comments
Hi team, could you please help me understand if there is anything wrong wrong on my side? This is the |
Interesting finding:
It looks like the JSX is causing problem here. |
I tried with more simple JSX element below, and it still causes the same issue:
Looks like TSX file with JSX element can not be instrumented in my repo current configuration. Hi team, do you have any idea on that? |
try add nyc config in package.json like below |
Hi @sxyy Thanks for your help and comment. Unfortunately, using that config didn't work for me. |
package.json
a.ts
when i run it got output
but when i remove config
|
Cool. That is interesting to know. In my understanding, it is an illegal syntax to have JSX element in |
same output
|
👍 Thanks for your verification. Can you share your |
tsconfig.json
|
Thanks again for sharing it. But it still does not work for me. Do you mind pushing this sample project to Github, so that I can download and compare it with my repo? |
I am having the same issue and this did not resolve it for me either. After some investigation, it seems to me that 'use strict';
const { parserPlugins } = require('@istanbuljs/schema').defaults.nyc;
module.exports = {
cache: false,
parserPlugins: parserPlugins.concat('typescript', 'jsx')
}; works. Anyways, for now I created a small package |
@loreanvictor Thanks for sharing your solution! I will try it and come back with result. |
thank u very much,it works for me!!!! |
Is there any update on this? We can't really have changes like this in our gitignored files ;) |
@SimonDanisch I think one way you can do before this issue gets a TRUE fix is to create a new file (e.g. nyc-config.js) which has same code as the updated
nyc-config.js
|
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Link to bug demonstration repository
My personal repo: https://github.com/yizheliu-amazon/anomaly-detection-kibana-plugin/tree/code-coverage-issue
What I have done:
1. Install dependencies of code-coverage for cypress and
nyc
, I did run below command:2. Other than that, I made below changes in
package.json
with configs fornyc
:package.json
: https://github.com/yizheliu-amazon/anomaly-detection-kibana-plugin/blob/code-coverage-issue/package.json3. I run command:
I find all the
.ts
files are instrumented as expected, while.tsx
and.js
files are not instrumented at all.Result
.ts
file[Instrumented]: https://github.com/yizheliu-amazon/anomaly-detection-kibana-plugin/blob/code-coverage-issue/.instrumented/hooks/useDelayedLoader.tsResult
.tsx
file[Not Instrumented]: https://github.com/yizheliu-amazon/anomaly-detection-kibana-plugin/blob/code-coverage-issue/.instrumented/components/ContentPanel/ContentPanel.tsxResult
.js
file[Not Instrumented]: https://github.com/yizheliu-amazon/anomaly-detection-kibana-plugin/blob/code-coverage-issue/.instrumented/app.jsExpected Behavior
All the
.ts
,.tsx
,.js
should be instrumentedObserved Behavior
None of
.tsx
and.js
file is instrumented, while all the.ts
files are instrumented as expected.Troubleshooting steps
cache: false
in my nyc configEnvironment Information
The text was updated successfully, but these errors were encountered: