1 | import presetReact from '@berun/preset-react'
|
2 | import presetESlint from '@berun/runner-eslint'
|
3 | import { create as berunJs } from '@berun/berun'
|
4 |
|
5 | test('Gets Webpack module rules configuration', () => {
|
6 | const berun = berunJs(presetReact)
|
7 | berun.use(presetESlint)
|
8 | berun.webpack.toConfig()
|
9 |
|
10 | expect(berun.webpack.module.rule('eslint').toConfig()).toEqual({
|
11 | test: /\.(js|jsx|mjs|ts|tsx)$/,
|
12 | enforce: 'pre',
|
13 | include: ['/Volumes/DATA/projects/berun/packages/runner-eslint/src'],
|
14 | exclude: [/node_modules/],
|
15 | use: [
|
16 |
|
17 | {
|
18 | loader:
|
19 | '/Volumes/DATA/projects/berun/node_modules/eslint-loader/dist/cjs.js',
|
20 | options: {
|
21 | formatter: expect.any(Function),
|
22 | eslintPath:
|
23 | '/Volumes/DATA/projects/berun/node_modules/eslint/lib/api.js',
|
24 | baseConfig: {
|
25 | extends: [
|
26 | '/Volumes/DATA/projects/berun/node_modules/eslint-config-berun/src/.eslintrc.js'
|
27 | ],
|
28 | settings: { react: { version: '999.999.999' } }
|
29 | },
|
30 | ignore: false,
|
31 | useEslintrc: false,
|
32 | rules: {
|
33 | noRedeclare: false
|
34 | }
|
35 | }
|
36 | }
|
37 | ]
|
38 | })
|
39 | })
|