Skip to content

Instantly share code, notes, and snippets.

@archit
Created April 2, 2015 15:27
Show Gist options
  • Save archit/fc0e6b293951422e43b5 to your computer and use it in GitHub Desktop.
Save archit/fc0e6b293951422e43b5 to your computer and use it in GitHub Desktop.
How to run ember-cli > v0.2.x acceptance tests to run on CircleCI
import resolver from './helpers/resolver';
import {
setResolver
} from 'ember-qunit';
setResolver(resolver);
// Since CircleCI runs with PhantomJS 1.9.x, need this to make things
// green!
if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
FunctionNOP = function() {},
FunctionBound = function() {
return fToBind.apply(this instanceof FunctionNOP ? this : oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
FunctionNOP.prototype = this.prototype;
FunctionBound.prototype = new FunctionNOP();
return FunctionBound;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment