tschaub / mock-fs

Configurable mock for the fs module
https://npmjs.org/package/mock-fs
Other
906 stars 86 forks source link

Does 'mock-fs' work on WSL1 ? #347

Open AncientSwordRage opened 2 years ago

AncientSwordRage commented 2 years ago

I've tried to require it in my node.js test but I'm getting this error:

Test suite failed to run

    TypeError: Cannot read properties of undefined (reading 'read')

      2 | const { default: axios } = require('axios');
      3 | const fs = require('fs');
    > 4 | const mockFs = require('mock-fs');

I haven't seen anything about this error, nor using 'mock-fs' on WSL1.. I've removed the const fs = require('fs') and it still errors before running any tests.

Is there something I'm doing wrong or is it not compatible with WSL1?

blutorange commented 2 years ago

@AncientSwordRage

Might be the same as #344 , or at least related to it? I'm getting the error too (see my comment in that issue), but I'm using Ubuntu. As far as I could find out, it seems to happen only with yarn -- are you using yarn too?

AncientSwordRage commented 2 years ago

@blutorange nah I'm using npm. I'm wondering if they're still related somehow though?