From 654277f33b1868d39439af02b9f84b1ca86180d2 Mon Sep 17 00:00:00 2001 From: jhockett Date: Fri, 28 Jan 2022 16:52:24 -0800 Subject: [PATCH] chore: bump uuid versions in test packages --- packages/amplify-e2e-core/package.json | 2 +- .../amplify-e2e-core/src/cli-test-runner.js | 28 ++++++------------- .../amplify-e2e-core/src/nexpect-reporter.js | 4 +-- packages/amplify-migration-tests/package.json | 2 +- .../amplify-storage-simulator/package.json | 2 +- 5 files changed, 13 insertions(+), 25 deletions(-) diff --git a/packages/amplify-e2e-core/package.json b/packages/amplify-e2e-core/package.json index 7f393a85e32..13e86c74409 100644 --- a/packages/amplify-e2e-core/package.json +++ b/packages/amplify-e2e-core/package.json @@ -36,6 +36,6 @@ "rimraf": "^3.0.0", "strip-ansi": "^6.0.0", "throat": "^5.0.0", - "uuid": "7.0.1" + "uuid": "^8.3.2" } } diff --git a/packages/amplify-e2e-core/src/cli-test-runner.js b/packages/amplify-e2e-core/src/cli-test-runner.js index 2f6dc5d6098..cf2e255a387 100644 --- a/packages/amplify-e2e-core/src/cli-test-runner.js +++ b/packages/amplify-e2e-core/src/cli-test-runner.js @@ -1,30 +1,18 @@ -const circusRunner = require("jest-circus/runner"); -const throat = require("throat"); -const uuid = require("uuid"); +const circusRunner = require('jest-circus/runner'); +const throat = require('throat'); +const { v4: uuid } = require('uuid'); const mutex = throat(1); -export const run = async ( - globalConfig, - config, - environment, - runtime, - testPath -) => { +export const run = async (globalConfig, config, environment, runtime, testPath) => { const CLITestRunner = {}; - environment.global.addCLITestRunnerLogs = (logs) => { + environment.global.addCLITestRunnerLogs = logs => { CLITestRunner.logs = logs; }; - environment.global.getRandomId = () => mutex(() => uuid.v4().split("-")[0]); - const result = await circusRunner( - globalConfig, - config, - environment, - runtime, - testPath - ); + environment.global.getRandomId = () => mutex(() => uuid().split('-')[0]); + const result = await circusRunner(globalConfig, config, environment, runtime, testPath); setTimeout(() => { - if (process.platform === "win32") { + if (process.platform === 'win32') { // An issue with node-pty leaves open handles when running within jest // This prevents the jest process from exiting without being forced. // Exiting here as a workaround, only on windows. diff --git a/packages/amplify-e2e-core/src/nexpect-reporter.js b/packages/amplify-e2e-core/src/nexpect-reporter.js index 20d8fec1e9f..3391e9f2b04 100644 --- a/packages/amplify-e2e-core/src/nexpect-reporter.js +++ b/packages/amplify-e2e-core/src/nexpect-reporter.js @@ -1,6 +1,6 @@ const fs = require('fs-extra'); const path = require('path'); -const uuid = require('uuid'); +const { v4: uuid } = require('uuid'); const localTemplatePath = path.resolve(__dirname, '../dist/index.html'); function imgToBase64(imgPath) { @@ -72,7 +72,7 @@ class AmplifyCLIExecutionReporter { const recordings = mergeCliLog(r, result.CLITestRunner.logs.children, r.ancestorTitles); const recordingWithPath = recordings.map(r => { - const castFile = `${uuid.v4()}.cast`; + const castFile = `${uuid()}.cast`; const castFilePath = path.join(publicPath, castFile); fs.writeFileSync(castFilePath, r.recording); const rCopy = { ...r }; diff --git a/packages/amplify-migration-tests/package.json b/packages/amplify-migration-tests/package.json index 95a0883c320..c7b41a6c99c 100644 --- a/packages/amplify-migration-tests/package.json +++ b/packages/amplify-migration-tests/package.json @@ -33,7 +33,7 @@ "graphql-transformer-core": "7.3.7", "lodash": "^4.17.21", "rimraf": "^3.0.0", - "uuid": "^8.2.0" + "uuid": "^8.3.2" }, "jest": { "verbose": false, diff --git a/packages/amplify-storage-simulator/package.json b/packages/amplify-storage-simulator/package.json index 82bcd8ed036..c8cca1c0cfd 100644 --- a/packages/amplify-storage-simulator/package.json +++ b/packages/amplify-storage-simulator/package.json @@ -41,7 +41,7 @@ "@types/etag": "^1.8.0", "@types/glob": "^7.1.1", "@types/serve-static": "^1.13.3", - "@types/uuid": "^3.4.7", + "@types/uuid": "^8.3.1", "@types/xml": "^1.0.4", "aws-sdk": "^2.963.0", "request": "^2.88.0"