@luma.gl/test-utils 8.5.8 → 8.5.11

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.
@@ -8,7 +8,7 @@ exports.createHeadlessContext = createHeadlessContext;
8
8
 
9
9
  var _gltools = require("@luma.gl/gltools");
10
10
 
11
- var _env = require("probe.gl/env");
11
+ var _env = require("@probe.gl/env");
12
12
 
13
13
  var ERR_HEADLESSGL_FAILED = 'Failed to create WebGL context in Node.js, headless gl returned null';
14
14
  var ERR_HEADLESSGL_LOAD = " luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/context.js"],"names":["ERR_HEADLESSGL_FAILED","ERR_HEADLESSGL_LOAD","CONTEXT_DEFAULTS","width","height","debug","throwOnError","createTestContext","opts","Object","assign","context","createHeadlessContext","options","webgl1","webgl2","onError","message","Error","gl","headlessGL","headless","module","require"],"mappings":";;;;;;;;AAAA;;AACA;;AAEA,IAAMA,qBAAqB,GACzB,sEADF;AAGA,IAAMC,mBAAmB,gPAAzB;AAKA,IAAMC,gBAAgB,GAAG;AACvBC,EAAAA,KAAK,EAAE,CADgB;AAEvBC,EAAAA,MAAM,EAAE,CAFe;AAGvBC,EAAAA,KAAK,EAAE,IAHgB;AAIvBC,EAAAA,YAAY,EAAE;AAJS,CAAzB;;AAOO,SAASC,iBAAT,GAAsC;AAAA,MAAXC,IAAW,uEAAJ,EAAI;AAC3CA,EAAAA,IAAI,GAAGC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBR,gBAAlB,EAAoCM,IAApC,CAAP;AACA,MAAMG,OAAO,GAAG,wBACZ,8BAAgBH,IAAhB,CADY,GAEZ,kCAAoBI,qBAAqB,CAACJ,IAAD,CAAzC,EAAiDA,IAAjD,CAFJ;AAGA,SAAOG,OAAP;AACD;;AAGM,SAASC,qBAAT,CAA+BC,OAA/B,EAAwC;AAAA,MACtCV,KADsC,GACLU,OADK,CACtCV,KADsC;AAAA,MAC/BC,MAD+B,GACLS,OADK,CAC/BT,MAD+B;AAAA,MACvBU,MADuB,GACLD,OADK,CACvBC,MADuB;AAAA,MACfC,MADe,GACLF,OADK,CACfE,MADe;;AAG7C,WAASC,OAAT,CAAiBC,OAAjB,EAA0B;AACxB,QAAIJ,OAAO,CAACP,YAAZ,EAA0B;AACxB,YAAM,IAAIY,KAAJ,CAAUD,OAAV,CAAN;AACD;;AACD,WAAO,IAAP;AACD;;AAED,MAAIF,MAAM,IAAI,CAACD,MAAf,EAAuB;AACrB,WAAOE,OAAO,CAAC,qCAAD,CAAd;AACD;;AACD,MAAMG,EAAE,GAAGC,UAAU,CAACjB,KAAD,EAAQC,MAAR,EAAgBS,OAAhB,CAArB;;AACA,MAAI,CAACM,EAAL,EAAS;AACP,WAAOH,OAAO,CAAChB,qBAAD,CAAd;AACD;;AACD,SAAOmB,EAAP;AACD;;AAGD,SAASC,UAAT,GAA6B;AAC3B,MAAMC,QAAQ,GAAGC,MAAM,CAACC,OAAP,CAAe,IAAf,CAAjB;;AACA,MAAI,CAACF,QAAL,EAAe;AACb,UAAM,IAAIH,KAAJ,CAAUjB,mBAAV,CAAN;AACD;;AACD,SAAOoB,QAAQ,MAAR,mBAAP;AACD","sourcesContent":["import {createGLContext, instrumentGLContext} from '@luma.gl/gltools';\nimport {isBrowser} from 'probe.gl/env';\n\nconst ERR_HEADLESSGL_FAILED =\n 'Failed to create WebGL context in Node.js, headless gl returned null';\n\nconst ERR_HEADLESSGL_LOAD = `\\\n luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL \\\n contexts can not be created. This may not be an error. For example, this is a \\\n typical configuration for isorender applications running on the server.`;\n\nconst CONTEXT_DEFAULTS = {\n width: 1,\n height: 1,\n debug: true,\n throwOnError: false\n};\n\nexport function createTestContext(opts = {}) {\n opts = Object.assign({}, CONTEXT_DEFAULTS, opts);\n const context = isBrowser()\n ? createGLContext(opts)\n : instrumentGLContext(createHeadlessContext(opts), opts);\n return context;\n}\n\n// Create headless gl context (for running under Node.js)\nexport function createHeadlessContext(options) {\n const {width, height, webgl1, webgl2} = options;\n\n function onError(message) {\n if (options.throwOnError) {\n throw new Error(message);\n }\n return null;\n }\n\n if (webgl2 && !webgl1) {\n return onError('headless-gl does not support WebGL2');\n }\n const gl = headlessGL(width, height, options);\n if (!gl) {\n return onError(ERR_HEADLESSGL_FAILED);\n }\n return gl;\n}\n\n// Load headless gl dynamically, if available\nfunction headlessGL(...args) {\n const headless = module.require('gl');\n if (!headless) {\n throw new Error(ERR_HEADLESSGL_LOAD);\n }\n return headless(...args);\n}\n"],"file":"context.js"}
