From 3adb2cfdb23aaab9cfe6b6dcd84bba7b030a7664 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sun, 9 Feb 2025 11:53:17 -0500 Subject: [PATCH] test: enhance upgrade command tests for console output --- commands/__test__/upgrade.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/__test__/upgrade.spec.ts b/commands/__test__/upgrade.spec.ts index 632f3d1..c19b058 100644 --- a/commands/__test__/upgrade.spec.ts +++ b/commands/__test__/upgrade.spec.ts @@ -58,8 +58,11 @@ describe('Non-Interactive Mode', () => { await upgrade('__testfixtures__') - expect(spyOnConsole).toHaveBeenCalled() expect(spyOnConsole).toHaveBeenCalledTimes(5) + expect(spyOnConsole).toHaveBeenCalledWith('> Applying codemod: magic-redirect') + expect(spyOnConsole).toHaveBeenCalledWith('> Applying codemod: pluralized-methods') + expect(spyOnConsole).toHaveBeenCalledWith('> Applying codemod: req-param') + expect(spyOnConsole).toHaveBeenCalledWith('> Applying codemod: v4-deprecated-signatures') expect(spyOnConsole).toHaveBeenLastCalledWith('\n> All codemods have been applied successfully. \n') expect(run).toHaveBeenCalledTimes(4) })