Skip to content

Commit 3f698c8

Browse files
test: keep the deferred snapshots off the running node version
The case pinned its target to the node running it, so the emitted runtime tracked that version — Object.hasOwn on a new one, the hasOwnProperty fallback on Node 14 — and the snapshot could not hold across the matrix. Use the conservative target the harness defaults to, as the repo's other bundle-snapshot case does. Refs #17121
1 parent de48b9c commit 3f698c8

3 files changed

Lines changed: 5 additions & 9 deletions

File tree

‎test/configCases/side-effects/pure-deferred-import/__snapshots__/ConfigCacheTest.snap‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function extra(a) {
124124
/******/ };
125125
/******/
126126
/******/ /* webpack/runtime/hasOwnProperty shorthand */
127-
/******/ __webpack_require__.o = (obj, prop) => (Object.hasOwn(obj, prop));
127+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop));
128128
/******/
129129
/******/ /* webpack/runtime/make optimized deferred namespace object */
130130
/******/ __webpack_require__.zO = function(moduleId, mode, asyncDeps, syncDeps) {
@@ -293,7 +293,7 @@ function extra(a) {
293293
/******/ };
294294
/******/
295295
/******/ /* webpack/runtime/hasOwnProperty shorthand */
296-
/******/ __webpack_require__.o = (obj, prop) => (Object.hasOwn(obj, prop));
296+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop));
297297
/******/
298298
/******/ /* webpack/runtime/make optimized deferred namespace object */
299299
/******/ __webpack_require__.zO = function(moduleId, mode, asyncDeps, syncDeps) {
@@ -698,7 +698,7 @@ function extra(a) {
698698
/******/ };
699699
/******/
700700
/******/ /* webpack/runtime/hasOwnProperty shorthand */
701-
/******/ __webpack_require__.o = (obj, prop) => (Object.hasOwn(obj, prop));
701+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop));
702702
/******/
703703
/******/ /* webpack/runtime/make optimized deferred namespace object */
704704
/******/ __webpack_require__.zO = function(moduleId, mode, asyncDeps, syncDeps) {
@@ -985,7 +985,7 @@ function extra(a) {
985985
/******/ };
986986
/******/
987987
/******/ /* webpack/runtime/hasOwnProperty shorthand */
988-
/******/ __webpack_require__.o = (obj, prop) => (Object.hasOwn(obj, prop));
988+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop));
989989
/******/
990990
/******/ /* webpack/runtime/make optimized deferred namespace object */
991991
/******/ __webpack_require__.zO = function(moduleId, mode, asyncDeps, syncDeps) {

‎test/configCases/side-effects/pure-deferred-import/__snapshots__/ConfigTest.snap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function extra(a) {
124124
/******/ };
125125
/******/
126126
/******/ /* webpack/runtime/hasOwnProperty shorthand */
127-
/******/ __webpack_require__.o = (obj, prop) => (Object.hasOwn(obj, prop));
127+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop));
128128
/******/
129129
/******/ /* webpack/runtime/make optimized deferred namespace object */
130130
/******/ __webpack_require__.zO = function(moduleId, mode, asyncDeps, syncDeps) {

‎test/configCases/side-effects/pure-deferred-import/webpack.config.js‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"use strict";
22

3-
const target = `async-node${process.versions.node.split(".").map(Number)[0]}`;
4-
53
/** @type {(name: string) => (compiler: import("../../../../types").Compiler) => void} */
64
const snapshotBundle = (name) => (compiler) => {
75
compiler.hooks.compilation.tap(
@@ -25,7 +23,6 @@ const snapshotBundle = (name) => (compiler) => {
2523
module.exports = [
2624
{
2725
name: "plain",
28-
target,
2926
mode: "production",
3027
experiments: { deferImport: true },
3128
optimization: {
@@ -36,7 +33,6 @@ module.exports = [
3633
},
3734
{
3835
name: "concatenated",
39-
target,
4036
mode: "production",
4137
experiments: { deferImport: true },
4238
// A CommonJS module cannot join the concatenation, so it stays an external

0 commit comments

Comments
 (0)