1
+ {"version":3,"sources":["../../src/context.js"],"names":["ERR_HEADLESSGL_FAILED","ERR_HEADLESSGL_LOAD","CONTEXT_DEFAULTS","width","height","debug","throwOnError","createTestContext","opts","Object","assign","context","createHeadlessContext","options","webgl1","webgl2","onError","message","Error","gl","headlessGL","headless","module","require"],"mappings":";;;;;;;;AAAA;;AACA;;AAEA,IAAMA,qBAAqB,GACzB,sEADF;AAGA,IAAMC,mBAAmB,gPAAzB;AAKA,IAAMC,gBAAgB,GAAG;AACvBC,EAAAA,KAAK,EAAE,CADgB;AAEvBC,EAAAA,MAAM,EAAE,CAFe;AAGvBC,EAAAA,KAAK,EAAE,IAHgB;AAIvBC,EAAAA,YAAY,EAAE;AAJS,CAAzB;;AAOO,SAASC,iBAAT,GAAsC;AAAA,MAAXC,IAAW,uEAAJ,EAAI;AAC3CA,EAAAA,IAAI,GAAGC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBR,gBAAlB,EAAoCM,IAApC,CAAP;AACA,MAAMG,OAAO,GAAG,wBACZ,8BAAgBH,IAAhB,CADY,GAEZ,kCAAoBI,qBAAqB,CAACJ,IAAD,CAAzC,EAAiDA,IAAjD,CAFJ;AAGA,SAAOG,OAAP;AACD;;AAGM,SAASC,qBAAT,CAA+BC,OAA/B,EAAwC;AAAA,MACtCV,KADsC,GACLU,OADK,CACtCV,KADsC;AAAA,MAC/BC,MAD+B,GACLS,OADK,CAC/BT,MAD+B;AAAA,MACvBU,MADuB,GACLD,OADK,CACvBC,MADuB;AAAA,MACfC,MADe,GACLF,OADK,CACfE,MADe;;AAG7C,WAASC,OAAT,CAAiBC,OAAjB,EAA0B;AACxB,QAAIJ,OAAO,CAACP,YAAZ,EAA0B;AACxB,YAAM,IAAIY,KAAJ,CAAUD,OAAV,CAAN;AACD;;AACD,WAAO,IAAP;AACD;;AAED,MAAIF,MAAM,IAAI,CAACD,MAAf,EAAuB;AACrB,WAAOE,OAAO,CAAC,qCAAD,CAAd;AACD;;AACD,MAAMG,EAAE,GAAGC,UAAU,CAACjB,KAAD,EAAQC,MAAR,EAAgBS,OAAhB,CAArB;;AACA,MAAI,CAACM,EAAL,EAAS;AACP,WAAOH,OAAO,CAAChB,qBAAD,CAAd;AACD;;AACD,SAAOmB,EAAP;AACD;;AAGD,SAASC,UAAT,GAA6B;AAC3B,MAAMC,QAAQ,GAAGC,MAAM,CAACC,OAAP,CAAe,IAAf,CAAjB;;AACA,MAAI,CAACF,QAAL,EAAe;AACb,UAAM,IAAIH,KAAJ,CAAUjB,mBAAV,CAAN;AACD;;AACD,SAAOoB,QAAQ,MAAR,mBAAP;AACD","sourcesContent":["import {createGLContext, instrumentGLContext} from '@luma.gl/gltools';\nimport {isBrowser} from '@probe.gl/env';\n\nconst ERR_HEADLESSGL_FAILED =\n 'Failed to create WebGL context in Node.js, headless gl returned null';\n\nconst ERR_HEADLESSGL_LOAD = `\\\n luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL \\\n contexts can not be created. This may not be an error. For example, this is a \\\n typical configuration for isorender applications running on the server.`;\n\nconst CONTEXT_DEFAULTS = {\n width: 1,\n height: 1,\n debug: true,\n throwOnError: false\n};\n\nexport function createTestContext(opts = {}) {\n opts = Object.assign({}, CONTEXT_DEFAULTS, opts);\n const context = isBrowser()\n ? createGLContext(opts)\n : instrumentGLContext(createHeadlessContext(opts), opts);\n return context;\n}\n\n// Create headless gl context (for running under Node.js)\nexport function createHeadlessContext(options) {\n const {width, height, webgl1, webgl2} = options;\n\n function onError(message) {\n if (options.throwOnError) {\n throw new Error(message);\n }\n return null;\n }\n\n if (webgl2 && !webgl1) {\n return onError('headless-gl does not support WebGL2');\n }\n const gl = headlessGL(width, height, options);\n if (!gl) {\n return onError(ERR_HEADLESSGL_FAILED);\n }\n return gl;\n}\n\n// Load headless gl dynamically, if available\nfunction headlessGL(...args) {\n const headless = module.require('gl');\n if (!headless) {\n throw new Error(ERR_HEADLESSGL_LOAD);\n }\n return headless(...args);\n}\n"],"file":"context.js"}
@@ -1,5 +1,5 @@
1
1
  import { createGLContext, instrumentGLContext } from '@luma.gl/gltools';
