Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '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
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement