2016-01-06 30 views
0

如何为React-redux-es6-typescript-immutable应用程序配置wallaby。我使用webstorm编辑器。我的基本代码提交here为React-redux-es6-typescript-immutable应用程序配置wallaby

我试着在wallaby.js下面的代码,但它抛出

的ReferenceError:找不到变量:出口

在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']}) 
     } 
    } 
} 
+0

看起来像你的应用程序是使用CommonJS的(和的WebPack),所以你需要配置wallaby.js使用的WebPack喜欢这里描述的HTTP ://wallabyjs.com/docs/integration/webpack.html –

+0

添加env变量做了工作。我的工作wallaby配置如下:module.exports = function(wallaby){return {files:['src/*。ts'],tests:['test/* Spec.ts'],env:{type:'节点'},编译器:{'\ * /。ts':wallaby.compilers.typeScript({module:1})}}} –

回答

0

我的设置与您的设置基本相同。您是否尝试将env变量设置为node

我的工作wallaby.js对巴贝尔6配置文件如下:

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"]}) 
    } 
    }; 
}; 
+0

添加env变量做了工作。谢谢:) 我的工作袋鼠配置为如下: module.exports =功能(袋鼠){ 回报{ 文件:[ 'SRC/* TS。' ], 测试:[ “测试/*Spec.ts' ], ENV:{ 类型: '节点' }, 编译器:{ '**/* TS':wallaby.compilers.typeScript({ /* 1为CommonJs */ 模块:1 }) } } } –