@shopify/react-native-skia 2.2.17 → 2.2.18
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/jestEnv.js +22 -0
- package/package.json +2 -2
package/jestEnv.js
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
/* eslint-disable import/no-default-export */
|
2
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
3
|
+
import { TestEnvironment } from "jest-environment-node";
|
4
|
+
import CanvasKitInit from "canvaskit-wasm/bin/full/canvaskit";
|
5
|
+
|
6
|
+
export default class SkiaEnvironment extends TestEnvironment {
|
7
|
+
constructor(config, context) {
|
8
|
+
super(config, context);
|
9
|
+
}
|
10
|
+
|
11
|
+
async setup() {
|
12
|
+
await super.setup();
|
13
|
+
const CanvasKit = await CanvasKitInit({});
|
14
|
+
this.global.CanvasKit = CanvasKit;
|
15
|
+
}
|
16
|
+
|
17
|
+
async teardown() {}
|
18
|
+
|
19
|
+
getVmContext() {
|
20
|
+
return super.getVmContext();
|
21
|
+
}
|
22
|
+
}
|
package/package.json
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
"setup-skia-web": "scripts/setup-canvaskit.js"
|
9
9
|
},
|
10
10
|
"title": "React Native Skia",
|
11
|
-
"version": "2.2.
|
11
|
+
"version": "2.2.18",
|
12
12
|
"description": "High-performance React Native Graphics using Skia",
|
13
13
|
"main": "lib/module/index.js",
|
14
14
|
"react-native": "src/index.ts",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
"index.js",
|
28
28
|
"jestSetup.js",
|
29
29
|
"jestSetup.mjs",
|
30
|
-
"jestEnv.
|
30
|
+
"jestEnv.js",
|
31
31
|
"cpp/**/*.{h,cpp}",
|
32
32
|
"apple/**",
|
33
33
|
"libs/apple/*.xcframework/**",
|