expect-maptalks
Advanced tools
Comparing version 0.1.0 to 0.1.1
20
index.js
'use strict'; | ||
(function (expect, maptalks) { | ||
(function (global, expect) { | ||
function isArray(obj) { | ||
@@ -63,6 +64,10 @@ if (!obj) { return false; } | ||
for (var i = 0; i < expected.length; i++) { | ||
if (isArray(expected[i]) && !eqlArray(val[i], expected[i])) { | ||
return false; | ||
} else if (val[i] !== expected[i] && !approx(val[i], expected[i])) { | ||
return false; | ||
if (isArray(expected[i])) { | ||
if (!eqlArray(val[i], expected[i])) { | ||
return false; | ||
} | ||
} else if (val[i] !== expected[i]) { | ||
if (!approx(val[i], expected[i])) { | ||
return false; | ||
} | ||
} | ||
@@ -151,3 +156,3 @@ } | ||
var expectation = false; | ||
if (this.obj instanceof maptalks.Layer) { | ||
if (('maptalks' in global) && (this.obj instanceof maptalks.Layer)) { | ||
expectation = isCenterDrawn(this.obj, dx, dy); | ||
@@ -162,3 +167,4 @@ } | ||
}; | ||
})(typeof window !== 'undefined' ? window.expect : require('expect.js'), typeof window !== 'undefined' ? window.maptalks : require('maptalks')); | ||
})(this | ||
, ('expect' in this) ? this.expect : require('expect.js')); | ||
{ | ||
"name": "expect-maptalks", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A plugin of expect.js(https://github.com/Automattic/expect.js) for maptalks with assertions for Coordinate/GeoJSON/Layer", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8124
6
153