From 78c30fdfb0afb594a8c7d04c09a14159c2fb2769 Mon Sep 17 00:00:00 2001 From: uid11 Date: Thu, 7 Dec 2023 07:47:32 +0300 Subject: [PATCH] fix: errors in `updateChangelog` script fix: typos in `CHANGELOG.md` fix: errors in `package.json` by `npm pkg fix` fix: simplify `mapBackendResponseErrorToLog` function --- CHANGELOG.md | 16 ++++------------ .../configurator/mapBackendResponseToLog.ts | 18 ++---------------- package.json | 6 +++--- scripts/updateChangelog.ts | 8 +++++--- 4 files changed, 14 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acc32bd6..ceae1fe5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,11 @@ [Full Changelog](https://github.com/joomcode/e2ed/compare/v0.15.12...v0.15.13) -- [Merge pull request #49 from joomcode/fix/stricter-type-of-expect-function](https://github.com/joomcode/e2ed/commit/"tformat:5bef95cc0d010394d9654af7d112bf8) ([a5ff85146uid11](https://github.com/a5ff85146uid11)) +- [Merge pull request #49 from joomcode/fix/stricter-type-of-expect-function](https://github.com/joomcode/e2ed/commit/5bef95cc0d010394d9654af7d112bf8a5ff85146) ([uid11](https://github.com/uid11)) fix: stricter type of `expect` function -- ["](https://github.com/joomcode/e2ed/commit/") ([](https://github.com/)) - - "tformat:d72142f57210d289f7fc5b780122f093e82903d5uid11|FI-705 fix: stricter type of `expect` function +- [FI-705 fix: stricter type of `expect` function](https://github.com/joomcode/e2ed/commit/d72142f57210d289f7fc5b780122f093e82903d5) ([uid11](https://github.com/uid11)) fix: support usual promises in `expect` function @@ -52,17 +50,11 @@ chore: update github action and node version in ci.yaml -- ["](https://github.com/joomcode/e2ed/commit/") ([](https://github.com/)) - - "tformat:791ed2f932f0cdd541c8d0f719c44dfce8f312eaNikita Torchinskiy|Merge pull request #48 from joomcode/FI-1028 +- [Merge pull request #48 from joomcode/FI-1028](https://github.com/joomcode/e2ed/commit/791ed2f932f0cdd541c8d0f719c44dfce8f312ea) ([nnn3d](https://github.com/nnn3d)) FI-1028: remove E2ED*DOCKER_DO*\* params -- ["](https://github.com/joomcode/e2ed/commit/") ([](https://github.com/)) - - "tformat:15794d3a1ab9c227cf4a687bb065e5d60589334aNikita*Torchinskiy|FI-1028: remove E2ED_DOCKER_DO*\* params - -- ["](https://github.com/joomcode/e2ed/commit/") ([](https://github.com/)) +- [FI-1028: remove E2ED*DOCKER_DO*\* params](https://github.com/joomcode/e2ed/commit/15794d3a1ab9c227cf4a687bb065e5d60589334a) ([nnn3d](https://github.com/nnn3d)) ## [v0.15.12](https://github.com/joomcode/e2ed/tree/v0.15.12) (2023-11-29) diff --git a/autotests/configurator/mapBackendResponseToLog.ts b/autotests/configurator/mapBackendResponseToLog.ts index 50ae34c2..20ab6cd9 100644 --- a/autotests/configurator/mapBackendResponseToLog.ts +++ b/autotests/configurator/mapBackendResponseToLog.ts @@ -12,27 +12,13 @@ import type {MapBackendResponseToLog} from 'autotests/types/packSpecific'; export const mapBackendResponseToLog: MapBackendResponseToLog = ({ completionTimeInMs, request, - responseBody, - responseHeaders, statusCode, }) => { if (statusCode >= 400) { return undefined; } - if (request) { - const maybeWithDuration: {duration?: string} = {}; + const duration = getDurationWithUnits(completionTimeInMs - request.utcTimeInMs); - if (completionTimeInMs !== undefined && request.utcTimeInMs !== undefined) { - maybeWithDuration.duration = getDurationWithUnits(completionTimeInMs - request.utcTimeInMs); - } - - return {...maybeWithDuration, statusCode, url: request?.url}; - } - - return { - responseBody: responseBody instanceof Buffer ? String(responseBody) : responseBody, - responseHeaders, - statusCode, - }; + return {duration, statusCode, url: request?.url}; }; diff --git a/package.json b/package.json index cc5863aa..efb1fd3a 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "author": "uid11", "license": "MIT", "bin": { - "e2ed": "./bin/localEntrypoint.js", - "e2ed-init": "./bin/init.js" + "e2ed": "bin/localEntrypoint.js", + "e2ed-init": "bin/init.js" }, "bugs": "https://github.com/joomcode/e2ed/issues", "engines": { @@ -21,7 +21,7 @@ "homepage": "https://github.com/joomcode/e2ed#readme", "repository": { "type": "git", - "url": "https://github.com/joomcode/e2ed" + "url": "git+https://github.com/joomcode/e2ed.git" }, "dependencies": { "bin-v8-flags-filter": "1.2.0", diff --git a/scripts/updateChangelog.ts b/scripts/updateChangelog.ts index 4ae55017..bb37cb6d 100644 --- a/scripts/updateChangelog.ts +++ b/scripts/updateChangelog.ts @@ -11,13 +11,15 @@ import {repository, version} from '../package.json'; const EXEC_FILE_OPTIONS = {encoding: 'utf8'} as const; -function assertValueIsDefined(value: T): asserts value is Exclude { +function assertValueIsDefined(value: Type): asserts value is Exclude { if (value === undefined) { throw new TypeError('Asserted value is undefined'); } } -const {href: repoUrl, origin: repoOrigin} = new URL(repository.url); +const {hostname, pathname} = new URL(repository.url); +const repoOrigin = `https://${hostname}`; +const repoUrl = `${repoOrigin}${pathname.slice(0, -4)}`; const changelogPath = join(__dirname, '..', 'CHANGELOG.md'); const fullDate = new Date().toISOString().slice(0, 10); @@ -29,7 +31,7 @@ const SEPARATOR = '\n'.repeat(64); const gitOptions = [ 'log', `HEAD...v${previousVersion}`, - `--pretty="tformat:%H%aN|%s%n%b${'%n'.repeat(SEPARATOR.length)}"`, + `--pretty=tformat:%H%aN|%s%n%b${'%n'.repeat(SEPARATOR.length)}`, ]; const commits = execFileSync('git', gitOptions, EXEC_FILE_OPTIONS)