• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kulshekhar / ts-jest / 10047525090

22 Jul 2024 08:00PM UTC coverage: 95.285% (+0.03%) from 95.254%
10047525090

push

github

ahnpnl
build(deps): Update dependency @testing-library/jest-dom to ^6.4.7

794 of 891 branches covered (89.11%)

Branch coverage included in aggregate %.

4763 of 4941 relevant lines covered (96.4%)

1243.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/src/cli/helpers/presets.ts
1
import type { TsJestPresets } from '../../types'
6✔
2

6✔
3
/** @internal */
6✔
4
export const enum JestPresetNames {
6✔
5
  default = 'ts-jest/presets/default',
6✔
6
  jsWithTs = 'ts-jest/presets/js-with-ts',
6✔
7
  jsWIthBabel = 'ts-jest/presets/js-with-babel',
6✔
8
}
6✔
9

6✔
10
/** @internal */
6✔
11
export interface TsJestPresetDescriptor {
6✔
12
  name: string
6✔
13
  fullName: string
6✔
14
  label: string
6✔
15
  jsVarName: string
6✔
16
  value: TsJestPresets
6✔
17
  isDefault: boolean
6✔
18
  jsImport(varName?: string): string
6✔
19
}
6✔
20

6✔
21
const definePreset = (fullName: string): TsJestPresetDescriptor => ({
6✔
22
  fullName,
18✔
23
  get name() {
18✔
24
    return this.isDefault ? 'ts-jest' : fullName
192✔
25
  },
18✔
26
  get label() {
18✔
27
    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
×
28
    return fullName.split('/').pop()!
×
29
  },
18✔
30
  get jsVarName() {
18✔
31
    return this.isDefault
×
32
      ? 'defaults'
×
33
      : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
×
34
        fullName
×
35
          .split('/')
×
36
          .pop()!
×
37
          // eslint-disable-next-line no-useless-escape
×
38
          .replace(/\-([a-z])/g, (_, l) => l.toUpperCase())
×
39
  },
18✔
40
  get value() {
18✔
41
    return require(`../../../${fullName.replace(/^ts-jest\//, '')}/jest-preset`)
24✔
42
  },
18✔
43
  jsImport(varName = 'tsjPreset') {
18✔
44
    return `const { ${this.jsVarName}: ${varName} } = require('ts-jest/presets')`
×
45
  },
18✔
46
  get isDefault() {
18✔
47
    return fullName === JestPresetNames.default
192✔
48
  },
18✔
49
})
18✔
50

6✔
51
/** @internal */
6✔
52
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6✔
53
export const allPresets: Record<JestPresetNames, TsJestPresetDescriptor> = {} as any
6✔
54
/** @internal */
6✔
55
export const defaults = (allPresets[JestPresetNames.default] = definePreset(JestPresetNames.default))
6✔
56
/** @internal */
6✔
57
export const jsWithTs = (allPresets[JestPresetNames.jsWithTs] = definePreset(JestPresetNames.jsWithTs))
6✔
58
/** @internal */
6✔
59
export const jsWIthBabel = (allPresets[JestPresetNames.jsWIthBabel] = definePreset(JestPresetNames.jsWIthBabel))
6✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc