Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const jestConfig = require('kcd-scripts/config').jest
const babelHelpersList = require('@babel/helpers').list
module.exports = Object.assign(jestConfig, {
roots: ['.'],
testEnvironment: 'jsdom',
moduleNameMapper: babelHelpersList.reduce((aliasMap, helper) => {
aliasMap[
`@babel/runtime/helpers/esm/${helper}`
] = `@babel/runtime/helpers/${helper}`
return aliasMap
}, {}),
})
const jestConfig = require('kcd-scripts/config').jest
module.exports = Object.assign(jestConfig, {
displayName: 'react-render-callback',
roots: ['.'],
testEnvironment: 'jsdom',
transformIgnorePatterns: [],
})
const path = require('path')
const baseConfig = require('kcd-scripts/jest')
module.exports = {
...baseConfig,
rootDir: path.join(__dirname, '..'),
displayName: 'node',
testEnvironment: 'jest-environment-node',
coveragePathIgnorePatterns: [
...baseConfig.coveragePathIgnorePatterns,
'/__tests__/',
'/__node_tests__/',
],
testMatch: ['**/__node_tests__/**.js'],
}
const path = require('path')
const baseConfig = require('kcd-scripts/jest')
module.exports = {
...baseConfig,
rootDir: path.join(__dirname, '..'),
displayName: 'dom',
coveragePathIgnorePatterns: [
...baseConfig.coveragePathIgnorePatterns,
'/__tests__/',
'/__node_tests__/',
],
testEnvironment: 'jest-environment-jsdom',
}
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
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
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
const rollupConfig = require('kcd-scripts/config').getRollupConfig()
const tiny = process.env.TINY
const esm = process.env.BUILD_FORMAT === 'esm'
Object.assign(rollupConfig, {
external: ['preact', 'react', 'glamor', 'prop-types'],
output: [
Object.assign(rollupConfig.output[0], {
exports: tiny || !esm ? 'default' : 'named',
name: 'glamorous',
globals: {
react: 'React',
preact: 'preact',
glamor: 'Glamor',
'prop-types': 'PropTypes',
},
const rollupConfig = require('kcd-scripts/config').getRollupConfig();
Object.assign(rollupConfig, {
external: ['preact', 'react', 'prop-types'],
output: [
Object.assign(rollupConfig.output[0], {
globals: {
react: 'React',
preact: 'preact',
'prop-types': 'PropTypes'
}
})
]
});
module.exports = rollupConfig;
module.exports = () => {
const getRollupConfig = require('kcd-scripts/config').getRollupConfig
const rollupConfig = getRollupConfig()
replace(rollupConfig.plugins, 'babel', () => {
const babel = require('rollup-plugin-babel')
return babel({
exclude: 'node_modules/**',
babelrc: true,
runtimeHelpers: true,
})
})
return rollupConfig
}