mirror of
https://github.com/actions/labeler.git
synced 2025-12-17 23:59:40 +00:00
build
This commit is contained in:
13
node_modules/jest-mock/build/index.js
generated
vendored
13
node_modules/jest-mock/build/index.js
generated
vendored
@@ -845,14 +845,20 @@ class ModuleMockerClass {
|
||||
this._typeOf(original) +
|
||||
' given instead'
|
||||
);
|
||||
} // @ts-ignore overriding original method with a Mock
|
||||
}
|
||||
|
||||
const isMethodOwner = object.hasOwnProperty(methodName); // @ts-ignore overriding original method with a Mock
|
||||
|
||||
object[methodName] = this._makeComponent(
|
||||
{
|
||||
type: 'function'
|
||||
},
|
||||
() => {
|
||||
object[methodName] = original;
|
||||
if (isMethodOwner) {
|
||||
object[methodName] = original;
|
||||
} else {
|
||||
delete object[methodName];
|
||||
}
|
||||
}
|
||||
); // @ts-ignore original method is now a Mock
|
||||
|
||||
@@ -914,13 +920,14 @@ class ModuleMockerClass {
|
||||
this._typeOf(original) +
|
||||
' given instead'
|
||||
);
|
||||
}
|
||||
} // @ts-ignore: mock is assignable
|
||||
|
||||
descriptor[accessType] = this._makeComponent(
|
||||
{
|
||||
type: 'function'
|
||||
},
|
||||
() => {
|
||||
// @ts-ignore: mock is assignable
|
||||
descriptor[accessType] = original;
|
||||
Object.defineProperty(obj, propertyName, descriptor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user