@lvce-editor/test-worker 6.7.0 → 6.8.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 +8 -5
- package/package.json +1 -1
package/dist/testWorkerMain.js
CHANGED
|
@@ -2562,14 +2562,17 @@ const createDroppedFileHandle = async () => {
|
|
|
2562
2562
|
};
|
|
2563
2563
|
};
|
|
2564
2564
|
const loadFixture = async (platform, url) => {
|
|
2565
|
+
if (typeof url !== 'string') {
|
|
2566
|
+
throw new TypeError(`fixture url must be of type string`);
|
|
2567
|
+
}
|
|
2565
2568
|
// Handle fixture URLs in web environment
|
|
2566
2569
|
if (platform === Web) {
|
|
2567
2570
|
const fileMapUrl = `${url}/fileMap.json`;
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
return '';
|
|
2571
|
+
const fileMap = await loadFileMap(fileMapUrl);
|
|
2572
|
+
for (const [key, value] of Object.entries(fileMap)) {
|
|
2573
|
+
await writeFile(`memfs:///${key}`, value);
|
|
2574
|
+
}
|
|
2575
|
+
return 'memfs:///';
|
|
2573
2576
|
}
|
|
2574
2577
|
|
|
2575
2578
|
// TODO maybe also create a memory file system for consistency with web
|