grunt-mocha-phantomjs icon indicating copy to clipboard operation
grunt-mocha-phantomjs copied to clipboard

Error when trying to set the 'hooks' option

Open FrancoisGuillem opened this issue 7 years ago • 0 comments

I need to use the 'hooks' option of mocha-phantomjs but I cannot set it correctly in Gruntfile.

The following instruction works correctly in terminal:

 mocha-phantomjs ./test/test.html --hooks ./test/phantom_hooks.js -R xunit -f test/results/result.xml

In my Gruntfile.js, I have put the following configuration:

grunt.initConfig({
    ...
    mocha_phantomjs: {
      options: {
        reporter: 'xunit',
        output: 'test/results/result.xml',
        config: {
          "hooks": './test/phantom_hooks.js'
        }
      },
      all: 'test/test.html'
    }
});

When I run grunt mocha_phantomjs I get the following error:

Error loading hooks: Cannot find module './test/phantom_hooks.js'

Am I doing something wrong or is this an issue of the plugin?

FrancoisGuillem avatar Aug 11 '17 09:08 FrancoisGuillem