How to use the ts-jest/presets.defaults function in ts-jest

To help you get started, we’ve selected a few ts-jest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kulshekhar / ts-jest / e2e / __cases__ / module-kinds / ts-jest-tools.spec.ts View on Github external
test('presets', () => {
  const presetKeys = ['transform']
  expect(Object.keys(presets.defaults)).toEqual(presetKeys)
  expect(presets.defaults).toEqual(require('ts-jest/presets/default/jest-preset'))
  expect(presets.defaults).toEqual(require('ts-jest/jest-preset'))
  expect(Object.keys(presets.jsWithTs)).toEqual(presetKeys)
  expect(presets.jsWithTs).toEqual(require('ts-jest/presets/js-with-ts/jest-preset'))
  expect(Object.keys(presets.jsWithBabel)).toEqual(presetKeys)
  expect(presets.jsWithBabel).toEqual(require('ts-jest/presets/js-with-babel/jest-preset'))
})
github kulshekhar / ts-jest / e2e / __cases__ / module-kinds / ts-jest-tools.spec.ts View on Github external
test('presets', () => {
  const presetKeys = ['transform']
  expect(Object.keys(presets.defaults)).toEqual(presetKeys)
  expect(presets.defaults).toEqual(require('ts-jest/presets/default/jest-preset'))
  expect(presets.defaults).toEqual(require('ts-jest/jest-preset'))
  expect(Object.keys(presets.jsWithTs)).toEqual(presetKeys)
  expect(presets.jsWithTs).toEqual(require('ts-jest/presets/js-with-ts/jest-preset'))
  expect(Object.keys(presets.jsWithBabel)).toEqual(presetKeys)
  expect(presets.jsWithBabel).toEqual(require('ts-jest/presets/js-with-babel/jest-preset'))
})
github kulshekhar / ts-jest / e2e / __cases__ / deep / src / Tests / jest.config.js View on Github external
const cfg = {}

if (require('jest/package.json').version.split('.').shift() === '22') {
  Object.assign(cfg, require('ts-jest/presets').defaults)
} else {
  cfg.preset = 'ts-jest'
}

module.exports = Object.assign({}, cfg, {
  collectCoverage: true,
  collectCoverageFrom: ["**/*.ts", "!**/*.d.ts", "!**/build/**", "!/FrontEnd/**"],
  forceCoverageMatch: ["**/*.test.ts"],
  coverageDirectory: "Tests/coverage",
  coverageReporters: ["lcov"],
  rootDir: "..",
  testMatch: ["**/*.test.ts"],
  testEnvironment: "node",
  globals: {
    "ts-jest": {
      tsConfig: "./tsconfig.json",
github kulshekhar / ts-jest / e2e / __templates__ / with-jest-22 / jest.config.js View on Github external
const presets = require('ts-jest/presets')

module.exports = Object.assign({}, presets.defaults, {
  testEnvironment: 'node',
  globals: { 'ts-jest': { tsConfig: {} } },
})