test(dpip): [PKG-DPIP-02] reproduce window races and DOM rollback failures

This commit is contained in:
Harvey Zhao committed 2026-09-12 14:02:18 +08:00
1 parent efbbdb4782
commit 202351934b
13 files changed
+574 -13

No files matched your search

+1 -1
View File
@@ -188,7 +188,7 @@ export function dpipEnvironment(implementation, settings = {}) {
}
const context = vm.createContext({ window, document, console: { warn: (...args) => warnings.push(args) }, module: { exports: {} } })
context.exports = context.module.exports
const evaluate = () => vm.runInContext(implementation.code, context, { timeout: 5000 })
const evaluate = () => vm.runInContext(`(() => { ${implementation.code}\n })()`, context, { timeout: 5000 })
evaluate()
return {
factory: context.module.exports.default || context.module.exports,