Skip to content

Commit ac17f42

Browse files
committed
Address feedback p3
1 parent 6096d8f commit ac17f42

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

lib/__tests__/watch.test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import chokidar from 'chokidar';
22
import PQueue from 'p-queue';
3-
import fs from 'fs';
43

54
import { uploadFolder } from '../cms/uploadFolder';
65
import { watch } from '../cms/watch';
@@ -10,7 +9,6 @@ jest.mock('chokidar');
109
jest.mock('axios');
1110
jest.mock('p-queue');
1211
jest.mock('../cms/uploadFolder');
13-
jest.mock('fs');
1412

1513
describe('lib/cms/watch', () => {
1614
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -100,10 +98,6 @@ describe('lib/cms/watch', () => {
10098
watch(accountId, src, dest, options);
10199

102100
expect(chokidarMock.on).toHaveBeenCalledWith('add', expect.any(Function));
103-
const addCallback = chokidarMock.on.mock.calls[1][1];
104-
const filePath = '/some-file-path.html';
105-
106-
addCallback(filePath);
107101
});
108102

109103
it('should handle file change event and upload file', () => {
@@ -125,10 +119,6 @@ describe('lib/cms/watch', () => {
125119
'change',
126120
expect.any(Function)
127121
);
128-
const changeCallback = chokidarMock.on.mock.calls[2][1];
129-
const filePath = 'changed-file-path.html';
130-
131-
changeCallback(filePath);
132122
});
133123

134124
it('should handle file delete event', () => {
@@ -150,11 +140,5 @@ describe('lib/cms/watch', () => {
150140
'unlink',
151141
expect.any(Function)
152142
);
153-
const deleteCallback = chokidarMock.on.mock.calls[2][1];
154-
const filePath = 'deleted-file-path.html';
155-
156-
deleteCallback(filePath);
157-
158-
fs.unlinkSync(filePath);
159143
});
160144
});

0 commit comments

Comments
 (0)