mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 06:56:32 +02:00
31 lines
No EOL
844 B
JavaScript
31 lines
No EOL
844 B
JavaScript
Script.include('../libraries/jasmine/jasmine.js');
|
|
Script.include('../libraries/jasmine/hifi-boot.js');
|
|
Script.include('../../system/libraries/utils.js');
|
|
|
|
describe('Bind', function() {
|
|
it('functions should have bind available', function() {
|
|
var foo = 'bar';
|
|
|
|
function callAnotherFn(anotherFn) {
|
|
return anotherFn();
|
|
}
|
|
|
|
function TestConstructor() {
|
|
this.foo = foo;
|
|
}
|
|
|
|
TestConstructor.prototype.doSomething = function() {
|
|
return callAnotherFn(function() {
|
|
return this.foo;
|
|
}.bind(this));
|
|
};
|
|
|
|
var instance = new TestConstructor();
|
|
|
|
expect(typeof(instance.doSomething.bind) !== 'undefined');
|
|
expect(instance.doSomething()).toEqual(foo);
|
|
});
|
|
});
|
|
|
|
jasmine.getEnv().execute();
|
|
Script.stop(); |