Some of my unit tests need to read and/or write files. I'm trying to make 
use of NODEFS to map the cwd on Mac in node. I've read the documentation 
but I'm struggling to understand how and what do I need to FS.mount.

When running natively, my unit tests get the path to a base directory that 
is specific for each individual unit test. From that point on, the unit 
test itself concatenates string paths that access directories under that 

For example, a unit test called "foo" might have a base directory path 
"../../foo/". When the unit test code requests to open "subdir/file.txt", 
the file actually being opened would be "../../foo/subdir/file.txt".

To integrate this in Emscripten, I thought that if I mount the cwd 
everything else should "just work", but it seems that's not true. I tried:

  FS.mount(NODEFS, { root: '.' }, '.');

but it doesn't work.

I appreciate any help!

You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to