Skip to content

Commit 188d13d

Browse files
committed
update
1 parent 82133f9 commit 188d13d

1 file changed

Lines changed: 168 additions & 0 deletions

File tree

test/__snapshots__/ConfigCacheTestCases.basictest.js.snap

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,102 @@
11
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

3+
exports[`ConfigCacheTestCases chunks-order cjs exported tests The dependOn chunk must be loaded before the common chunk. 1`] = `
4+
"\\"use strict\\";
5+
(() => {
6+
var exports = {};
7+
exports.id = \\"foo\\";
8+
exports.ids = [\\"foo\\"];
9+
exports.modules = {
10+
11+
/***/ 552
12+
/*!****************************!*\\\\
13+
!*** ./foo.js + 2 modules ***!
14+
\\\\****************************/
15+
(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
16+
17+
18+
;// external \\"fs\\"
19+
const external_fs_namespaceObject = require(\\"fs\\");
20+
var external_fs_default = /*#__PURE__*/__webpack_require__.n(external_fs_namespaceObject);
21+
// EXTERNAL MODULE: ./dependency.js
22+
var dependency = __webpack_require__(784);
23+
;// ./foo.js
24+
25+
26+
27+
28+
it(\\"The dependOn chunk must be loaded before the common chunk.\\", () => {
29+
const source = external_fs_default().readFileSync(__filename, \\"utf-8\\");
30+
31+
expect(source).toMatchSnapshot();
32+
});
33+
34+
/***/ }
35+
36+
};
37+
;
38+
39+
// load runtime
40+
var __webpack_require__ = require(\\"./runtime~nested-shared.js\\");
41+
__webpack_require__.C(exports);
42+
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
43+
var __webpack_exports__ = __webpack_require__.X(0, [\\"shared\\",\\"nested-shared\\",\\"commons-dependency_js\\"], () => (__webpack_exec__(552)));
44+
var __webpack_export_target__ = exports;
45+
for(var __webpack_i__ in __webpack_exports__) __webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
46+
if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, \\"__esModule\\", { value: true });
47+
48+
})();
49+
//# sourceMappingURL=foo.js.map"
50+
`;
51+
52+
exports[`ConfigCacheTestCases chunks-order module exported tests The dependOn chunk must be loaded before the common chunk. 1`] = `
53+
"import {fileURLToPath as __webpack_fileURLToPath__} from \\"node:url\\";
54+
var __webpack_filename__ = __webpack_fileURLToPath__(import.meta.url);
55+
export const __webpack_esm_id__ = \\"foo\\";
56+
export const __webpack_esm_ids__ = [\\"foo\\"];
57+
export const __webpack_esm_modules__ = {
58+
59+
/***/ 353
60+
/*!****************!*\\\\
61+
!*** ./foo.js ***!
62+
\\\\****************/
63+
(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
64+
65+
/* harmony import */ var _dependency_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dependency.js */ 784);
66+
/* harmony import */ var _dependency_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dependency_js__WEBPACK_IMPORTED_MODULE_0__);
67+
68+
69+
70+
it(\\"The dependOn chunk must be loaded before the common chunk.\\", async () => {
71+
const fs = await eval(\`import(\\"fs\\")\`)
72+
const source = fs.readFileSync(__webpack_filename__, \\"utf-8\\");
73+
74+
expect(source).toMatchSnapshot();
75+
});
76+
77+
78+
/***/ }
79+
80+
};
81+
;
82+
83+
// load runtime
84+
import { __webpack_require__ } from \\"./runtime~nested-shared.mjs\\";
85+
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
86+
87+
import * as __webpack_chunk_1__ from \\"./shared.mjs\\";
88+
__webpack_require__.C(__webpack_chunk_1__);
89+
import * as __webpack_chunk_2__ from \\"./nested-shared.mjs\\";
90+
__webpack_require__.C(__webpack_chunk_2__);
91+
import * as __webpack_chunk_3__ from \\"./commons-dependency_js.mjs\\";
92+
__webpack_require__.C(__webpack_chunk_3__);
93+
import * as __webpack_chunk_4__ from \\"./foo.mjs\\";
94+
__webpack_require__.C(__webpack_chunk_4__);
95+
var __webpack_exports__ = __webpack_exec__(353);
96+
97+
//# sourceMappingURL=foo.mjs.map"
98+
`;
99+
3100
exports[`ConfigCacheTestCases css build-http exported tests should work with URLs in CSS 1`] = `
4101
Array [
5102
"/*!*******************************************************************************************************************!*\\\\
@@ -26358,3 +26455,74 @@ __WEBPACK_EXTERNAL_MODULE_externals1_v__;
2635826455
/******/
2635926456
"
2636026457
`;
26458+
26459+
exports[`ConfigCacheTestCases module import-meta-env exported tests import.meta.env behaves like process.env 1`] = `
26460+
"import {fileURLToPath as __webpack_fileURLToPath__} from \\"url\\";
26461+
var __webpack_filename__ = __webpack_fileURLToPath__(import.meta.url);
26462+
/*!******************!*\\\\
26463+
!*** ./index.js ***!
26464+
\\\\******************/
26465+
it(\\"should work import.meta.env with EnvironmentPlugin\\", () => {
26466+
expect(\\"aaa\\").toBe(\\"aaa\\");
26467+
});
26468+
26469+
it(\\"should work import.meta.env with DotenvPlugin\\", () => {
26470+
expect(\\"https://api.example.com\\").toBe(\\"https://api.example.com\\");
26471+
});
26472+
26473+
it(\\"import.meta.env behaves like process.env\\", async (done) => {
26474+
try {
26475+
const importMetaEnv = {\\"AAA\\":\\"aaa\\",\\"WEBPACK_API_URL\\":\\"https://api.example.com\\",\\"NODE_ENV\\":\\"production\\"};
26476+
importMetaEnv;
26477+
const processEnv = process.env;
26478+
processEnv;
26479+
const UNKNOWN_PROPERTY = undefined;
26480+
UNKNOWN_PROPERTY;
26481+
const UNKNOWN_PROPERTY_2 = process.env.UNKNOWN_PROPERTY_2;
26482+
UNKNOWN_PROPERTY_2;
26483+
\\"object\\";
26484+
typeof process.env;
26485+
26486+
const { env } = ({env: {\\"AAA\\":\\"aaa\\",\\"WEBPACK_API_URL\\":\\"https://api.example.com\\",\\"NODE_ENV\\":\\"production\\"},});
26487+
env;
26488+
} catch (_e) {
26489+
// ignore
26490+
}
26491+
const fs = await eval(\\"import('fs')\\");
26492+
expect(fs.readFileSync(__webpack_filename__, \\"utf-8\\")).toMatchSnapshot();
26493+
done();
26494+
});
26495+
"
26496+
`;
26497+
26498+
exports[`ConfigCacheTestCases source-map extract-source-map-css exported tests should compile 1`] = `
26499+
Array [
26500+
"/*!*********************!*\\\\
26501+
!*** css ./app.css ***!
26502+
\\\\*********************/
26503+
* {
26504+
box-sizing: border-box; }
26505+
26506+
.row {
26507+
display: flex;
26508+
margin-right: -15px;
26509+
margin-left: -15px; }
26510+
26511+
.col-inner {
26512+
display: flex;
26513+
align-items: center;
26514+
justify-content: center;
26515+
color: #fff;
26516+
height: 50px;
26517+
background: coral; }
26518+
26519+
.col-s3 {
26520+
flex: 0 1 25%;
26521+
padding: 0 15px; }
26522+
26523+
26524+
26525+
26526+
/*# sourceMappingURL=bundle0.css.map*/",
26527+
]
26528+
`;

0 commit comments

Comments
 (0)