Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimaMateria committed Jul 1, 2022
1 parent c3e3c16 commit 35c00d1
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/detectDireflowSetup.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import fileMock from 'mock-fs';
import { fs, vol } from 'memfs';
import isDireflowSetup from '../cli/helpers/detectDireflowSetup';

const isSetupFilePath = 'path/to/mock/setup';
const isNotSetupFilePath = 'path/to/mock/non-setup';
jest.mock('fs', () => fs);

fileMock({
[isSetupFilePath]: {
'direflow-webpack.js': '',
},
[isNotSetupFilePath]: {},
});
const isSetupFilePath = '/path/to/mock/setup';
const isNotSetupFilePath = '/path/to/mock/non-setup';

const mockFsJson = {
[`${isSetupFilePath}/direflow-webpack.js`]: '',
[`${isNotSetupFilePath}/foo`]: '',
};
vol.fromJSON(mockFsJson);

describe('Detect Direflow Setup', () => {
afterAll(() => {
fileMock.restore();
vol.reset();
});

it('should return true if Direflow Setup', () => {
Expand Down

0 comments on commit 35c00d1

Please sign in to comment.