Update test specs to use Jasmine 3 (#2089)
* Updated Karma and Jasmine versions * Added DOMObserver class. Supports promise-based testing of DOM changes Update asynchronous test specs to use promises or done() instead of waitsFor/runs * Modified ActionCapability to duplicate context object properties as own properties for better object equality comparisons * Global find + replace to fix syntax issues * Fixed various issues caused by non-deterministic runtime order of tests in Jasmine 3. Fixed issues caused by changes to determination of object equality * Addressed review comments * Resolved merge conflicts with master * Fixed style errors * Use spy.calls.count() instead of manually tracking
This commit is contained in:
committed by
Pete Richards
parent
013eba744d
commit
433dee0314
@@ -53,8 +53,8 @@ define(
|
||||
}
|
||||
};
|
||||
|
||||
mockQ.when.andCallFake(asPromise);
|
||||
mockDomainObject.getModel.andReturn(testModel);
|
||||
mockQ.when.and.callFake(asPromise);
|
||||
mockDomainObject.getModel.and.returnValue(testModel);
|
||||
|
||||
capability = new GraphCapability(
|
||||
mockQ,
|
||||
@@ -82,7 +82,7 @@ define(
|
||||
it("provides one graph per resource type", function () {
|
||||
var mockCallback = jasmine.createSpy('callback');
|
||||
|
||||
mockDomainObject.useCapability.andReturn(asPromise([
|
||||
mockDomainObject.useCapability.and.returnValue(asPromise([
|
||||
{ key: "abc", start: 0, end: 15 },
|
||||
{ key: "abc", start: 0, end: 15 },
|
||||
{ key: "def", start: 4, end: 15 },
|
||||
@@ -103,7 +103,7 @@ define(
|
||||
testModel.capacity = 1000;
|
||||
testModel.startingSOC = 100;
|
||||
testModel.type = "timeline";
|
||||
mockDomainObject.useCapability.andReturn(asPromise([
|
||||
mockDomainObject.useCapability.and.returnValue(asPromise([
|
||||
{ key: "power", start: 0, end: 15 }
|
||||
]));
|
||||
capability.invoke().then(mockCallback);
|
||||
|
||||
Reference in New Issue
Block a user