From 0bc78dbe26a3d19c4df83d27ca641ca37800ed04 Mon Sep 17 00:00:00 2001 From: Dominic Saadi Date: Wed, 10 Apr 2024 12:30:33 -0700 Subject: [PATCH] chore: make crwa e2e test work across branches (#10437) On main we run CI on every pull request. On next, we run it on every push to the next branch. This gives whoever's doing release confidence that cherry picking was done correctly. There's one CRWA test that doesn't translate across branches because it's a snapshot of the package's version. See https://github.com/redwoodjs/redwood/actions/runs/8607313332. This PR updates that test so that it checks that the version string matches a RegExp instead of a snapshot. --- packages/create-redwood-app/tests/e2e.test.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/create-redwood-app/tests/e2e.test.ts b/packages/create-redwood-app/tests/e2e.test.ts index 4909cde6e8e9..e7f11a767db6 100644 --- a/packages/create-redwood-app/tests/e2e.test.ts +++ b/packages/create-redwood-app/tests/e2e.test.ts @@ -46,10 +46,7 @@ describe('create-redwood-app', () => { const p = await $`yarn create-redwood-app --version` expect(p.exitCode).toEqual(0) - expect(p.stdout).toMatchInlineSnapshot(` - "7.1.2 - [?25l[?25h" - `) + expect(p.stdout).toMatch(/\d+\.\d+\.\d+/) expect(p.stderr).toMatchInlineSnapshot(`"[?25l[?25h"`) }) @@ -90,7 +87,9 @@ describe('create-redwood-app', () => { [?25l✔ Initialized a git repo with commit message "Initial commit" [?25h" `) - expect(p.stderr).toMatchInlineSnapshot(`"[?25l[?25h[?25l[?25h[?25l[?25h[?25l[?25h[?25l[?25h[?25l[?25h[?25l[?25h"`) + expect(p.stderr).toMatchInlineSnapshot( + `"[?25l[?25h[?25l[?25h[?25l[?25h[?25l[?25h[?25l[?25h[?25l[?25h[?25l[?25h"`, + ) await fs.rm('./redwood-app', { recursive: true, force: true }) })