From b0330cf67a45869163e35a5b620f5067c8fa1171 Mon Sep 17 00:00:00 2001 From: David Berlin Date: Mon, 6 May 2024 21:25:54 +0300 Subject: [PATCH] fix: continued work on tests --- .../__snapshots__/framework-detection.test.js.snap | 6 ------ .../dev/__snapshots__/dev-miscellaneous.test.js.snap | 3 --- tests/integration/commands/dev/dev-miscellaneous.test.js | 6 +++++- tests/integration/framework-detection.test.js | 6 +++++- 4 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 tests/integration/commands/dev/__snapshots__/dev-miscellaneous.test.js.snap diff --git a/tests/integration/__snapshots__/framework-detection.test.js.snap b/tests/integration/__snapshots__/framework-detection.test.js.snap index 968f20716f9..95c47bd12ac 100644 --- a/tests/integration/__snapshots__/framework-detection.test.js.snap +++ b/tests/integration/__snapshots__/framework-detection.test.js.snap @@ -29,12 +29,6 @@ exports[`frameworks/framework-detection > should detect a known framework 1`] = ◈ Command failed with exit code *: npm run start. Shutting down Netlify Dev server" `; -exports[`frameworks/framework-detection > should fail in CI when multiple frameworks are detected 1`] = ` -"◈ Netlify Dev ◈ -Multiple possible dev commands found -◈ Detected commands for: Gatsby, Create React App. Update your settings to specify which to use. Refer to https://ntl.fyi/dev-monorepo for more information." -`; - exports[`frameworks/framework-detection > should filter frameworks with no dev command 1`] = ` "◈ Netlify Dev ◈ ◈ No app server detected. Using simple static server diff --git a/tests/integration/commands/dev/__snapshots__/dev-miscellaneous.test.js.snap b/tests/integration/commands/dev/__snapshots__/dev-miscellaneous.test.js.snap deleted file mode 100644 index 604294edef5..00000000000 --- a/tests/integration/commands/dev/__snapshots__/dev-miscellaneous.test.js.snap +++ /dev/null @@ -1,3 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`commands/dev-miscellaneous > should fail in CI with multiple projects 1`] = `"› Error: Sites detected: package1, package2. Configure the site you want to work with and try again. Refer to https://ntl.fyi/configure-site for more information."`; diff --git a/tests/integration/commands/dev/dev-miscellaneous.test.js b/tests/integration/commands/dev/dev-miscellaneous.test.js index a373d59f43e..ba6f03dbb07 100644 --- a/tests/integration/commands/dev/dev-miscellaneous.test.js +++ b/tests/integration/commands/dev/dev-miscellaneous.test.js @@ -1339,7 +1339,11 @@ describe.concurrent('commands/dev-miscellaneous', () => { await childProcess } const error = await asyncErrorBlock().catch((error_) => error_) - t.expect(normalize(error.stderr, { duration: true, filePath: true })).toMatchSnapshot() + t.expect( + normalize(error.stderr, { duration: true, filePath: true }).includes( + 'Sites detected: package1, package2. Configure the site you want to work with and try again. Refer to https://ntl.fyi/configure-site for more information.', + ), + ) t.expect(error.exitCode).toBe(1) }) }) diff --git a/tests/integration/framework-detection.test.js b/tests/integration/framework-detection.test.js index 7a610ce28b5..1ab1ce5a12b 100644 --- a/tests/integration/framework-detection.test.js +++ b/tests/integration/framework-detection.test.js @@ -278,7 +278,11 @@ describe.concurrent('frameworks/framework-detection', () => { await childProcess } const error = await asyncErrorBlock().catch((error_) => error_) - t.expect(normalize(error.stdout, { duration: true, filePath: true })).toMatchSnapshot() + t.expect( + normalize(error.stdout, { duration: true, filePath: true }).includes( + 'Detected commands for: Gatsby, Create React App. Update your settings to specify which to use. Refer to https://ntl.fyi/dev-monorepo for more information.', + ), + ) t.expect(error.exitCode).toBe(1) }) })