Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
async Jasmine spec file example in typescript
/// <reference path="../../api/jasmine/jasmine.d.ts" />
/// <reference path="../../src/Task/CoolThing.ts" />
describe("CoolThingTest", function() {
var RESOURCE_ID:string = 'agdiaWctc2t5ch4LEhFTZWxlY3Rpb25SZXNvdXJjZRiAgICAgICgCgw';
beforeEach(function(done) {
this.testTask = new Task.CoolThing(RESOURCE_ID);
expect(this.testTask.run()).toBe(true);
this.testTask.callbackComplete = function (eventObj):void {
done();
};
this.testTask.callbackError = function (eventObj):void {
done();
};
});
it('should get a thing after the async call', function() {
var expUrl:string = '/api/v1.0/namespace/service/model/' + RESOURCE_ID;
expect(this.testTask.endpointUrlStr).toBe(expUrl);
expect(this.testTask.responseJSON).not.toBe(null);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.