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

[TEST] Avoid Jest warning about missing TS sourcemap #1317

Merged
merged 5 commits into from
May 26, 2021

Conversation

tbouffard
Copy link
Member

Introduce a dedicated tsconfig file used by jest to ensure the sourcemap is
generated as we don't generate it for the regular build.

Introduce a dedicated tsconfig file used by jest to ensure the sourcemap is
generated as we don't generate it for the regular build.
@tbouffard tbouffard added the chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) label May 23, 2021
@tbouffard tbouffard marked this pull request as draft May 23, 2021 23:24
@aibcmars aibcmars self-requested a review May 25, 2021 14:32
@aibcmars
Copy link
Contributor

I think that tsconfig path should be relative to project root:

tsconfig: 'tsconfig.jest.json',

instead of
tsconfig: '../../tsconfig.jest.json',

@tbouffard
Copy link
Member Author

I think that tsconfig path should be relative to project root:

tsconfig: 'tsconfig.jest.json',

instead of
tsconfig: '../../tsconfig.jest.json',

I've found a way to configure the path using the <rootDir> variable thanks to https://kulshekhar.github.io/ts-jest/docs/getting-started/options/tsconfig#path-to-a-tsconfig-file.
I previously only tested the configuration from my IDE by running individual test: the working directory wasn't the project rootdirectory, the previous configuration was working. Too bad 😈

@tbouffard tbouffard marked this pull request as ready for review May 25, 2021 21:18
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@aibcmars aibcmars left a comment

Choose a reason for hiding this comment

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

LGTM

@aibcmars aibcmars merged commit 83b3cc1 into master May 26, 2021
@aibcmars aibcmars deleted the test/avoid_jest_warning_about_ts_sourcemap branch May 26, 2021 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants