1

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',
        },
    }
}
A Mehmeto
  • 1,594
  • 3
  • 22
  • 37

1 Answers1

0

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

  • You're right, I've also spotted this typo since then. Yet, even wuth this correction, I'm still facing the issue. ``` 'use strict' module.exports = function () { process.env.NODE_ENV = 'ci' return { files: ['src/**/*.js'], tests: ['tests/**/*.spec.js'], env: { type: 'node', }, } } ``` – A Mehmeto Feb 15 '21 at 09:45
  • What fixed my issue was to remove spec completely like the one I proposed: 'tests/**/*.js'. It looks like tests property in wallaby concerns all the files which needs to be loaded to run the tests and not only the ones containing the jest or mocha libs. So I guess your config-test.json needs to be included by the pattern you give to the `tests` property – Loic Bovo Feb 15 '21 at 13:01
  • sorry just found the final solution, thanks to this: https://github.com/wallabyjs/public/issues/324 I understood the issue, all the tests configuration files should be included into the files list – Loic Bovo Feb 15 '21 at 14:25