[英]Wallaby.js not working (Cannot find module '../../config-test.json' from 'node_modules/cpm-config.app.js')
I have join a new organization recently, and I am trying to configure my machine.我最近加入了一个新组织,我正在尝试配置我的机器。
As I am a huge fan of Wallaby.js, I'd like to make it work on my setup.由于我是 Wallaby.js 的忠实粉丝,我想让它在我的设置中运行。
But I can't set the env params correctly.但我无法正确设置环境参数。
Here is my wallaby.js
file:这是我的
wallaby.js
文件:
'use strict'
module.exports = function () {
process.env.NODE_ENV = 'ci'
return {
files: ['src/**/*.js'],
tests: ['tests/**/*Spec.js'],
env: {
type: 'node',
},
}
}
I guess you already solved your problem but in case somebody has the same.我猜你已经解决了你的问题,但万一有人有同样的问题。 The problem comes from the configuration you have a wallaby.js Done like that means that wallaby will only consider js files with this pattern:
tests/**/*Spec.js
问题来自你有一个wallaby.js的配置 这样做意味着wallaby 只会考虑具有这种模式的js文件:
tests/**/*Spec.js
Since your configuration file do not have Spec in the name it is not loaded by wallaby.js由于您的配置文件的名称中没有 Spec 它不是由wallaby.js加载的
To fix that simply put this as a pattern for the test files: tests/**/*.js
要解决这个问题,只需将其作为测试文件的模式:
tests/**/*.js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.