mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
016503d8c3
* feat: registry first iteration Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> * feat: improve webpack auto export loader Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> * chore: remove `compat` API Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> * chore: cleanup Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> --------- Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> |
||
---|---|---|
.. | ||
.gitignore | ||
index.cjs | ||
LICENSE | ||
package.json | ||
README.md | ||
setup-env.js | ||
shims.d.ts | ||
test-matchers.ts | ||
tsconfig.json |
Jest config for Flarum
This package provides a Jest config object to run unit & integration tests on Flarum extensions.
Usage
- Install the package:
yarn add --dev @flarum/jest-config
- Add
"type": "module"
to yourpackage.json
- Add
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
to yourpackage.json
scripts - Rename
webpack.config.js
towebpack.config.cjs
- Create a
jest.config.cjs
file with the following content:
module.exports = require('@flarum/jest-config')();
- If you are using TypeScript, create
tsconfig.test.json
with the following content:
{
"extends": "./tsconfig.json",
"include": ["tests/**/*"],
"files": ["../../../node_modules/@flarum/jest-config/shims.d.ts"]
}