Created
May 26, 2016 10:33
-
-
Save nim23/fc22fb7a6e50162d3afa61d52424545c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
let wallabify = require('wallabify') | |
let babelify = require('babelify') | |
let babel = require('babel') | |
let es6ToEs5Preprocessor = file => babel | |
.transform(file.content, {sourceMap: true, filename: file.path, stage: 2}) | |
let wallabyPostProcessor = wallabify({ | |
entryPatterns: ['./src/**/*.spec.js'] | |
}, | |
function (b) { | |
b.transform(babelify, { | |
extensions: ['.jsx', '.js'] | |
}) | |
}) | |
module.exports = function (wallaby) { | |
return { | |
files: [ | |
{pattern: 'node_modules/babel-polyfill/dist/polyfill.js', instrument: false}, | |
{pattern: 'src/utils/karma.polyfill.js', instrument: false}, | |
{pattern: 'src/**/*.js', load: false}, | |
{pattern: 'src/**/*.jsx', load: false}, | |
{pattern: 'src/**/*.json', instrument: false}, | |
{pattern: 'src/**/*.spec.js', ignore: true} | |
], | |
tests: [ | |
{pattern: './src/**/*.spec.js', load: false} | |
], | |
postprocessor: wallabyPostProcessor, | |
testFramework: 'jasmine', | |
setup: function () { | |
// required to trigger tests loading | |
window.__moduleBundler.loadTests() | |
}, | |
preprocessors: { | |
'src/**/*.js': es6ToEs5Preprocessor, | |
'src/**/*.spec.js': es6ToEs5Preprocessor, | |
'src/**/*.jsx': es6ToEs5Preprocessor | |
}, | |
compilers: { | |
'src/**/*.js': wallaby.compilers.babel({ | |
stage: 2 | |
}), | |
'src/**/*.spec.js': wallaby.compilers.babel({ | |
stage: 2 | |
}), | |
'src/**/*.jsx': wallaby.compilers.babel({ | |
stage: 2 | |
}) | |
}, | |
debug: true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@nim23 Github doesn't send out notifications for being mentioned in a gist, so please share the link to the sample repo by creating an issue in our repo.