fix proxying expect.not
This commit is contained in:
parent
978cd7d80a
commit
4d44faf911
|
|
@ -184,13 +184,13 @@ function createExpect(info: ExpectMetaInfo, prefix: string[], customMatchers: Re
|
||||||
}
|
}
|
||||||
|
|
||||||
if (property === 'not') {
|
if (property === 'not') {
|
||||||
return new Proxy(expectLibrary, {
|
return new Proxy(expectLibrary.not, {
|
||||||
get: function(target: any, property: string) {
|
get: function(target: any, property: string) {
|
||||||
if (typeof property === 'string' && typeof customMatchers[property] === 'function' && typeof (customMatchers[property] as any).qualifiedName === 'string') {
|
if (typeof property === 'string' && typeof customMatchers[property] === 'function' && typeof (customMatchers[property] as any).qualifiedName === 'string') {
|
||||||
const qualifiedName = (customMatchers[property] as any).qualifiedName as string;
|
const qualifiedName = (customMatchers[property] as any).qualifiedName as string;
|
||||||
return (expectLibrary as any)['not'][qualifiedName];
|
return target[qualifiedName];
|
||||||
}
|
}
|
||||||
return (expectLibrary as any)['not'][property];
|
return target[property];
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue