0

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']})
        }
    }
}
Dixy Xavier
  • 667
  • 2
  • 6
  • 20
  • Looks like your application is using CommonJs (and Webpack) so you need to configure wallaby.js to use webpack like described here http://wallabyjs.com/docs/integration/webpack.html – Artem Govorov Jan 11 '16 at 03:48
  • adding env variable did the work. my working wallaby config is as below: module.exports = function (wallaby) { return { files: [ 'src/*.ts' ], tests: [ 'test/*Spec.ts' ], env: { type: 'node' }, compilers: { '\*/.ts': wallaby.compilers.typeScript({ module: 1 }) } } } – Dixy Xavier Jan 11 '16 at 10:00

1 Answers1

0

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"]})
    }
  };
};
  • adding env variable did the work. thanks :) my working wallaby config is as below: module.exports = function (wallaby) { return { files: [ 'src/*.ts' ], tests: [ 'test/*Spec.ts' ], env: { type: 'node' }, compilers: { '**/*.ts': wallaby.compilers.typeScript({ /* 1 for CommonJs*/ module: 1 }) } } } – Dixy Xavier Jan 11 '16 at 08:11