From 793cebd2ee391f3eeabf04b9cb9e2e09af8a2ecc Mon Sep 17 00:00:00 2001 From: patak Date: Wed, 29 Nov 2023 11:52:10 +0100 Subject: [PATCH] test: avoid magic number on cli playground spec (#15168) --- playground/cli/__tests__/cli.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playground/cli/__tests__/cli.spec.ts b/playground/cli/__tests__/cli.spec.ts index bcaa81b61c2520..3cafa768b3bf9a 100644 --- a/playground/cli/__tests__/cli.spec.ts +++ b/playground/cli/__tests__/cli.spec.ts @@ -21,9 +21,10 @@ test('cli should work', async () => { }) test('should restart', async () => { + const logsLengthBeforeEdit = streams.server.out.length editFile('./vite.config.js', (content) => content) await withRetry(async () => { - const logs = streams.server.out.slice(2) + const logs = streams.server.out.slice(logsLengthBeforeEdit) expect(logs).toEqual( expect.arrayContaining([expect.stringMatching('server restarted')]), )