简体   繁体   中英

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.

But I can't set the env params correctly.

Here is my wallaby.js file:

'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

Since your configuration file do not have Spec in the name it is not loaded by wallaby.js

To fix that simply put this as a pattern for the test files: tests/**/*.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM