We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First of all thanks for this awesome library! I have met some problem as below and would appreciate if you can help shed some light
import fsPromises from 'fs/promises'; const createFolder = async (target: string) => { await fsPromises.mkdir(target, { recursive: true }); };
The above code is pretty straight forward, which takes in target, and create the folder recursively.
target
Now I'm trying unit test as below
import {createFolder} from './xx'; import mock from 'mock-fs'; import fs from 'fs'; describe('createFolder()', () => { beforeAll(() => { mock( { sourceFolder: { 'index.md': 'abc', }, }, { createCwd: true, createTmp: true } ); }); afterAll(() => { mock.restore(); }); it('creates folder successfully', async () => { await createFolder( `${process.cwd()}/destinationFolder` ); expect(fs.existsSync(`${process.cwd()}/destinationFolder`)).toBeTruthy(); }); });
When the above code ran, it will hang all the way till timeout, can anyone share what's wrong with it?
The text was updated successfully, but these errors were encountered:
I'm having the same issue with fsPromises.readFile.
fsPromises.readFile
Sorry, something went wrong.
No branches or pull requests
First of all thanks for this awesome library! I have met some problem as below and would appreciate if you can help shed some light
The above code is pretty straight forward, which takes in
target
, and create the folder recursively.Now I'm trying unit test as below
When the above code ran, it will hang all the way till timeout, can anyone share what's wrong with it?
The text was updated successfully, but these errors were encountered: