From fa1cb5d1535c7c5cff5831a8b9e8a7f8efea6a33 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 15 Apr 2024 16:49:47 +0000 Subject: [PATCH] correcting imports --- .../__tests__/upload-artifact.test.ts | 36 ++++--------------- packages/artifact/package-lock.json | 10 ------ packages/artifact/package.json | 1 - 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index 1e8e9153..9fb324d4 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -10,6 +10,7 @@ import {noopLogs} from './common' import {FilesNotFoundError} from '../src/internal/shared/errors' import {BlockBlobClient} from '@azure/storage-blob' import * as fs from 'fs' +import {writeFile} from 'fs/promises' import * as path from 'path' describe('upload-artifact', () => { @@ -361,36 +362,11 @@ describe('upload-artifact', () => { if (!fs.existsSync(dirPath)) { fs.mkdirSync(dirPath, {recursive: true}) } - // eslint-disable-next-line @typescript-eslint/await-thenable - await fs.writeFile( - path.join(dirPath, 'file1.txt'), - 'test file content', - err => { - if (err) { - throw err - } - } - ) - // eslint-disable-next-line @typescript-eslint/await-thenable - await fs.writeFile( - path.join(dirPath, 'file2.txt'), - 'test file content', - err => { - if (err) { - throw err - } - } - ) - // eslint-disable-next-line @typescript-eslint/await-thenable - await fs.writeFile( - path.join(dirPath, 'file3.txt'), - 'test file content', - err => { - if (err) { - throw err - } - } - ) + + await writeFile(path.join(dirPath, 'file1.txt'), 'test file content') + await writeFile(path.join(dirPath, 'file2.txt'), 'test file content') + + await writeFile(path.join(dirPath, 'file3.txt'), 'test file content') jest .spyOn(uploadZipSpecification, 'validateRootDirectory') diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 4d243ffd..643dcb86 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -27,7 +27,6 @@ "devDependencies": { "@types/archiver": "^5.3.2", "@types/unzip-stream": "^0.3.4", - "mock-fs": "^5.2.0", "typedoc": "^0.25.4", "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.2.2" @@ -1225,15 +1224,6 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/mock-fs": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-5.2.0.tgz", - "integrity": "sha512-2dF2R6YMSZbpip1V1WHKGLNjr/k48uQClqMVb5H3MOvwc9qhYis3/IWbj02qIg/Y8MDXKFF4c5v0rxx2o6xTZw==", - "dev": true, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 9c2c1ed9..ab60a271 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -60,7 +60,6 @@ "@types/unzip-stream": "^0.3.4", "typedoc": "^0.25.4", "typedoc-plugin-markdown": "^3.17.1", - "mock-fs": "^5.2.0", "typescript": "^5.2.2" } } \ No newline at end of file