jdcataldo / grunt-mocha-phantomjs

A simple grunt wrapper for mocha-phantomjs to allow for ci integration
MIT License
70 stars 40 forks source link

Error when trying to set the 'hooks' option #77

Open FrancoisGuillem opened 7 years ago

FrancoisGuillem commented 7 years ago

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?