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

Convert Jest Tests to TypeScript #732

Merged
merged 6 commits into from
Aug 24, 2021
Merged

Convert Jest Tests to TypeScript #732

merged 6 commits into from
Aug 24, 2021

Conversation

alexasselin008
Copy link
Member

@alexasselin008 alexasselin008 commented Aug 23, 2021

Convert Jest Tests to TypeScript

Issues encountered :

  • jest utils files at the root use module.export instead of normal import / export. Not sure why
  • added 2 alias in the tsconfig. Should i make a tsconfig only for the tests, or is that overkill?

@netlify
Copy link

netlify bot commented Aug 23, 2021

✔️ Deploy Preview for sg-orbit ready!

🔨 Explore the source changes: ca9d28b

🔍 Inspect the deploy log: https://app.netlify.com/sites/sg-orbit/deploys/6124244ff69eca0008ee86e4

😎 Browse the preview: https://deploy-preview-732--sg-orbit.netlify.app

@netlify
Copy link

netlify bot commented Aug 23, 2021

✔️ Deploy Preview for sg-storybook ready!

🔨 Explore the source changes: ca9d28b

🔍 Inspect the deploy log: https://app.netlify.com/sites/sg-storybook/deploys/6124244f546c6b00086a5f95

😎 Browse the preview: https://deploy-preview-732--sg-storybook.netlify.app

tsconfig.json Outdated
"noEmit": true
"noEmit": true,
"baseUrl": ".",
"paths": {
Copy link
Member Author

@alexasselin008 alexasselin008 Aug 23, 2021

Choose a reason for hiding this comment

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

These paths are only for tests. Should we create a special config only for testing?

Copy link
Member

Choose a reason for hiding this comment

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

Yes I think that would be better, I guess you could inherit from the "common" configuration and extend it with the jest specific paths without duplicating any config?

How would you then tell Jest to use it's custom tsconfig?

@netlify
Copy link

netlify bot commented Aug 23, 2021

✔️ Deploy Preview for sg-storybook ready!

🔨 Explore the source changes: 4b441dd

🔍 Inspect the deploy log: https://app.netlify.com/sites/sg-storybook/deploys/61253d6ad87e9b00072a3ca7

😎 Browse the preview: https://deploy-preview-732--sg-storybook.netlify.app

@netlify
Copy link

netlify bot commented Aug 23, 2021

✔️ Deploy Preview for sg-orbit ready!

🔨 Explore the source changes: 4b441dd

🔍 Inspect the deploy log: https://app.netlify.com/sites/sg-orbit/deploys/61253d6ac857870007d332ec

😎 Browse the preview: https://deploy-preview-732--sg-orbit.netlify.app

@patricklafrance
Copy link
Member

jest utils files at the root use module.export instead of normal import / export. Not sure why

Sorry about that, I was lazy and didn't fix the eslint config. I think you can fix it by adding the following to the eslint config.

{
    "parserOptions": {
        "sourceType": "module"
    }
}

image

@alexasselin008 alexasselin008 merged commit 505e311 into master Aug 24, 2021
@alexasselin008 alexasselin008 deleted the feature/551 branch August 24, 2021 19:01
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.

2 participants