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

How to support JSX? #24

Open
aralroca opened this issue Jan 13, 2022 · 0 comments
Open

How to support JSX? #24

aralroca opened this issue Jan 13, 2022 · 0 comments

Comments

@aralroca
Copy link

aralroca commented Jan 13, 2022

package.json

{
 "scripts": {
    "test": "jest ./tests",
    "test:ts": "jest -c jest.tsc.config.js"
  },
 "jest-runner-tsc": {
    "tsconfigPath": "./tsconfig.json"
  }
}

jest: 27.4.7
jest-runner-tsc: 1.6.0

jest.tsc.config.js

module.exports = {
  runner: 'jest-runner-tsc',
  displayName: 'tsc',
  moduleFileExtensions: ['js', 'jsx','ts', 'tsx'],
  testMatch: ['<rootDir>/tests/*.tsx'],
};

tsconfig.json

{
  "compileOnSave": false,
  "module": "ESNext",
  "target": "ESNext",
  "compilerOptions": {
    "strict": true,
    "noEmit": true,
    "declaration": true,
      "moduleResolution": "node",
      "esModuleInterop": true
    },
  "include": ["package/*.ts", "test/*.tsx"]
}

Running yarn test is working fine!!!

However running yarn test:ts an error is fired: Cannot use JSX unless the '--jsx' flag is provided.. When do I need to add this --jsx flag?

image

Thanks

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

No branches or pull requests

1 participant