move logic below
This commit is contained in:
parent
2d7ae24de9
commit
1af4bc0b5d
|
|
@ -265,8 +265,9 @@ class ExpectMetaInfoProxyHandler implements ProxyHandler<any> {
|
|||
|
||||
get(target: Object, matcherName: string | symbol, receiver: any): any {
|
||||
let matcher = Reflect.get(target, matcherName, receiver);
|
||||
if (typeof matcherName !== 'string')
|
||||
return matcher;
|
||||
|
||||
if (typeof matcherName === 'string') {
|
||||
for (const prefix of this._prefixes) {
|
||||
for (let i = prefix.length; i > 0; i--) {
|
||||
const qualifiedName = qualifiedMatcherName(prefix.slice(0, i), matcherName);
|
||||
|
|
@ -276,10 +277,7 @@ class ExpectMetaInfoProxyHandler implements ProxyHandler<any> {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof matcherName !== 'string')
|
||||
return matcher;
|
||||
if (matcher === undefined)
|
||||
throw new Error(`expect: Property '${matcherName}' not found.`);
|
||||
if (typeof matcher !== 'function') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue