Skip to content

Commit 2d5728c

Browse files
test: update
1 parent 02cbbf4 commit 2d5728c

3 files changed

Lines changed: 63 additions & 15 deletions

File tree

test/Defaults.unittest.js

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,8 @@ describe("snapshots", () => {
22862286
+ ],
22872287
+ "test": /\\.wasm$/i,
22882288
+ "type": "webassembly/async",
2289-
@@ ... @@
2289+
+ },
2290+
+ Object {
22902291
+ "mimetype": "application/wasm",
22912292
+ "rules": Array [
22922293
+ Object {
@@ -2363,8 +2364,6 @@ describe("snapshots", () => {
23632364
+ "fullySpecified": true,
23642365
+ "preferRelative": true,
23652366
+ },
2366-
+ },
2367-
+ Object {
23682367
@@ ... @@
23692368
+ "css": Object {
23702369
+ "esModule": true,
@@ -2374,31 +2373,32 @@ describe("snapshots", () => {
23742373
+ "exportsConvention": "as-is",
23752374
+ "localIdentHashDigest": "base64url",
23762375
+ "localIdentHashDigestLength": 6,
2376+
+ "localIdentHashFunction": "xxhash64",
23772377
+ "localIdentHashSalt": undefined,
23782378
+ "localIdentName": "[fullhash]",
23792379
+ },
23802380
+ "css/global": Object {
23812381
+ "exportsConvention": "as-is",
23822382
+ "localIdentHashDigest": "base64url",
23832383
+ "localIdentHashDigestLength": 6,
2384+
+ "localIdentHashFunction": "xxhash64",
23842385
+ "localIdentHashSalt": undefined,
23852386
+ "localIdentName": "[fullhash]",
23862387
+ },
23872388
+ "css/module": Object {
23882389
+ "exportsConvention": "as-is",
23892390
+ "localIdentHashDigest": "base64url",
23902391
+ "localIdentHashDigestLength": 6,
2392+
+ "localIdentHashFunction": "xxhash64",
23912393
+ "localIdentHashSalt": undefined,
23922394
+ "localIdentName": "[fullhash]",
23932395
+ },
23942396
@@ ... @@
2395-
+ },
2396-
+ },
23972397
+ "css": Object {
23982398
+ "import": true,
23992399
+ "namedExports": true,
24002400
+ "url": true,
2401-
@@ ... @@
2401+
+ },
24022402
+ "css/auto": Object {
24032403
+ "animation": true,
24042404
+ "container": true,
@@ -2422,6 +2422,7 @@ describe("snapshots", () => {
24222422
+ "dashedIdents": true,
24232423
+ "function": true,
24242424
+ "grid": true,
2425+
+ },
24252426
@@ ... @@
24262427
+ "exportsPresence": "error",
24272428
@@ ... @@
@@ -2854,7 +2855,6 @@ describe("snapshots", () => {
28542855
- "futureDefaults": false,
28552856
+ "futureDefaults": true,
28562857
@@ ... @@
2857-
+ },
28582858
+ Object {
28592859
+ "rules": Array [
28602860
+ Object {
@@ -2872,7 +2872,7 @@ describe("snapshots", () => {
28722872
+ Object {
28732873
+ "mimetype": "application/wasm",
28742874
+ "rules": Array [
2875-
+ Object {
2875+
@@ ... @@
28762876
+ "descriptionData": Object {
28772877
+ "type": "module",
28782878
+ },
@@ -2946,6 +2946,8 @@ describe("snapshots", () => {
29462946
+ "fullySpecified": true,
29472947
+ "preferRelative": true,
29482948
+ },
2949+
+ },
2950+
+ Object {
29492951
@@ ... @@
29502952
+ "css": Object {
29512953
+ "esModule": true,
@@ -2955,26 +2957,27 @@ describe("snapshots", () => {
29552957
+ "exportsConvention": "as-is",
29562958
+ "localIdentHashDigest": "base64url",
29572959
+ "localIdentHashDigestLength": 6,
2960+
+ "localIdentHashFunction": "xxhash64",
29582961
+ "localIdentHashSalt": undefined,
29592962
+ "localIdentName": "[fullhash]",
29602963
+ },
29612964
+ "css/global": Object {
29622965
+ "exportsConvention": "as-is",
29632966
+ "localIdentHashDigest": "base64url",
29642967
+ "localIdentHashDigestLength": 6,
2968+
+ "localIdentHashFunction": "xxhash64",
29652969
+ "localIdentHashSalt": undefined,
29662970
+ "localIdentName": "[fullhash]",
29672971
+ },
29682972
+ "css/module": Object {
29692973
+ "exportsConvention": "as-is",
29702974
+ "localIdentHashDigest": "base64url",
29712975
+ "localIdentHashDigestLength": 6,
2976+
+ "localIdentHashFunction": "xxhash64",
29722977
+ "localIdentHashSalt": undefined,
29732978
+ "localIdentName": "[fullhash]",
29742979
+ },
29752980
@@ ... @@
2976-
+ },
2977-
+ },
29782981
+ "css": Object {
29792982
+ "import": true,
29802983
+ "namedExports": true,
@@ -2987,7 +2990,7 @@ describe("snapshots", () => {
29872990
+ "dashedIdents": true,
29882991
+ "function": true,
29892992
+ "grid": true,
2990-
@@ ... @@
2993+
+ },
29912994
+ "css/global": Object {
29922995
+ "animation": true,
29932996
+ "container": true,
@@ -3003,6 +3006,7 @@ describe("snapshots", () => {
30033006
+ "dashedIdents": true,
30043007
+ "function": true,
30053008
+ "grid": true,
3009+
+ },
30063010
@@ ... @@
30073011
+ "exportsPresence": "error",
30083012
@@ ... @@
@@ -3023,9 +3027,6 @@ describe("snapshots", () => {
30233027
+ "hashDigestLength": 16,
30243028
+ "hashFunction": "xxhash64",
30253029
@@ ... @@
3026-
+ "...",
3027-
+ ],
3028-
+ },
30293030
+ "css-import": Object {
30303031
+ "conditionNames": Array [
30313032
+ "webpack",
@@ -3069,9 +3070,11 @@ describe("snapshots", () => {
30693070
+ ],
30703071
+ "mainFields": Array [
30713072
+ "style",
3072-
@@ ... @@
3073+
+ "...",
3074+
+ ],
30733075
+ "mainFiles": Array [],
30743076
+ "preferRelative": true,
3077+
+ },
30753078
@@ ... @@
30763079
- "<cwd>/node_modules/",
30773080
+ /^(.+?[\\\\/]node_modules[\\\\/])/,

test/__snapshots__/Cli.basictest.js.snap

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,19 @@ Object {
16911691
"multiple": false,
16921692
"simpleType": "number",
16931693
},
1694+
"module-generator-css-auto-local-ident-hash-function": Object {
1695+
"configs": Array [
1696+
Object {
1697+
"description": "Algorithm used for generation the hash (see node.js crypto package).",
1698+
"multiple": false,
1699+
"path": "module.generator.css/auto.localIdentHashFunction",
1700+
"type": "string",
1701+
},
1702+
],
1703+
"description": "Algorithm used for generation the hash (see node.js crypto package).",
1704+
"multiple": false,
1705+
"simpleType": "string",
1706+
},
16941707
"module-generator-css-auto-local-ident-hash-salt": Object {
16951708
"configs": Array [
16961709
Object {
@@ -1834,6 +1847,19 @@ Object {
18341847
"multiple": false,
18351848
"simpleType": "number",
18361849
},
1850+
"module-generator-css-global-local-ident-hash-function": Object {
1851+
"configs": Array [
1852+
Object {
1853+
"description": "Algorithm used for generation the hash (see node.js crypto package).",
1854+
"multiple": false,
1855+
"path": "module.generator.css/global.localIdentHashFunction",
1856+
"type": "string",
1857+
},
1858+
],
1859+
"description": "Algorithm used for generation the hash (see node.js crypto package).",
1860+
"multiple": false,
1861+
"simpleType": "string",
1862+
},
18371863
"module-generator-css-global-local-ident-hash-salt": Object {
18381864
"configs": Array [
18391865
Object {
@@ -1951,6 +1977,19 @@ Object {
19511977
"multiple": false,
19521978
"simpleType": "number",
19531979
},
1980+
"module-generator-css-module-local-ident-hash-function": Object {
1981+
"configs": Array [
1982+
Object {
1983+
"description": "Algorithm used for generation the hash (see node.js crypto package).",
1984+
"multiple": false,
1985+
"path": "module.generator.css/module.localIdentHashFunction",
1986+
"type": "string",
1987+
},
1988+
],
1989+
"description": "Algorithm used for generation the hash (see node.js crypto package).",
1990+
"multiple": false,
1991+
"simpleType": "string",
1992+
},
19541993
"module-generator-css-module-local-ident-hash-salt": Object {
19551994
"configs": Array [
19561995
Object {

test/configCases/css/css-loader/webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
const path = require("path");
44

5+
/** @typedef {import("../../../../").PathData} PathData */
6+
57
/** @type {import("../../../../").Configuration} */
68
module.exports = {
79
target: "web",
@@ -80,6 +82,10 @@ module.exports = {
8082
test: /.css$/,
8183
resourceQuery: /\?local-ident-name-9$/,
8284
generator: {
85+
/**
86+
* @param {PathData} pathData path data
87+
* @returns {string} local ident name
88+
*/
8389
localIdentName: (pathData) =>
8490
`prefix-${pathData.filename}---${pathData.local}---${pathData.hash}-postfix`
8591
}

0 commit comments

Comments
 (0)