From 2f5ebb49c86f1c2d946e648759f69bd23cc2f4da Mon Sep 17 00:00:00 2001 From: "AGODA\\vpiyachinda" Date: Fri, 9 Feb 2024 16:34:14 +0700 Subject: [PATCH] review comment --- README.md | 5 ++++- package-lock.json | 2 +- package.json | 2 +- src/vitest/common.ts | 6 +----- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4e3c727..4e4fde4 100644 --- a/README.md +++ b/README.md @@ -103,5 +103,8 @@ if the version is not updated, delete node_modules folder and reinstall The idea is you can publish the new version using `release` job on CI. -# for playwright +## for playwright please read doc/PLAYWRIGHT.md + +## for vitest +please read doc/VITEST.md diff --git a/package-lock.json b/package-lock.json index 6ef3cbc..7833f23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "@playwright/test": "^1.30.1", "@types/jest": "^29.5.1", "@types/luxon": "^3.3.0", - "@types/node": "^20.3.3", + "@types/node": "^20.11.16", "@types/uuid": "^9.0.2", "jest": "^29.5.0", "jest-environment-jsdom": "^29.5.0", diff --git a/package.json b/package.json index 802d327..48b7335 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@playwright/test": "^1.30.1", "@types/jest": "^29.5.1", "@types/luxon": "^3.3.0", - "@types/node": "^20.3.3", + "@types/node": "^20.11.16", "@types/uuid": "^9.0.2", "jest": "^29.5.0", "jest-environment-jsdom": "^29.5.0", diff --git a/src/vitest/common.ts b/src/vitest/common.ts index ec336c1..d7cc701 100644 --- a/src/vitest/common.ts +++ b/src/vitest/common.ts @@ -55,10 +55,6 @@ export const getCommonMetadata = ( }; }; -const ENDPOINT_FROM_TYPE = { - vitest: process.env.VITEST_TESTDATA_API_URL ?? UNKNOWN_VALUE, // your api endpoint eg. http://your_domain/vitest -}; - const LOG_FILE = 'devfeedback.log'; const sendData = async (endpoint: string, data: CommonMetadata): Promise => { @@ -71,7 +67,7 @@ const sendData = async (endpoint: string, data: CommonMetadata): Promise { - const endpoint = ENDPOINT_FROM_TYPE[testData.type]; + const endpoint = process.env.VITEST_TESTDATA_API_URL ?? UNKNOWN_VALUE; // your api endpoint eg. http://your_domain/vitest console.log(`Your test time was ${testData.timeTaken.toFixed(2)}ms.`);