@connectedcars/jest-runner-integration
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Jest Runner Integration

Jest runner that runs integration test in band and units test in parallel and run both in parallel.

Test files are treated as integration tests if they end in it.test.ts or it.test.js.

This can speed up test runs if you are forced to run all your test in band because some of them share a resource(fx. a database) and can not run at the same time.

Using

npm install @connectedcars/jest-runner-integration

jest.config.js:

module.exports = {
  ...
  runner: '@connectedcars/jest-runner-integration',
  ...
}

VSCode setup for debugging

launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "name": "vscode-jest-tests",
      "request": "launch",
      "args": [
        "--runInBand",
        "--coverage=false",
        "--testTimeout=100000",
        "mysql/common"
      ],
      "cwd": "${workspaceFolder}",
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "program": "${workspaceFolder}/node_modules/jest/bin/jest"
    },
    {
      "name": "jest-runner",
      "type": "node",
      "runtimeArgs": [
        "./node_modules/.bin/jest",
      ],
      "console": "integratedTerminal",
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "preLaunchTask": "npm: build:js",
      "outFiles": [
        "${workspaceRoot}/build/dist/**/**.js"
      ],
      "sourceMaps": true,
      "args": [],
      "env": {},
      "internalConsoleOptions": "openOnSessionStart"
    }
  ]
}

settings.json:

{
  "typescript.tsdk": "node_modules/typescript/lib",
  "eslint.enable": true,
  "eslint.validate": [
    "javascript",
    "typescript"
  ],
  "files.autoSave": "off",
  "files.exclude": {
    "**/.git": true,
    "**/.DS_Store": true,
    "build": true
  },
  "git.ignoreLimitWarning": true,
  "[javascripts][javascriptreact][typescript][typescriptreact][json]": {
    "editor.formatOnSave": false,
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": true
    }
  },
  "[json][jsonc]": {
    "editor.formatOnSave": true
  }
}

tasks.json:

{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "npm",
      "script": "build",
      "problemMatcher": [
        "$tsc"
      ],
      "group": "build",
      "label": "npm: build",
      "detail": "build -- src"
    }
  ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i @connectedcars/jest-runner-integration

Weekly Downloads

18

Version

1.0.1

License

MIT

Unpacked Size

9.18 kB

Total Files

5

Last publish

Collaborators

  • miafoo
  • jfbn
  • emillykkeg
  • bismlb
  • mlsalexius
  • gbullock
  • thormortensen
  • jkrichardson
  • betlemaguado
  • lmfros
  • jt_connectedcars
  • lbrcc
  • tjansson
  • jagdos
  • tlbdk
  • mex
  • fg-cc
  • torbenkikkert
  • connectedcars-cloudbuild
  • mtjcc
  • urcra
  • alparty
  • viter
  • chribsen
  • madspelt
  • sta-cc
  • hakimeg
  • mwa-cc
  • yannlyng
  • aabnpm