wallaby.js

Configure wallaby for React-redux-es6-typescript-immutable applications


How to configure wallaby for React-redux-es6-typescript-immutable application. I use webstorm editor. My base code is committed here

I tried the following code in wallaby.js, but it throws

ReferenceError: Can't find variable: exports

at src/store.ts:3

module.exports = function (wallaby) {

    return {
        files: [
            'src/*.ts'
        ],

        tests: [
            'test/*Spec.ts'
        ],

        compilers: {
            '**/*.ts': wallaby.compilers.typeScript({
                module: 5,  // ES6
                target: 2  // ES6
            })
        },
        preprocessors: {
            '**/*.js': file => require('babel-core').transform(
                file.content,
                {sourceMap: true, presets: ['es2015']})
        }
    }
}

Solution

  • I have more or less the same setup as you. Did you try setting the env variable to node?

    My working wallaby.js config file for babel 6 is the following:

    module.exports = function() {
      return {
        files: [
          {pattern: "src/**/*.js*"}
        ],
    
        tests: [
          {pattern: "tests/integration/*.js"}
        ],
    
        env: {
          type: "node"
        },
    
        preprocessors: {
          "**/*.js": file => require("babel-core").transform(file.content, {sourceMap: true, presets: ["es2015"]})
        }
      };
    };