How to use the kcd-scripts/config.jest.transform function in kcd-scripts

To help you get started, we’ve selected a few kcd-scripts 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 testing-library / svelte-testing-library / jest.config.js View on Github external
const {jest: jestConfig} = require('kcd-scripts/config')

const config = Object.assign(jestConfig, {
  roots: ['tests'],
  testMatch: ['/**/*.spec.js'],
  transform: {
    ...jestConfig.transform,
    '^.+\\.svelte$': 'jest-transform-svelte',
    '^.+\\.html$': 'svelte-test/transform',
  },
  transformIgnorePatterns: [
    ...jestConfig.transformIgnorePatterns,
    '/node_modules/(?!svelte).+\\.js$',
  ],
  moduleFileExtensions: [...jestConfig.moduleFileExtensions, 'svelte'],
})
module.exports = config
github markerikson / redux-fundamentals-workshop-exercises / jest.config.js View on Github external
'/workshop-templates/',
  'index.js',
]

config.moduleNameMapper = Object.assign({}, config.moduleNameMapper, {
  '^.+\\.css$': '/other/css-mock.js',
})

config.roots = ['.']
config.testMatch = [
    '/src/**/__tests__/**/*.{js,jsx,mjs}',
    '/src/**/?(*.)(spec|test).{js,jsx,mjs}',
]
config.setupFiles = config.setupFiles || []
config.setupFiles.push('/other/setup-tests.js')
config.transform = { '^.+\\.jsx?$': path.resolve("node_modules/kcd-scripts/dist/config/babel-transform")};

module.exports = config