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 | |
} | |
} |
@ArtemGovorov the project uses babel 5 and is shrink-wrapped. Unfortunately the boilerplate has since moved ahead and updated to babel 6. I will try to put up a sample repo with exactly the same setup my as my environment and ping you. Sorry about the confusion.
@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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also, are you using babel 5? I'm asking about the babel version because the boilerplate project you have referenced is using Babel 6. But you have configured your wallaby babel compiler as you are using babel 5 (passing
stage: 2
). If you are using babel 6 and you have.babelrc
file, you need just this:compilers: {'src/**/*.js*': wallaby.compilers.babel()}
(or pass correct babel 6 options, likepresets
, etc.).