kaizoku Posted May 11, 2015 Share Posted May 11, 2015 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 } } Quote Link to comment Share on other sites More sharing options...
lukaszwojciak Posted May 11, 2015 Share Posted May 11, 2015 If you run your tests with phantomjs be sure to use the bind polyfill:https://www.npmjs.com/package/phantomjs-polyfill Quote Link to comment Share on other sites More sharing options...
kaizoku Posted May 12, 2015 Author Share Posted May 12, 2015 If you run your tests with phantomjs be sure to use the bind polyfill:https://www.npmjs.com/package/phantomjs-polyfillThanks 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. Quote Link to comment Share on other sites More sharing options...
xerver Posted May 13, 2015 Share Posted May 13, 2015 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.