Skip to content
Discussion options

You must be logged in to vote

That example uses test-library. I was able to get this to work, but I used the testUtils import in my test instead of a direct import. Looks like it just exports the test-library module anyway, but I didn't change anything about the example except I added your test in the index.test.tsx file.

And for the pathing, you'll have to specify your custom paths in the jest.config.js (at least from my own testing).

  moduleNameMapper: {
    '\\.(css|less|sass|scss)$': 'identity-obj-proxy',
    '\\.(gif|ttf|eot|svg|png)$': '<rootDir>/test/__mocks__/fileMock.js',
    "^@pages(.*)$": "<rootDir>/pages$1",
  },

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gtodd876
Comment options

Answer selected by gtodd876
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants