Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Last active January 2, 2018 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecilemuller/90abeeed75cd4aa3089fcd67414aaee9 to your computer and use it in GitHub Desktop.
Save cecilemuller/90abeeed75cd4aa3089fcd67414aaee9 to your computer and use it in GitHub Desktop.
Wallaby.js for Typescript
'use strict';
const wallabyWebpack = require('wallaby-webpack');
// Headless Chrome tests
module.exports = wallaby => ({
debug: true,
testFramework: 'jasmine',
files: [
{pattern: 'src/**/*.ts', load: false},
'!src/**/*.spec.ts',
'!src/**/*.spec.chrome.ts',
{pattern: 'src/**/package.json', load: false, instrument: false},
{pattern: 'src/**/fixtures/*.*', load: false, instrument: false}
],
tests: [
{pattern: 'src/**/*.spec.chrome.ts', load: false}
],
env: {
kind: 'chrome'
},
preprocessors: {
'**/package.json': file => file.content.replace('.ts', '.js')
},
postprocessor: wallabyWebpack({}),
setup: () => {
window.__moduleBundler.loadTests(); // eslint-disable-line no-underscore-dangle
}
});
'use strict';
// Node tests
module.exports = () => ({
debug: true,
testFramework: 'jasmine',
files: [
'src/**/*.ts',
'!src/**/*.spec.ts',
'!src/**/*.spec.chrome.ts',
{pattern: 'src/**/package.json', instrument: false, load: false},
{pattern: 'src/**/fixtures/*.*', instrument: false, load: false}
],
tests: [
'src/**/*.spec.ts'
],
env: {
type: 'node'
},
preprocessors: {
'**/package.json': file => file.content.replace('.ts', '.js')
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment