vitest-environment-webgl-node 0.1.2 → 0.1.3
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/CHANGELOG.md +2 -4
- package/README.md +17 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
## [vitest-environment-webgl-node-v0.1.
|
|
1
|
+
## [vitest-environment-webgl-node-v0.1.3](https://github.com/bhouston/vitest-gpu/compare/vitest-environment-webgl-node-v0.1.2...vitest-environment-webgl-node-v0.1.3) (2026-09-21)
|
|
2
2
|
|
|
3
3
|
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
*
|
|
6
|
-
* ship sources referenced by package maps ([8db482e](https://github.com/bhouston/vitest-gpu/commit/8db482ed56714f375b53d9a30df3f080a86fb81d)), closes [#23](https://github.com/bhouston/vitest-gpu/issues/23)
|
|
7
|
-
* support Vitest 3 environment transforms ([446f7f9](https://github.com/bhouston/vitest-gpu/commit/446f7f9041d61c3e5e66a111575f167389c0919c)), closes [#16](https://github.com/bhouston/vitest-gpu/issues/16)
|
|
5
|
+
* support public types across TypeScript versions ([0f3df06](https://github.com/bhouston/vitest-gpu/commit/0f3df067f28308e0154045304ecbcaf2ba840fcc)), closes [#24](https://github.com/bhouston/vitest-gpu/issues/24)
|
package/README.md
CHANGED
|
@@ -8,6 +8,10 @@ the `WebGL*` classes and a file-reading `fetch()` before each test file, and rem
|
|
|
8
8
|
`document.createElement('canvas').getContext('webgl2')` returns a GPU-backed context, so three.js,
|
|
9
9
|
regl, pixi and plain WebGL code run unchanged.
|
|
10
10
|
|
|
11
|
+
Using Jest instead? See the equivalent
|
|
12
|
+
[`jest-environment-webgl-node`](https://github.com/bhouston/jest-gpu/tree/main/packages/jest-environment-webgl-node)
|
|
13
|
+
in [jest-gpu](https://github.com/bhouston/jest-gpu).
|
|
14
|
+
|
|
11
15
|
## Install
|
|
12
16
|
|
|
13
17
|
```sh
|
|
@@ -43,7 +47,19 @@ Options are those of node-webgl's `init()` (`backend`, `api`) and `installDOM()`
|
|
|
43
47
|
(`baseDir`, `fetch`, `devicePixelRatio`, `innerWidth`, `innerHeight`, `frameInterval`).
|
|
44
48
|
Pair with [`vitest-screenshot`](../vitest-screenshot) for pixel-diff assertions.
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
For a Node-only TypeScript project, opt into types for the installed globals by adding
|
|
51
|
+
`import 'vitest-environment-webgl-node/globals';` to a `.d.ts` file your tsconfig includes. Do not include
|
|
52
|
+
this entry in projects that load TypeScript's DOM library: the real browser globals and node-webgl's shims
|
|
53
|
+
intentionally have different types. DOM projects can use their standard global declarations and cast a
|
|
54
|
+
node-webgl canvas at the library boundary when necessary.
|
|
47
55
|
|
|
48
56
|
On Linux CI install Mesa (`apt-get install libegl1 libgles2 libgl1-mesa-dri`) and set
|
|
49
57
|
`LIBGL_ALWAYS_SOFTWARE=1`. macOS and Windows use prebuilt binaries.
|
|
58
|
+
|
|
59
|
+
## Author
|
|
60
|
+
|
|
61
|
+
Created by [Ben Houston](https://ben3d.ca) and sponsored by [Land of Assets](https://landofassets.com).
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
MIT
|