mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-10 02:15:02 +00:00
test(app): load the image decoder in unit tests
This commit is contained in:
@@ -14,6 +14,12 @@ const tsgoEntry = path.join(
|
||||
"bin/tsgo.js",
|
||||
);
|
||||
|
||||
it("the test environment loads Expo Image", async () => {
|
||||
const { Image } = await import("expo-image");
|
||||
|
||||
expect(Image).toEqual(expect.any(Function));
|
||||
});
|
||||
|
||||
it("the test configuration typechecks with Expo's generated environment declaration", () => {
|
||||
const fixtureDir = mkdtempSync(path.join(appDir, ".vitest-expo-env-"));
|
||||
try {
|
||||
|
||||
@@ -19,6 +19,23 @@ const resolvePackageEntry = (packageName: string) => {
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
{
|
||||
name: "bundle-expo-runtime",
|
||||
// Expo initializes import.meta through a literal require of TypeScript.
|
||||
// Bundle that boundary so Node need not resolve Metro's extensionless require.
|
||||
async transform(_source, id) {
|
||||
if (!id.endsWith("/expo/src/winter/runtime.ts")) return;
|
||||
const result = await build({
|
||||
entryPoints: [id],
|
||||
bundle: true,
|
||||
format: "esm",
|
||||
platform: "neutral",
|
||||
define: { __DEV__: "false" },
|
||||
write: false,
|
||||
});
|
||||
return { code: result.outputFiles[0].text, map: null };
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "markdown-wasm-commonjs-export",
|
||||
transform(source, id) {
|
||||
|
||||
Reference in New Issue
Block a user