Converted "vector" branch unit tests to mocha, expect.js and sinon
This commit is contained in:
@@ -6,13 +6,13 @@ describe('ol.geom.LinearRing', function() {
|
||||
|
||||
it('creates a ring from an array', function() {
|
||||
var ring = new ol.geom.LinearRing([[10, 20], [30, 40]]);
|
||||
expect(ring).toBeA(ol.geom.LinearRing);
|
||||
expect(ring).to.be.a(ol.geom.LinearRing);
|
||||
});
|
||||
|
||||
it('throws when given mismatched dimension', function() {
|
||||
expect(function() {
|
||||
var ring = new ol.geom.LinearRing([[10, 20], [30, 40, 50]]);
|
||||
}).toThrow();
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
});
|
||||
@@ -21,12 +21,12 @@ describe('ol.geom.LinearRing', function() {
|
||||
|
||||
it('can be 2', function() {
|
||||
var ring = new ol.geom.LinearRing([[10, 20], [30, 40]]);
|
||||
expect(ring.dimension).toBe(2);
|
||||
expect(ring.dimension).to.be(2);
|
||||
});
|
||||
|
||||
it('can be 3', function() {
|
||||
var ring = new ol.geom.LinearRing([[10, 20, 30], [40, 50, 60]]);
|
||||
expect(ring.dimension).toBe(3);
|
||||
expect(ring.dimension).to.be(3);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -35,7 +35,7 @@ describe('ol.geom.LinearRing', function() {
|
||||
|
||||
it('is an array', function() {
|
||||
var ring = new ol.geom.LinearRing([[10, 20], [30, 40]]);
|
||||
expect(ring.getCoordinates()).toEqual([[10, 20], [30, 40]]);
|
||||
expect(ring.getCoordinates()).to.eql([[10, 20], [30, 40]]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user