formacao
This commit is contained in:
+18
-3
@@ -81,9 +81,24 @@ function mockObject(options, object, mockExports = {}) {
|
||||
define(newContainer, property, value);
|
||||
continue;
|
||||
}
|
||||
// Sometimes this assignment fails for some unknown reason. If it does,
|
||||
// just move along.
|
||||
if (!define(newContainer, property, isFunction || options.type === "autospy" ? value : {})) {
|
||||
if (options.type === "autospy" && type === "Module") {
|
||||
// Replace with clean object to recursively autospy exported module objects:
|
||||
// export * as ns from "./ns"
|
||||
// or
|
||||
// import * as ns from "./ns"
|
||||
// export { ns }
|
||||
const exports$1 = Object.create(null);
|
||||
Object.defineProperty(exports$1, Symbol.toStringTag, {
|
||||
value: "Module",
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
try {
|
||||
newContainer[property] = exports$1;
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
} else if (!define(newContainer, property, isFunction || options.type === "autospy" ? value : {})) {
|
||||
continue;
|
||||
}
|
||||
if (isFunction) {
|
||||
|
||||
Reference in New Issue
Block a user