2
- import { isBrowser } from 'probe.gl/env';
2
+ import { isBrowser } from '@probe.gl/env';
3
3
  const ERR_HEADLESSGL_FAILED = 'Failed to create WebGL context in Node.js, headless gl returned null';
4
4
  const ERR_HEADLESSGL_LOAD = `\
5
5
  luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL \
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/context.js"],"names":["createGLContext","instrumentGLContext","isBrowser","ERR_HEADLESSGL_FAILED","ERR_HEADLESSGL_LOAD","CONTEXT_DEFAULTS","width","height","debug","throwOnError","createTestContext","opts","Object","assign","context","createHeadlessContext","options","webgl1","webgl2","onError","message","Error","gl","headlessGL","args","headless","module","require"],"mappings":"AAAA,SAAQA,eAAR,EAAyBC,mBAAzB,QAAmD,kBAAnD;AACA,SAAQC,SAAR,QAAwB,cAAxB;AAEA,MAAMC,qBAAqB,GACzB,sEADF;AAGA,MAAMC,mBAAmB,GAAI;AAC7B;AACA;AACA,0EAHA;AAKA,MAAMC,gBAAgB,GAAG;AACvBC,EAAAA,KAAK,EAAE,CADgB;AAEvBC,EAAAA,MAAM,EAAE,CAFe;AAGvBC,EAAAA,KAAK,EAAE,IAHgB;AAIvBC,EAAAA,YAAY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from 'probe.gl/env';\n\nconst ERR_HEADLESSGL_FAILED =\n 'Failed to create WebGL context in Node.js, headless gl returned null';\n\nconst ERR_HEADLESSGL_LOAD = `\\\n luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL \\\n contexts can not be created. This may not be an error. For example, this is a \\\n typical configuration for isorender applications running on the server.`;\n\nconst CONTEXT_DEFAULTS = {\n width: 1,\n height: 1,\n debug: true,\n throwOnError: false\n};\n\nexport function createTestContext(opts = {}) {\n opts = Object.assign({}, CONTEXT_DEFAULTS, opts);\n const context = isBrowser()\n ? createGLContext(opts)\n : instrumentGLContext(createHeadlessContext(opts), opts);\n return context;\n}\n\n// Create headless gl context (for running under Node.js)\nexport function createHeadlessContext(options) {\n const {width, height, webgl1, webgl2} = options;\n\n function onError(message) {\n if (options.throwOnError) {\n throw new Error(message);\n }\n return null;\n }\n\n if (webgl2 && !webgl1) {\n return onError('headless-gl does not support WebGL2');\n }\n const gl = headlessGL(width, height, options);\n if (!gl) {\n return onError(ERR_HEADLESSGL_FAILED);\n }\n return gl;\n}\n\n// Load headless gl dynamically, if available\nfunction headlessGL(...args) {\n const headless = module.require('gl');\n if (!headless) {\n throw new Error(ERR_HEADLESSGL_LOAD);\n }\n return headless(...args);\n}\n"],"file":"context.js"}
1
+ {"version":3,"sources":["../../src/context.js"],"names":["createGLContext","instrumentGLContext","isBrowser","ERR_HEADLESSGL_FAILED","ERR_HEADLESSGL_LOAD","CONTEXT_DEFAULTS","width","height","debug","throwOnError","createTestContext","opts","Object","assign","context","createHeadlessContext","options","webgl1","webgl2","onError","message","Error","gl","headlessGL","args","headless","module","require"],"mappings":"AAAA,SAAQA,eAAR,EAAyBC,mBAAzB,QAAmD,kBAAnD;AACA,SAAQC,SAAR,QAAwB,eAAxB;AAEA,MAAMC,qBAAqB,GACzB,sEADF;AAGA,MAAMC,mBAAmB,GAAI;AAC7B;AACA;AACA,0EAHA;AAKA,MAAMC,gBAAgB,GAAG;AACvBC,EAAAA,KAAK,EAAE,C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Q,CAAC,GAAGD,IAAJ,CAAf;AACD","sourcesContent":["import {createGLContext, instrumentGLContext} from '@luma.gl/gltools';\nimport {isBrowser} from '@probe.gl/env';\n\nconst ERR_HEADLESSGL_FAILED =\n 'Failed to create WebGL context in Node.js, headless gl returned null';\n\nconst ERR_HEADLESSGL_LOAD = `\\\n luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL \\\n contexts can not be created. This may not be an error. For example, this is a \\\n typical configuration for isorender applications running on the server.`;\n\nconst CONTEXT_DEFAULTS = {\n width: 1,\n height: 1,\n debug: true,\n throwOnError: false\n};\n\nexport function createTestContext(opts = {}) {\n opts = Object.assign({}, CONTEXT_DEFAULTS, opts);\n const context = isBrowser()\n ? createGLContext(opts)\n : instrumentGLContext(createHeadlessContext(opts), opts);\n return context;\n}\n\n// Create headless gl context (for running under Node.js)\nexport function createHeadlessContext(options) {\n const {width, height, webgl1, webgl2} = options;\n\n function onError(message) {\n if (options.throwOnError) {\n throw new Error(message);\n }\n return null;\n }\n\n if (webgl2 && !webgl1) {\n return onError('headless-gl does not support WebGL2');\n }\n const gl = headlessGL(width, height, options);\n if (!gl) {\n return onError(ERR_HEADLESSGL_FAILED);\n }\n return gl;\n}\n\n// Load headless gl dynamically, if available\nfunction headlessGL(...args) {\n const headless = module.require('gl');\n if (!headless) {\n throw new Error(ERR_HEADLESSGL_LOAD);\n }\n return headless(...args);\n}\n"],"file":"context.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/test-utils",
3
- "version": "8.5.8",
3
+ "version": "8.5.11",
4
4
  "description": "Automated WebGL testing utilities with Puppeteer and image diffing",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -35,7 +35,8 @@
35
35
  "@luma.gl/debug": "^8.4.0",
36
36
  "@luma.gl/gltools": "^8.4.0",
37
37
  "@luma.gl/webgl": "^8.4.0",
38
+ "@probe.gl/env": "^3.5.0",
38
39
  "@probe.gl/test-utils": "^3.4.0"
39
40
  },
40
- "gitHead": "ec6897d6a3df73e30a4f31be904b2fba4fcac191"
41
+ "gitHead": "9047970bf97ac2f0265551a5ed3453852f59ab54"
41
42
  }
package/src/context.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {createGLContext, instrumentGLContext} from '@luma.gl/gltools';
2
- import {isBrowser} from 'probe.gl/env';
2
+ import {isBrowser} from '@probe.gl/env';
3
3
 
4
4
  const ERR_HEADLESSGL_FAILED =
5
5
  'Failed to create WebGL context in Node.js, headless gl returned null';