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 #17

Open
tutukin opened this issue Sep 3, 2015 · 1 comment
Open

Error: Mismatched anonymous define() module #17

tutukin opened this issue Sep 3, 2015 · 1 comment

Comments

@tutukin
Copy link

tutukin commented Sep 3, 2015

I'm trying to work with cucumber in karma using grunt-karma and karma-cucumberjs. I'm doing everything as Readme.md describes, just translating the configs to grunt-karma.

When I run grunt karma:bdd I get the colourful error:

PhantomJS 1.9.8 (Linux 0.0.0)
Error: Mismatched anonymous define() module: function () {
return sinonChai;
}
http://requirejs.org/docs/errors.html#mismatch
at http://localhost:9876/base/node_modules/karma-cucumberjs/lib/adapter.js?8617a1aab4937295762f75412f3a2edb8fddee32:25

Could anyone shed light on the error?

BTW: the RequireJS does not like something. However, nothing is said in Readme.md on RequireJS.

In a grunt task I have:

bdd: {
        options: {
            files: [{
                pattern: 'node_modules/karma-cucumberjs/vendor/cucumber-html.css',
                watched: false,
                included: false,
                served: true
            }, {
                pattern: 'frontend/features/step_definitions/support/app.template',
                watched: false,
                included: false,
                served: true
            }, {
                pattern: 'frontend/features/**/*.feature',
                watched: true,
                included: false,
                served: true
            }, {
                pattern: 'frontend/features/step_definitions/**/*.js',
                watched: true,
                included: true,
                served: true
            }],

            frameworks: ['cucumberjs', 'chai-as-promised', 'sinon-chai', 'chai']
        }

app.template:

<div id="myApp">
  <div class="a-container">

  </div>
</div>

<script type="text/javascript">
  startCucumberRun();
</script>

step definition:

addStepDefinitions( function (scenario) {
    var When = scenario.When;
    var Then = scenario.Then;

   // skipped...

});
@eugene-sea
Copy link

@tutukin I have tried to make this adapter to work with latest Cucumber.js but no luck due to RequireJS issue also. Thus I have created my own adapter: https://github.com/eugene-sea/karma-cucumber-js
It does not depend on RequireJS and works with latest version of Cucumber.js

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

No branches or pull requests

2 participants