File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export class SubstituteJS {
77 this . _lastRegisteredSubstituteJSMethodOrProperty = value ;
88 }
99 get lastRegisteredSubstituteJSMethodOrProperty ( ) {
10- return typeof this . _lastRegisteredSubstituteJSMethodOrProperty === 'undefined' ? 'root' : this . _lastRegisteredSubstituteJSMethodOrProperty ;
10+ return this . _lastRegisteredSubstituteJSMethodOrProperty ?? 'root' ;
1111 }
1212 [ Symbol . toPrimitive ] ( ) {
1313 return `[class ${ this . constructor . name } ] -> ${ this . lastRegisteredSubstituteJSMethodOrProperty } ` ;
Original file line number Diff line number Diff line change 11import { Argument , AllArguments } from './Arguments' ;
2- import { GetPropertyState } from './states/GetPropertyState' ;
3- import { InitialState } from './states/InitialState' ;
4- import { Context } from './Context' ;
52import * as util from 'util' ;
63
74export type Call = any [ ] // list of args
@@ -11,7 +8,7 @@ export enum PropertyType {
118 property = 'property'
129}
1310
14- export enum SubstituteMethods {
11+ export enum SubstituteMethod {
1512 received = 'received' ,
1613 didNotReceive = 'didNotReceive' ,
1714 mimicks = 'mimicks' ,
@@ -21,6 +18,14 @@ export enum SubstituteMethods {
2118 rejects = 'rejects'
2219}
2320
21+ export function isSubstituteMethod ( property : PropertyKey ) : property is SubstituteMethod {
22+ return property === SubstituteMethod . returns ||
23+ property === SubstituteMethod . mimicks ||
24+ property === SubstituteMethod . throws ||
25+ property === SubstituteMethod . resolves ||
26+ property === SubstituteMethod . rejects ;
27+ }
28+
2429const seenObject = Symbol ( ) ;
2530
2631export function stringifyArguments ( args : any [ ] ) {
You can’t perform that action at this time.
0 commit comments