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

Relative paths don't working with Jest #4

Closed
patrickjmeurer opened this issue Aug 6, 2022 · 2 comments · Fixed by #8
Closed

Relative paths don't working with Jest #4

patrickjmeurer opened this issue Aug 6, 2022 · 2 comments · Fixed by #8
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@patrickjmeurer
Copy link
Owner

Some relative paths is not working with Jest.

Default Jest configuration on project:

module.exports = {
  testEnvironment: "jsdom",
  transform: {
    "^.+\\.tsx?$": "ts-jest"
  },
  moduleNameMapper: {
    '\\.(gif|ttf|eot|svg|png)$': '<rootDir>/test/__mocks__/fileMock.js',
    '\\.(css|less|sass|scss)$': 'identity-obj-proxy',
    "^@/(.*)$": "<rootDir>/src/$1"
  },
  setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
}

This configuration is causing the error below:
image

Solutions:

  • Documentation orientation;
  • Pre send a file with @/Components/ relative path.
@patrickjmeurer patrickjmeurer added bug Something isn't working documentation Improvements or additions to documentation labels Aug 6, 2022
@patrickjmeurer patrickjmeurer self-assigned this Aug 6, 2022
@lucasluca
Copy link

still having this issue when running on Github actions, but locally it works normal

@patrickjmeurer
Copy link
Owner Author

Hello @lucasluca

Can you open a issue with some prints and informations about this problem?

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants