1.2.5 • Published 9 days ago

@repodog/jest-config v1.2.5

Weekly downloads
24
License
MIT
Repository
github
Last release
9 days ago

@repodog/jest-config

The Repodog Jest config.

npm version License: MIT

Install package

# terminal
npm install @repodog/jest-config --save-dev

Install dependencies

# terminal
npm install @jest/globals identity-obj-proxy jest suppress-experimental-warnings --save-dev

Install optional dependencies

# terminal
npm install babel-jest --save-dev
# or
npm install @swc/jest --save-dev

Use package

// package.json
{
  "scripts": {
    "test": "node --require=suppress-experimental-warnings --experimental-vm-modules node_modules/jest/bin/jest.js"
  }
}

With Babel

// jest.config.cjs
const jestConfig = require('@repodog/jest-config');

module.exports = {
  ...jestConfig(),
};

With SWC

// jest.config.cjs
const jestConfig = require('@repodog/jest-config');
const swcConfig = require('@repodog/swc-config');

module.exports = {
  ...jestConfig({ compilerOptions: swcConfig }),
};
// .vscode/launch.json
{
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Jest - current file",
      "program": "${workspaceFolder}/node_modules/jest/bin/jest",
      "args": [
        "${relativeFile}"
      ],
      "env": {
        "DEBUG": "true",
        "NODE_OPTIONS": "--experimental-vm-modules"
      },
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen"
    }
  ]
}

Environment variables

COMPILER = 'babel' || 'swc'

Uses either Babel or SWC to compile code for Jest. Default 'babel'.

DEBUG = 'true' || 'false'

Changes testMatch to cover all test files and disables the Jest timeout. These are useful to set when debugging a file in IDE. Default 'false'.

JS_ENV = 'web' || 'node'

When set to 'web', adds regexes to moduleNameMapper and transform to cater for .css and other file extensions Jest cannot resolve. Default 'node'.

1.2.5

9 days ago

1.2.4

18 days ago

1.2.3

2 months ago

1.2.2

3 months ago

1.2.0

3 months ago

1.2.1

3 months ago

1.2.0-unstable.0

3 months ago

1.1.12

3 months ago

1.1.9

7 months ago

1.1.8

7 months ago

1.1.7

7 months ago

1.1.6

8 months ago

1.1.5

8 months ago

1.1.4

9 months ago

1.1.11

7 months ago

1.1.10

7 months ago

1.1.1

1 year ago

1.0.0

1 year ago

1.1.3

11 months ago

1.1.2

11 months ago

1.1.0-alpha.0

1 year ago

1.0.1-alpha.0

1 year ago

1.0.2-alpha.0

1 year ago

1.0.0-alpha.0

1 year ago

0.3.32

4 years ago

0.3.31

4 years ago

0.3.30

4 years ago

0.3.29

4 years ago

0.3.28

4 years ago

0.3.27

4 years ago

0.3.26

4 years ago

0.3.25

5 years ago

0.3.24

5 years ago

0.3.23

5 years ago

0.3.22

5 years ago

0.3.21

5 years ago

0.3.20

5 years ago

0.3.18

5 years ago

0.3.17

5 years ago

0.3.16

5 years ago

0.3.15

5 years ago

0.3.12

5 years ago

0.3.10

5 years ago

0.2.26

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago