Avoiding unhandled errors
These tests were generating errors that were not caught because they were outside the `it` functions.
This commit is contained in:
@@ -675,17 +675,20 @@ describe('ol.expr.lib', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('counter()', function() {
|
describe('counter()', function() {
|
||||||
var counter = parse('counter()');
|
|
||||||
var counterWithStart = parse('counter(1000)');
|
|
||||||
var start = evaluate(counter);
|
|
||||||
|
|
||||||
it('increases the counter with every call', function() {
|
it('increases the counter with every call', function() {
|
||||||
|
var counter = parse('counter()');
|
||||||
|
var start = evaluate(counter);
|
||||||
expect(evaluate(counter)).to.be(start + 1);
|
expect(evaluate(counter)).to.be(start + 1);
|
||||||
expect(evaluate(counter)).to.be(start + 2);
|
expect(evaluate(counter)).to.be(start + 2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('increases the counter, starting with a custom value', function() {
|
it('increases the counter, starting with a custom value', function() {
|
||||||
expect(evaluate(counterWithStart)).to.be(start + 3 + 1000);
|
var counterWithStart = parse('counter(1000)');
|
||||||
|
var start = evaluate(counterWithStart);
|
||||||
|
expect(start > 1000).to.be(true);
|
||||||
|
expect(evaluate(counterWithStart)).to.be(start + 1);
|
||||||
|
expect(evaluate(counterWithStart)).to.be(start + 2);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user