Skip to content

Commit

Permalink
and now make win32 tests work again
Browse files Browse the repository at this point in the history
  • Loading branch information
bitdisaster committed Feb 20, 2020
1 parent 1d5e883 commit ebb368c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions __tests__/utils/rc-edit-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { extractIcon } from 'exe-icon-extractor';
import * as mockFs from 'mock-fs';

import { separator as S } from '../../src/utils/separator';
import { getMockFileSystem } from '../mocks/mock-fs';

const rcinfoMock = jest.fn();
Expand All @@ -26,7 +27,7 @@ const acmeFileInfo = { 'version-string':
beforeAll(() => {
// console.log call needed as workaround to make jest work with mock-fs
console.log('');
process.env.TEMP = process.platform === 'win32' ? 'C:\\temp' : '/tmp';
process.env.TEMP = process.platform === 'win32' ? 'C:\\tmp' : '/tmp';
getMockFileSystem();
mockFs(getMockFileSystem());
})
Expand Down Expand Up @@ -56,7 +57,7 @@ test('transfers exe file info to stub exe',async () => {

await createStubExe(process.env.TEMP! , 'acme', 'bat-app', 'Wayne Enterprise', 'I am Batman', '3.3.3');
expect(rcinfoMock).toBeCalledTimes(1);
expect(rcinfoMock).toBeCalledWith(`${process.env.TEMP}/acme.exe`, expect.anything());
expect(rcinfoMock).toBeCalledWith(`${process.env.TEMP}${S}acme.exe`, expect.anything());
expect(rceditMock).toBeCalledTimes(1);
expect(rceditMock).toBeCalledWith(expect.stringMatching(acmeExeRegex), acmeFileInfo);
});
Expand Down

0 comments on commit ebb368c

Please sign in to comment.