- THere seems to be a performance regression. Large test suites may throw - Regressions: Mock Clock won't install correctly, async specs are temporarily not supported. - Async spec runs/waits interface is gone. Blocks are gone. - Move most global usage into jasmine.Env constructor. - Remove optional 'Jasmine running' from HtmlReporter -- caused NS_FACTORY_ERROR in firefox when tested
39 lines
893 B
JavaScript
39 lines
893 B
JavaScript
describe("MatchersSpec - HTML Dependent", function () {
|
|
var env, spec;
|
|
|
|
beforeEach(function() {
|
|
env = new jasmine.Env();
|
|
env.updateInterval = 0;
|
|
|
|
var suite = env.describe("suite", function() {
|
|
spec = env.it("spec", function() {
|
|
});
|
|
});
|
|
spyOn(spec, 'addExpectationResult');
|
|
|
|
addMatchers({
|
|
toPass: function() {
|
|
return lastResult().passed;
|
|
},
|
|
toFail: function() {
|
|
return !lastResult().passed;
|
|
}
|
|
});
|
|
});
|
|
|
|
function match(value) {
|
|
return spec.expect(value);
|
|
}
|
|
|
|
function lastResult() {
|
|
return spec.addExpectationResult.mostRecentCall.args[1];
|
|
}
|
|
|
|
it("toEqual with DOM nodes", function() {
|
|
var nodeA = document.createElement('div');
|
|
var nodeB = document.createElement('div');
|
|
expect((match(nodeA).toEqual(nodeA))).toPass();
|
|
expect((match(nodeA).toEqual(nodeB))).toFail();
|
|
});
|
|
});
|