Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/php-wasm/node/src/test/mount.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,21 @@ describe('Mounting', () => {
}
});

it('Should create a file node, not a directory, when mounting a file', async () => {
// This test addresses issue #503
// Ensure the mount point doesn't exist yet
expect(php.fileExists(fileMountPoint)).toBe(false);

await php.mount(
fileMountPoint,
createNodeFsMountHandler(filePath)
);

// The mount point should be a file, not a directory
expect(php.isFile(fileMountPoint)).toBe(true);
expect(php.isDir(fileMountPoint)).toBe(false);
});

it('Should unmount mounted file and remove created node from VFS', async () => {
const unmount = await php.mount(
fileMountPoint,
Expand Down