From 3b9149d0376f9ed627b249a0e4e7eac27ebb153f Mon Sep 17 00:00:00 2001 From: Pawel Leszczewicz Date: Mon, 28 Oct 2024 12:15:18 +0100 Subject: [PATCH] fix name too long error --- helper.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helper.ts b/helper.ts index 109d00c..69e2e1b 100644 --- a/helper.ts +++ b/helper.ts @@ -2,6 +2,7 @@ import fs from 'fs-extra'; import os from 'os'; import path from 'path'; import { AggregatedResult } from '@jest/test-result'; +import { createHash } from 'crypto'; let username: string = ''; try { @@ -12,7 +13,7 @@ try { export const tempDirPath = path.resolve( process.env.JEST_HTML_REPORTERS_TEMP_DIR_PATH || os.tmpdir(), - `${username}-${Buffer.from(process.cwd()).toString('base64')}`, + `${username}-${createHash('sha256').update(Buffer.from(process.cwd())).digest('base64')}`, 'jest-html-reporters-temp' );