@guanghechen/jest-config
TypeScript icon, indicating that this package has built-in type declarations

6.0.0-alpha.2 • Public • Published

@guanghechen/jest-config


Basic jest configs for typescript monorepo.

Install

  • npm

    npm install --save-dev @guanghechen/jest-config
  • yarn

    yarn add --dev @guanghechen/jest-config

Usage

  • Use in jest.config.js

    const { tsMonorepoConfig } = require('@guanghechen/jest-config')
    
    module.exports = async function () {
      const baseConfig = await tsMonorepoConfig(__dirname, { useESM: true })
      return {
        ...baseConfig,
        coverageThreshold: {
          global: {
            branches: 100,
            functions: 100,
            lines: 100,
            statements: 100,
          },
        },
      }
    }
  • Use in jest.config.mjs

    import { tsMonorepoConfig } from '@guanghechen/jest-config'
    import path from 'node:path'
    import url from 'node:url'
    
    export default async function () {
      const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
      const baseConfig = await tsMonorepoConfig(__dirname, { useESM: true })
    
      return {
        ...baseConfig,
        coverageThreshold: {
          global: {
            branches: 100,
            functions: 100,
            lines: 100,
            statements: 100,
          },
        },
      }
    }

Related

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @guanghechen/jest-config

    Weekly Downloads

    4

    Version

    6.0.0-alpha.2

    License

    MIT

    Unpacked Size

    45.3 kB

    Total Files

    8

    Last publish

    Collaborators

    • lemonclown