Skip to content

Commit 8a731a9

Browse files
committed
fixup! fix(@schematics/angular): preserve stub-by-default semantics for createSpy with an original function
1 parent 32b6db3 commit 8a731a9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy_spec.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ getSpy().and.callThrough();`,
8282
input: `const mySpy = jasmine.createSpy('mySpy', () => 'foo').and.callThrough();`,
8383
expected: `const mySpy = vi.fn(() => 'foo').mockName('mySpy');`,
8484
},
85+
{
86+
description: 'should not stub jasmine.createSpy("name", fn) chained with another strategy',
87+
input: `const mySpy = jasmine.createSpy('mySpy', () => 'foo').and.returnValue(true);`,
88+
expected: `const mySpy = vi.fn(() => 'foo').mockName('mySpy').mockReturnValue(true);`,
89+
},
8590
{
8691
description:
8792
'should transform spyOnProperty(object, "prop") to vi.spyOn(object, "prop", "get").mockReturnValue(undefined)',

0 commit comments

Comments
 (0)