From 2f9ba491f741e4e2e9b482423cf92db5908c3222 Mon Sep 17 00:00:00 2001 From: John Mendelewski Date: Mon, 6 Nov 2023 12:48:48 -0500 Subject: [PATCH] Fix validateProjectConfig tests --- packages/cli/lib/__tests__/projects.test.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/cli/lib/__tests__/projects.test.js b/packages/cli/lib/__tests__/projects.test.js index f4cf51b8a..0834aadff 100644 --- a/packages/cli/lib/__tests__/projects.test.js +++ b/packages/cli/lib/__tests__/projects.test.js @@ -69,9 +69,10 @@ describe('@hubspot/cli/lib/projects', () => { expect(exitMock).toHaveBeenCalledWith(EXIT_CODES.ERROR); expect(errorSpy).toHaveBeenCalledWith( - expect.stringMatching( - new RegExp(`.*'..'.*contained within.*'${projectDir}'.*`) - ) + expect.stringContaining('srcDir: ".."') + ); + expect(errorSpy).toHaveBeenCalledWith( + expect.stringContaining(`within ${projectDir}`) ); }); @@ -83,9 +84,10 @@ describe('@hubspot/cli/lib/projects', () => { expect(exitMock).toHaveBeenCalledWith(EXIT_CODES.ERROR); expect(errorSpy).toHaveBeenCalledWith( - expect.stringMatching( - new RegExp(`.*'/'.*contained within.*'${projectDir}'.*`) - ) + expect.stringContaining('srcDir: "/"') + ); + expect(errorSpy).toHaveBeenCalledWith( + expect.stringContaining(`within ${projectDir}`) ); }); @@ -96,9 +98,10 @@ describe('@hubspot/cli/lib/projects', () => { expect(exitMock).toHaveBeenCalledWith(EXIT_CODES.ERROR); expect(errorSpy).toHaveBeenCalledWith( - expect.stringMatching( - new RegExp(`.*'${srcDir}'.*contained within.*'${projectDir}'.*`) - ) + expect.stringContaining(`srcDir: "${srcDir}"`) + ); + expect(errorSpy).toHaveBeenCalledWith( + expect.stringContaining(`within ${projectDir}`) ); }); });