Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Mismatched anonymous define() module #34

Open
monolithed opened this issue Apr 3, 2015 · 0 comments
Open

Error: Mismatched anonymous define() module #34

monolithed opened this issue Apr 3, 2015 · 0 comments
Labels

Comments

@monolithed
Copy link

My config:

'use strict';

module.exports = function (config) {
    config.set({
        basePath: './',
        port: 9001,

        browsers  : ['PhantomJS'],
        frameworks: ['mocha-debug', 'mocha', 'requirejs', 'chai', 'chai-as-promised' ],
        reporters : ['mocha', 'progress', 'coverage'],

        client: {
            mocha: {
                reporter: 'html',
                ui      : 'bdd'
            }
        },

        preprocessors: {
            'tests/**/*.js': [ 'babel' ],
            '{trunk,utils}/**/*.js': [ 'coverage' ]
        },

        // https://github.com/karma-runner/karma-coverage
        coverageReporter: {
            type: 'html',
            dir : 'cache/coverage/'
        },

        files: [
            'index.js',
            'tests/**/*.js',
        ],

        colors: true,
        autoWatch: false,
        logLevel : config.LOG_INFO,
        singleRun: true
    });
};

package.json

{
    "devDependencies": {
        "grunt"                   : "^0.4.5",
        "grunt-karma"             : "^0.10.1",
        "grunt-babel"             : "^4.0.0",
        "karma-mocha"             : "^0.1.10",
        "karma-coverage"          : "^0.2.7",
        "karma-chai-plugins"      : "^0.4.0",
        "karma-phantomjs-launcher": "^0.1.4",
        "karma-mocha-debug"       : "^0.1.2",
        "karma-requirejs"         : "^0.2.2",
        "karma-mocha-reporter"    : "^1.0.2",
        "karma-babel-preprocessor": "^5.0.0"
    }
}

A test file

define(['../index.js'], function(polyfiller) {

});
➜ grunt test
Running "karma:tests" (karma) task
INFO [karma]: Karma v0.12.31 server started at http://localhost:9001/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Mac OS X)]: Connected on socket laHcJ0unDsVM0KNd31Tc with id 53989432
PhantomJS 1.9.8 (Mac OS X) ERROR
  Error: Mismatched anonymous define() module: function (polyfiller) {}
  http://requirejs.org/docs/errors.html#mismatch
  at /workspace/github/polyfiller/node_modules/requirejs/require.js:141
PhantomJS 1.9.8 (Mac OS X) ERROR
  Error: Mismatched anonymous define() module: function (polyfiller) {}
  http://requirejs.org/docs/errors.html#mismatch
  at /workspace/github/polyfiller/node_modules/requirejs/require.js:141


Finished in 0.027 secs / 0 secs

SUMMARY:
✔ 0 tests completed
Warning: Task "karma:tests" failed. Use --force to continue.

Aborted due to warnings.

Ok,

define('foo', ['../index.js'], function(polyfiller) {

});
➜ grunt test
Running "karma:tests" (karma) task
INFO [karma]: Karma v0.12.31 server started at http://localhost:9001/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Mac OS X)]: Connected on socket w_SmkVVfhA3AXESY5THZ with id 85656734
PhantomJS 1.9.8 (Mac OS X) ERROR: 'There is no timestamp for /workspace/github/polyfiller/node_modules/karma-chai-plugins/node_modules/chai/chai.js!'
PhantomJS 1.9.8 (Mac OS X) ERROR: 'There is no timestamp for /Abashkin/workspace/github/polyfiller/node_modules/karma-chai-plugins/node_modules/chai/chai.js!'

PhantomJS 1.9.8 (Mac OS X) ERROR: 'There is no timestamp for /workspace/github/polyfiller/node_modules/karma-chai-plugins/node_modules/chai-as-promised/lib/chai-as-promised.js!'
PhantomJS 1.9.8 (Mac OS X) ERROR: 'There is no timestamp for /workspace/github/polyfiller/node_modules/karma-chai-plugins/node_modules/chai-as-promised/lib/chai-as-promised.js!'

WARN [PhantomJS 1.9.8 (Mac OS X)]: Disconnected (1 times), because no message in 10000 ms.

Finished in 10.035 secs / 0 secs
Warning: Task "karma:tests" failed. Use --force to continue.
Aborted due to warnings.

What am i doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants