File tree Expand file tree Collapse file tree
packages/schematics/angular/refactor/jasmine-vitest/transformers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -445,6 +445,24 @@ export function transformSpyReset(
445445 return node ;
446446}
447447
448+ function shouldStubBareSpyOn ( node : ts . CallExpression ) : boolean {
449+ if (
450+ ts . isIdentifier ( node . expression ) &&
451+ node . expression . text === 'spyOnProperty' &&
452+ node . arguments . length >= 3
453+ ) {
454+ const accessType = node . arguments [ 2 ] ;
455+ if ( ts . isStringLiteralLike ( accessType ) && accessType . text === 'set' ) {
456+ return false ;
457+ }
458+ }
459+
460+ const parent = node . parent ;
461+ if (
462+ parent &&
463+ ts . isPropertyAccessExpression ( parent ) &&
464+ parent . expression === node &&
465+ ts . isIdentifier ( parent . name ) &&
448466function shouldStubBareSpyOn ( node : ts . CallExpression ) : boolean {
449467 if (
450468 ts . isIdentifier ( node . expression ) &&
@@ -471,6 +489,9 @@ function shouldStubBareSpyOn(node: ts.CallExpression): boolean {
471489 return true ;
472490}
473491
492+ return true ;
493+ }
494+
474495function getSpyIdentifierFromCalls ( node : ts . PropertyAccessExpression ) : ts . Expression | undefined {
475496 if ( ts . isIdentifier ( node . name ) && node . name . text === 'calls' ) {
476497 return node . expression ;
You can’t perform that action at this time.
0 commit comments