- Clone the repo
- Run
yarn install
- Run
yarn test
- Notice you get the following error:
❯ yarn jest
yarn run v1.22.4
$ C:\dev\markd\gangbusters-discord-bot\node_modules\.bin\jest
● Validation Error:
Module C:\dev\markd\gangbusters-discord-bot\node_modules\jest-circus\runner.js in the testRunner option was not found.
<rootDir> is: C:\dev\markd\gangbusters-discord-bot
Configuration Documentation:
https://jestjs.io/docs/configuration
error Command failed with exit code 1.
A quick google turns up this: https://github.com/facebook/jest/issues/10297#issuecomment-1017307039
If one comments out resolver: 'jest-node-exports-resolver',
in jest.config.js
you then get this error:
FAIL src/index.test.ts
● Test suite failed to run
Cannot find module 'hono/powered-by' from 'src/index.ts'
Require stack:
src/index.ts
src/index.test.ts
22 | })
23 |
> 24 | // Routing
| ^
25 | app.get('/', (c) => c.html('<h1>Hello Hono!</h1>'))
26 | app.get('/auth/*', (c) => c.text('You are authorized'))
27 |
at Resolver.resolveModule (node_modules/jest-resolve/build/resolver.js:324:11)
at Object.<anonymous> (src/index.ts:24:25)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.441 s
Ran all test suites.
error Command failed with exit code 1.