Use namespaces for tests
With this commit test files provide namespaces (using goog.provide). This fixes the issue reported by @bartvde where goog objects cannot be used in Jasmine "describe" functions. It also frees us from having to add script tags for the test files in test/ol.html.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.array');
|
||||
|
||||
describe('ol.array', function() {
|
||||
|
||||
describe('binaryFindNearest', function() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.Collection');
|
||||
|
||||
describe('ol.collection', function() {
|
||||
var collection;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.Color');
|
||||
|
||||
describe('ol.Color', function() {
|
||||
|
||||
describe('constructor', function() {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
goog.require('goog.dom');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.control.Control');
|
||||
goog.provide('ol.test.control.Control');
|
||||
|
||||
describe('ol.control.Control', function() {
|
||||
var map, control;
|
||||
@@ -25,3 +23,7 @@ describe('ol.control.Control', function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('goog.dom');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.control.Control');
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.Extent');
|
||||
|
||||
describe('ol.Extent', function() {
|
||||
|
||||
describe('contains', function() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.layer.Layer');
|
||||
|
||||
describe('ol.layer.Layer', function() {
|
||||
|
||||
describe('constructor (defaults)', function() {
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
goog.require('goog.async.AnimationDelay');
|
||||
goog.require('goog.dom');
|
||||
goog.require('ol.Collection');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.source.XYZ');
|
||||
goog.provide('ol.test.Map');
|
||||
goog.provide('ol.test.RendererHints');
|
||||
|
||||
describe('ol.RendererHints', function() {
|
||||
|
||||
@@ -241,3 +234,13 @@ describe('ol.Map', function() {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('goog.async.AnimationDelay');
|
||||
goog.require('goog.dom');
|
||||
goog.require('ol.Collection');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.Object');
|
||||
|
||||
describe('ol.Object', function() {
|
||||
|
||||
var o;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.Projection');
|
||||
|
||||
describe('ol.Projection', function() {
|
||||
|
||||
describe('projection equivalence', function() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.Rectangle');
|
||||
|
||||
describe('ol.Rectangle', function() {
|
||||
|
||||
describe('getCenter', function() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.ResolutionConstraint');
|
||||
|
||||
describe('ol.ResolutionConstraint', function() {
|
||||
|
||||
describe('SnapToResolution', function() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.source.XYZ');
|
||||
|
||||
describe('ol.source.XYZ', function() {
|
||||
|
||||
describe('getTileCoordUrl', function() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.TileCoord');
|
||||
|
||||
describe('ol.TileCoord', function() {
|
||||
|
||||
describe('create', function() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.TileGrid');
|
||||
|
||||
describe('ol.tilegrid.TileGrid', function() {
|
||||
var extent;
|
||||
var resolutions;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.TileQueue');
|
||||
|
||||
describe('ol.TileQueue', function() {
|
||||
|
||||
// is the tile queue's array a heap?
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
goog.provide('ol.test.TileRange');
|
||||
|
||||
describe('ol.TileRange', function() {
|
||||
|
||||
describe('contains', function() {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
goog.require('ol.TileUrlFunction');
|
||||
goog.require('ol.tilegrid.XYZ');
|
||||
goog.provide('ol.test.TileUrlFunction');
|
||||
|
||||
describe('ol.TileUrlFunction', function() {
|
||||
|
||||
@@ -51,7 +50,7 @@ describe('ol.TileUrlFunction', function() {
|
||||
|
||||
describe('createFromTileUrlFunctions', function() {
|
||||
it('creates expected URL', function() {
|
||||
tileUrl = ol.TileUrlFunction.createFromTileUrlFunctions([
|
||||
var tileUrl = ol.TileUrlFunction.createFromTileUrlFunctions([
|
||||
ol.TileUrlFunction.createFromTemplate('a'),
|
||||
ol.TileUrlFunction.createFromTemplate('b')
|
||||
]);
|
||||
@@ -83,3 +82,4 @@ describe('ol.TileUrlFunction', function() {
|
||||
|
||||
goog.require('ol.TileCoord');
|
||||
goog.require('ol.TileUrlFunction');
|
||||
goog.require('ol.tilegrid.XYZ');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
goog.require('ol.View2D');
|
||||
goog.provide('ol.test.View2D');
|
||||
|
||||
describe('ol.View2D', function() {
|
||||
describe('create constraints', function() {
|
||||
@@ -51,3 +51,5 @@ describe('ol.View2D', function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('ol.View2D');
|
||||
|
||||
Reference in New Issue
Block a user