1
0
mirror of https://github.com/flarum/core.git synced 2025-08-07 08:56:38 +02:00

feat(jest): create jest config package for unit testing (#3678)

* feat(jest): create jest config package for unit testing
* chore: housekeeping
* fix: now we need to explicitly allow importing without extension
* fix: recover EditorDriverInterface import
* Apply suggestions from code review
* chore: yarn

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
Sami Mazouz
2023-02-08 22:02:40 +01:00
committed by GitHub
parent 08dead81ce
commit e7fc29a59f
16 changed files with 2014 additions and 57 deletions

View File

@@ -0,0 +1,14 @@
# Jest config for Flarum
This package provides a [Jest](https://jestjs.io/) config object to run unit & integration tests on Flarum extensions.
## Usage
* Install the package: `yarn add --dev flarum-jest-config`
* Add `"type": "module"` to your `package.json`
* Add `"test": "yarn node --experimental-vm-modules $(yarn bin jest)"` to your `package.json` scripts
* Rename `webpack.config.js` to `webpack.config.cjs`
* Create a `jest.config.cjs` file with the following content:
```js
module.exports = require('flarum-jest-config')();
```