0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-22 11:17:33 +01:00
hono/jest.config.js
Yusuke Wada 7dd486ad7b
feat: builtin middleware as sub module (#81)
# BREAKING CHANGES!!

Now, builtin middleware are not in main package. You can't use `Middleware.logger()` method. Call sub modules if needed:

```js
import { Hono } from 'hono'
import { poweredBy } from 'hono/powered-by'
import { logger } from 'hono/logger'

const app = new Hono()

app.use('*', poweredBy())
app.use('*', logger())
```

Closes: #80

---

* feat: builtin middleware as sub module

* fixed middleware

* Update readme

* Add types

* New gif
2022-02-01 22:15:00 +09:00

25 lines
613 B
JavaScript

module.exports = {
testMatch: ['**/test/**/*.+(ts|tsx|js)', '**/src/**/(*.)+(spec|test).+(ts|tsx|js)'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
testPathIgnorePatterns: ['./examples'],
testEnvironment: 'miniflare',
testEnvironmentOptions: {
/*
bindings: {
__STATIC_CONTENT: {
get: (key) => {
const table = { 'index.abcdef.index': 'This is index' }
return table[key]
},
},
__STATIC_CONTENT_MANIFEST: JSON.stringify({
'index.index': 'index.abcdef.index',
}),
},
kvNamespaces: ['TEST_NAMESPACE'],
*/
},
}