Created
March 22, 2015 17:30
-
-
Save jzerbe/1a14bec710e21fb6956a to your computer and use it in GitHub Desktop.
async Jasmine spec file example in typescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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