Skip to content

Commit

Permalink
Add unit test for .tgz with no metadata hint
Browse files Browse the repository at this point in the history
  • Loading branch information
georgestagg committed Sep 11, 2024
1 parent c8f7ac9 commit 5d1e4fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Binary file added src/tests/webR/data/test_image_no_hint.tgz
Binary file not shown.
9 changes: 9 additions & 0 deletions src/tests/webR/mount.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ describe('Mount filesystem using R API', () => {
await cleanupMnt();
});

test('Mount v2.0 filesystem image - no metadata hint', async () => {
await expect(webR.evalRVoid(
'webr::mount("/mnt", "tests/webR/data/test_image_no_hint.tgz", "workerfs")'
)).resolves.not.toThrow();
expect(await webR.evalRString("list.files('/mnt/abc')[2]")).toEqual("foo.csv");
expect(await webR.evalRString("readLines('/mnt/abc/bar.csv')[1]")).toEqual("a, b, c");
await cleanupMnt();
});

test('Mount filesystem image from URL', async () => {
const url = "https://repo.r-wasm.org/bin/emscripten/contrib/4.4/cli_3.6.3.js.metadata";
await expect(webR.evalRVoid(`
Expand Down

0 comments on commit 5d1e4fb

Please sign in to comment.