Wallaby.js not working (Cannot find module '../../config-test.json' from 'node_modules/cpm-config.app.js')

326 Views Asked by At

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',
        },
    }
}
1

There are 1 best solutions below

3
On

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