Skip to content

Commit 979fd2e

Browse files
committed
fix: make tests node 12 compatible
1 parent dd6459f commit 979fd2e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

__tests__/upload.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as upload from '../src/upload'
2-
import { writeFile, rm } from 'fs/promises'
2+
import * as fs from 'fs'
33
import { mocked } from 'ts-jest/utils'
44

55
jest.spyOn(upload, 'uploadBlob')
@@ -13,8 +13,8 @@ describe('upload-azure-blob => upload.ts', () => {
1313

1414
beforeAll(async () => {
1515
const data = new Uint8Array(Buffer.from('Hello Node.js'));
16-
await writeFile(FILENAME, data);
17-
await writeFile(FILENAME2, data);
16+
await fs.promises.writeFile(FILENAME, data);
17+
await fs.promises.writeFile(FILENAME2, data);
1818
})
1919

2020
test('uploadBlobs calls uploadBlob with one file', async () => {
@@ -33,7 +33,7 @@ describe('upload-azure-blob => upload.ts', () => {
3333
})
3434

3535
afterAll(async () => {
36-
await rm(FILENAME);
37-
await rm(FILENAME2);
36+
await fs.promises.rm(FILENAME);
37+
await fs.promises.rm(FILENAME2);
3838
})
3939
})

0 commit comments

Comments
 (0)