Skip to content

Instantly share code, notes, and snippets.

@pertrai1
Created December 14, 2020 14:40
Show Gist options
  • Save pertrai1/89bd7e13b953eb51c1d42645a782a0c7 to your computer and use it in GitHub Desktop.
Save pertrai1/89bd7e13b953eb51c1d42645a782a0c7 to your computer and use it in GitHub Desktop.
Wallaby
// before starting: npm i -D ngx-wallaby-jest
const ngxWallabyJest = require('ngx-wallaby-jest');
module.exports = function(wallaby) {
return {
files: [
'src/**/*.+(ts|html|json|snap|css|less|sass|scss|jpg|jpeg|gif|png|svg)',
'tsconfig.json',
'jest.config.js',
'tsconfig.spec.json',
'!src/**/*.spec.ts'
],
tests: ['src/app/**/*.spec.ts'],
env: {
type: 'node',
runner: 'node'
},
compilers: {
'**/*.ts?(x)': wallaby.compilers.typeScript({ module: 'commonjs' })
},
setup: function(wallaby) {
const config = require('./jest.config.js');
// Map our path aliases.
Object.keys(config.moduleNameMapper).forEach(
k =>
(config.moduleNameMapper[k] = config.moduleNameMapper[k].replace(
'<rootDir>',
wallaby.localProjectDir
))
);
wallaby.testFramework.configure(config);
},
preprocessors: {
'src/**/*.component.ts': ngxWallabyJest
},
testFramework: 'jest'
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment