throw an error if ol.map gets passed an unknown option

This commit is contained in:
Éric Lemoine
2012-06-21 20:15:53 +02:00
parent 7e8c418155
commit 9529db0151
2 changed files with 23 additions and 15 deletions

View File

@@ -144,21 +144,11 @@ describe("ol.map", function() {
});
it("provides feedback when you mess up", function() {
var map;
if (goog.DEBUG) {
// misspelling
expect(function() {
map = ol.map({
centre: [1, 2]
});
}).toThrow(new Error("Unsupported config property: centre"));
} else {
expect(function() {
map = ol.map({
centre: [1, 2]
});
}).not.toThrow();
}
expect(function() {
var map = ol.map({
centre: [1, 2]
});
}).toThrow();
});
it("is destroyable", function() {