jimivdw / grunt-mutation-testing

JavaScript Mutation Testing as grunt plugin. Tests your tests by mutating the code.
MIT License
51 stars 11 forks source link

Can't run grunt mutation with v1.2.0 #36

Closed Hyzual closed 9 years ago

Hyzual commented 9 years ago

Hi ! I've tried installing and running grunt-mutation-testing v1.2.0 but unfortunately it seems to always fail with the following error :

D:\Documents\Git\Jamstash> grunt mutationTest
Loading "mutation-testing-mocha.js" tasks...ERROR
>> Error: Cannot find module 'mocha'
Loading "mutation-testing.js" tasks...ERROR
>> Error: Cannot find module 'mocha'
Warning: Task "mutationTest" failed. Use --force to continue.

Aborted due to warnings.

Here is the dedicated part of my Gruntfile :

mutationTest: {
      options: {
        code: [
          'bower_components/jquery/dist/jquery.js'
          // More bower files, removed for brevity...
        ],
        specs: 'app/**/*_test.js',
        mutate: 'app/**/*.js',
        mutateProductionCode: true,
        reporters: {
          html: {
            dir: 'reports/grunt-mutation-testing'
          }
        },
        karma: {
          browsers: ['Chrome'],
          configFile: 'karma.conf.js',
          fileSpecs: 'code-test-mapping.json',
          waitForServerTime: 30
        },
        testFramework: 'karma'
      },
      test: {}
    },

I am running on grunt v0.4.5, on Windows 8.1. This config does work with grunt-mutation-testing (although it seems I have other problems, I'll probably need to open other issues). Let me know if you need more information and many thanks for this plugin, I look forward to improving the quality of our tests with its help !

jimivdw commented 9 years ago

Seems like we still have some hard dependency on mocha in the project somewhere. We'll need to find out a way to work around that, but for now mocha has been returned in the list of dependencies to make sure everything runs as it should. Upgrading to 1.2.1 should fix this issue.

If you need any more help, don't hesistate to ask for assistance here. We're quite busy doing other things at the moment, but we'll try to answer any questions as soon as we can.

-Jimi