@deck.gl/test-utils 8.7.0-alpha.3 → 8.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es5/generate-layer-tests.js +85 -65
- package/dist/es5/generate-layer-tests.js.map +1 -1
- package/dist/es5/index.js +10 -10
- package/dist/es5/interaction-test-runner.js +91 -36
- package/dist/es5/interaction-test-runner.js.map +1 -1
- package/dist/es5/lifecycle-test.js +273 -125
- package/dist/es5/lifecycle-test.js.map +1 -1
- package/dist/es5/snapshot-test-runner.js +109 -70
- package/dist/es5/snapshot-test-runner.js.map +1 -1
- package/dist/es5/test-runner.js +154 -95
- package/dist/es5/test-runner.js.map +1 -1
- package/dist/es5/utils/dom.js +1 -1
- package/dist/es5/utils/dom.js.map +1 -1
- package/dist/es5/utils/precision.js +12 -4
- package/dist/es5/utils/precision.js.map +1 -1
- package/dist/es5/utils/setup-gl.js +2 -4
- package/dist/es5/utils/setup-gl.js.map +1 -1
- package/dist/esm/utils/setup-gl.js +2 -5
- package/dist/esm/utils/setup-gl.js.map +1 -1
- package/package.json +3 -3
- package/src/utils/setup-gl.js +4 -7
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.toLowPrecision = toLowPrecision;
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
|
+
|
|
12
|
+
function toLowPrecision(input) {
|
|
13
|
+
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 11;
|
|
14
|
+
|
|
9
15
|
if (typeof input === 'number') {
|
|
10
16
|
input = Number(input.toPrecision(precision));
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
if (Array.isArray(input)) {
|
|
14
|
-
input = input.map(
|
|
20
|
+
input = input.map(function (item) {
|
|
21
|
+
return toLowPrecision(item, precision);
|
|
22
|
+
});
|
|
15
23
|
}
|
|
16
24
|
|
|
17
|
-
if (
|
|
18
|
-
for (
|
|
25
|
+
if ((0, _typeof2.default)(input) === 'object') {
|
|
26
|
+
for (var key in input) {
|
|
19
27
|
input[key] = toLowPrecision(input[key], precision);
|
|
20
28
|
}
|
|
21
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/precision.js"],"names":["toLowPrecision","input","precision","Number","toPrecision","Array","isArray","map","item","key"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/precision.js"],"names":["toLowPrecision","input","precision","Number","toPrecision","Array","isArray","map","item","key"],"mappings":";;;;;;;;;;;AAOO,SAASA,cAAT,CAAwBC,KAAxB,EAA+C;AAAA,MAAhBC,SAAgB,uEAAJ,EAAI;;AAEpD,MAAI,OAAOD,KAAP,KAAiB,QAArB,EAA+B;AAC7BA,IAAAA,KAAK,GAAGE,MAAM,CAACF,KAAK,CAACG,WAAN,CAAkBF,SAAlB,CAAD,CAAd;AACD;;AACD,MAAIG,KAAK,CAACC,OAAN,CAAcL,KAAd,CAAJ,EAA0B;AACxBA,IAAAA,KAAK,GAAGA,KAAK,CAACM,GAAN,CAAU,UAAAC,IAAI;AAAA,aAAIR,cAAc,CAACQ,IAAD,EAAON,SAAP,CAAlB;AAAA,KAAd,CAAR;AACD;;AACD,MAAI,sBAAOD,KAAP,MAAiB,QAArB,EAA+B;AAC7B,SAAK,IAAMQ,GAAX,IAAkBR,KAAlB,EAAyB;AACvBA,MAAAA,KAAK,CAACQ,GAAD,CAAL,GAAaT,cAAc,CAACC,KAAK,CAACQ,GAAD,CAAN,EAAaP,SAAb,CAA3B;AACD;AACF;;AACD,SAAOD,KAAP;AACD","sourcesContent":["/**\n * Covert all numbers in a deep structure to a given precision, allowing\n * reliable float comparisons. Converts data in-place.\n * @param {mixed} input Input data\n * @param {Number} [precision] Desired precision\n * @return {mixed} Input data, with all numbers converted\n */\nexport function toLowPrecision(input, precision = 11) {\n /* eslint-disable guard-for-in */\n if (typeof input === 'number') {\n input = Number(input.toPrecision(precision));\n }\n if (Array.isArray(input)) {\n input = input.map(item => toLowPrecision(item, precision));\n }\n if (typeof input === 'object') {\n for (const key in input) {\n input[key] = toLowPrecision(input[key], precision);\n }\n }\n return input;\n}\n"],"file":"precision.js"}
|
|
@@ -7,13 +7,11 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _testUtils = require("@luma.gl/test-utils");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
_global.glContext = _global.glContext || (0, _testUtils.createTestContext)({
|
|
10
|
+
globalThis.glContext = globalThis.glContext || (0, _testUtils.createTestContext)({
|
|
13
11
|
width: 1,
|
|
14
12
|
height: 1,
|
|
15
13
|
debug: true
|
|
16
14
|
});
|
|
17
|
-
var _default =
|
|
15
|
+
var _default = globalThis.glContext;
|
|
18
16
|
exports.default = _default;
|
|
19
17
|
//# sourceMappingURL=setup-gl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/setup-gl.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/setup-gl.js"],"names":["globalThis","glContext","width","height","debug"],"mappings":";;;;;;;AAAA;;AAEAA,UAAU,CAACC,SAAX,GACED,UAAU,CAACC,SAAX,IACA,kCAAkB;AAChBC,EAAAA,KAAK,EAAE,CADS;AAEhBC,EAAAA,MAAM,EAAE,CAFQ;AAGhBC,EAAAA,KAAK,EAAE;AAHS,CAAlB,CAFF;eAaeJ,UAAU,CAACC,S","sourcesContent":["import {createTestContext} from '@luma.gl/test-utils';\n\nglobalThis.glContext =\n globalThis.glContext ||\n createTestContext({\n width: 1,\n height: 1,\n debug: true\n // throwOnFailure: false,\n // throwOnError: false\n });\n// // TODO - Seems to be an issue in luma.gl\n// (createContext && createContext(100, 100, {}));\n// // console.log('Context', globalThis.glContext);\n\nexport default globalThis.glContext;\n"],"file":"setup-gl.js"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { createTestContext } from '@luma.gl/test-utils';
|
|
2
|
-
|
|
3
|
-
const _global = typeof global !== 'undefined' ? global : window;
|
|
4
|
-
|
|
5
|
-
_global.glContext = _global.glContext || createTestContext({
|
|
2
|
+
globalThis.glContext = globalThis.glContext || createTestContext({
|
|
6
3
|
width: 1,
|
|
7
4
|
height: 1,
|
|
8
5
|
debug: true
|
|
9
6
|
});
|
|
10
|
-
export default
|
|
7
|
+
export default globalThis.glContext;
|
|
11
8
|
//# sourceMappingURL=setup-gl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/setup-gl.js"],"names":["createTestContext","
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/setup-gl.js"],"names":["createTestContext","globalThis","glContext","width","height","debug"],"mappings":"AAAA,SAAQA,iBAAR,QAAgC,qBAAhC;AAEAC,UAAU,CAACC,SAAX,GACED,UAAU,CAACC,SAAX,IACAF,iBAAiB,CAAC;AAChBG,EAAAA,KAAK,EAAE,CADS;AAEhBC,EAAAA,MAAM,EAAE,CAFQ;AAGhBC,EAAAA,KAAK,EAAE;AAHS,CAAD,CAFnB;AAaA,eAAeJ,UAAU,CAACC,SAA1B","sourcesContent":["import {createTestContext} from '@luma.gl/test-utils';\n\nglobalThis.glContext =\n globalThis.glContext ||\n createTestContext({\n width: 1,\n height: 1,\n debug: true\n // throwOnFailure: false,\n // throwOnError: false\n });\n// // TODO - Seems to be an issue in luma.gl\n// (createContext && createContext(100, 100, {}));\n// // console.log('Context', globalThis.glContext);\n\nexport default globalThis.glContext;\n"],"file":"setup-gl.js"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@deck.gl/test-utils",
|
|
3
3
|
"description": "Test utilities for deck.gl layers",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "8.7.0-
|
|
5
|
+
"version": "8.7.0-beta.1",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@deck.gl/core": "^8.0.0",
|
|
27
27
|
"@luma.gl/test-utils": "^8.5.0",
|
|
28
28
|
"@luma.gl/webgl": "^8.5.0",
|
|
29
|
-
"@probe.gl/test-utils": "^3.
|
|
29
|
+
"@probe.gl/test-utils": "^3.5.0"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "0297ca9d2c85d980b075e2af4cfbeb75e31db55a"
|
|
33
33
|
}
|
package/src/utils/setup-gl.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import {createTestContext} from '@luma.gl/test-utils';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
_global.glContext =
|
|
7
|
-
_global.glContext ||
|
|
3
|
+
globalThis.glContext =
|
|
4
|
+
globalThis.glContext ||
|
|
8
5
|
createTestContext({
|
|
9
6
|
width: 1,
|
|
10
7
|
height: 1,
|
|
@@ -14,6 +11,6 @@ _global.glContext =
|
|
|
14
11
|
});
|
|
15
12
|
// // TODO - Seems to be an issue in luma.gl
|
|
16
13
|
// (createContext && createContext(100, 100, {}));
|
|
17
|
-
// // console.log('Context',
|
|
14
|
+
// // console.log('Context', globalThis.glContext);
|
|
18
15
|
|
|
19
|
-
export default
|
|
16
|
+
export default globalThis.glContext;
|