➜ react-ui-library-tutorial git:(master) yarn jest
yarn run v1.22.15
$ /Users/chenyulun390/github/react-ui-library-tutorial/node_modules/.bin/jest
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
No files found in /Users/myusername/github/react-ui-library-tutorial.
Make sure Jest's configuration does not exclude this directory.
To set up Jest, make sure a package.json file exists.
Jest Documentation: facebook.github.io/jest/docs/configuration.html
module.exports = {
verbose: true,
- roots: ['<rootDir>/components'],
+ roots: ['<rootDir>/components', '<rootDir>/src'],
moduleNameMapper: {
'\\.(css|less|scss)$': 'identity-obj-proxy',
'^components$': '<rootDir>/components/index.tsx',
'^components(.*)$': '<rootDir>/components/$1',
},
testRegex: '(/test/.*|\\.(test|spec))\\.(ts|tsx|js)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
testPathIgnorePatterns: ['/node_modules/', '/lib/', '/esm/', '/dist/'],
preset: 'ts-jest',
testEnvironment: 'jsdom',
};