Sign in to follow this  
kaizoku

Upgrading from v2 to v3 causing issues with grunt

Recommended Posts

We use grunt templates and jasmine to run our test suite and since upgrading to v3 - our tests fail to run at all via grunt.

 

I think it's down to the way v3 uses requireJs vs v2 and it doesn't seem to play well with our grunt template.

 

The error I get is:

Error: define: 'undefined' is not a function (evaluating 'this._loadResource.bind(this)')

I'm thinking this might be because ./loaders doesn't get required properly?

 

Did anyone face similar problems and have any solutions?

 

For ref our grunt test template looks like:

test: {                src: ['src/**/*.js', '!src/main.js'],                options: {                    display: "short",                    keepRunner: true,                    summary: true,                    specs: ['test/**/*Spec.js', '!test/grunt/*Spec.js'],                    template: require('grunt-template-jasmine-requirejs'),                    templateOptions: {                        requireConfig: {                            baseUrl: 'src',                            paths: {                                "test": "../test",                                "echo": ECHO_PATH                            }                        }                    },                    '--local-to-remote-url-access': true                }            }

Share this post


Link to post
Share on other sites

If you run your tests with phantomjs be sure to use the bind polyfill:

https://www.npmjs.com/package/phantomjs-polyfill

Thanks

 

I'm using grunt-contrib-jasmine which takes care of all that for me. With Pixi v2 I also tried asserting that .bind is a function which returned true so I think that's fine. Our set up is exactly the same so I would expect bind to be a function for v3 as well.

Share this post


Link to post
Share on other sites

We do not ship a bind polyfill in v3 since all of our supported browsers implement it. 

 

There is an issue open about phantomJS not supporting bind:

 

https://github.com/GoodBoyDigital/pixi.js/issues/1785

 

 

Also:

 

> I think it's down to the way v3 uses requireJs vs v2 and it doesn't seem to play well with our grunt template.

 

We don't use requirejs anywhere in pixi.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.