@lvce-editor/test-worker 7.6.0 → 7.7.0
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/testWorkerMain.js +10 -4
- package/package.json +1 -1
package/dist/testWorkerMain.js
CHANGED
|
@@ -2543,6 +2543,14 @@ const getFileMapWeb = async url => {
|
|
|
2543
2543
|
return fileMap;
|
|
2544
2544
|
};
|
|
2545
2545
|
|
|
2546
|
+
const loadFixtureToMemFs = async fileMap => {
|
|
2547
|
+
for (const [path, content] of Object.entries(fileMap)) {
|
|
2548
|
+
const memfsPath = `memfs:///fixture/${path}`;
|
|
2549
|
+
await invoke$1('FileSystem.writeFile', memfsPath, content);
|
|
2550
|
+
}
|
|
2551
|
+
return `memfs:///fixture`;
|
|
2552
|
+
};
|
|
2553
|
+
|
|
2546
2554
|
const Backslash = '\\';
|
|
2547
2555
|
const Slash$1 = '/';
|
|
2548
2556
|
|
|
@@ -2634,10 +2642,8 @@ const loadFixture = async (platform, url) => {
|
|
|
2634
2642
|
}
|
|
2635
2643
|
const fn = platform === Web ? getFileMapWeb : getFileMapNode;
|
|
2636
2644
|
const fileMap = await fn(url);
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
}
|
|
2640
|
-
return 'memfs://';
|
|
2645
|
+
const filePath = await loadFixtureToMemFs(fileMap);
|
|
2646
|
+
return filePath;
|
|
2641
2647
|
};
|
|
2642
2648
|
|
|
2643
2649
|
const FileSystem = {
|