diff --git a/package-lock.json b/package-lock.json index a170aff..308e4c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "monocart-coverage-reports", - "version": "2.10.2", + "version": "2.10.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "monocart-coverage-reports", - "version": "2.10.2", + "version": "2.10.3", "license": "MIT", "workspaces": [ "test" @@ -3531,13 +3531,13 @@ } }, "node_modules/@puppeteer/browsers": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.3.0.tgz", - "integrity": "sha512-ioXoq9gPxkss4MYhD+SFaU9p1IHFUX0ILAWFPyjGaBdjLsYAlZw6j1iLA0N/m12uVHLFDfSYNF7EQccjinIMDA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.3.1.tgz", + "integrity": "sha512-uK7o3hHkK+naEobMSJ+2ySYyXtQkBxIH8Gn4MK9ciePjNV+Pf+PgY/W7iPzn2MTjl3stcYB5AlcTmPYw7AXDwA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "debug": "^4.3.5", + "debug": "^4.3.6", "extract-zip": "^2.0.1", "progress": "^2.0.3", "proxy-agent": "^6.4.0", @@ -11610,18 +11610,19 @@ } }, "node_modules/puppeteer": { - "version": "23.0.2", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.0.2.tgz", - "integrity": "sha512-I/l1P8s8brcLG+oW9AwF8hUaOSGGJcGKMflXRgULUH0S3ABptlLI9ZKjqWDo8ipY6v789ZKd+bNKtcCwpTh5Ww==", + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.1.0.tgz", + "integrity": "sha512-m+CyicDlGN1AVUeOsCa6/+KQydJzxfsPowL7fQy+VGNeaWafB0m8G5aGfXdfZztKMxzCsdz7KNNzbJPeG9wwFw==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@puppeteer/browsers": "2.3.0", + "@puppeteer/browsers": "2.3.1", "chromium-bidi": "0.6.4", "cosmiconfig": "^9.0.0", "devtools-protocol": "0.0.1312386", - "puppeteer-core": "23.0.2" + "puppeteer-core": "23.1.0", + "typed-query-selector": "^2.12.0" }, "bin": { "puppeteer": "lib/cjs/puppeteer/node/cli.js" @@ -11631,16 +11632,17 @@ } }, "node_modules/puppeteer-core": { - "version": "23.0.2", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.0.2.tgz", - "integrity": "sha512-MvOHn+g1TYkAR2oVd/bf/YWXKqFTJmkhyyurYgxkrjh8rBOL1ZH5VyOsLJi0bLO7/yoipAmk1gFZEx9HUJnaoA==", + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.1.0.tgz", + "integrity": "sha512-SvAsu+xnLN2FMXE/59bp3s3WXp8ewqUGzVV4AQtml/2xmsciZnU/bXcCW+eETHPWQ6Agg2vTI7QzWXPpEARK2g==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@puppeteer/browsers": "2.3.0", + "@puppeteer/browsers": "2.3.1", "chromium-bidi": "0.6.4", "debug": "^4.3.6", "devtools-protocol": "0.0.1312386", + "typed-query-selector": "^2.12.0", "ws": "^8.18.0" }, "engines": { @@ -13581,6 +13583,13 @@ "node": ">= 0.6" } }, + "node_modules/typed-query-selector": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.12.0.tgz", + "integrity": "sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==", + "dev": true, + "license": "MIT" + }, "node_modules/typescript": { "version": "5.5.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", @@ -14502,7 +14511,7 @@ "mocha": "^10.7.3", "open": "^10.1.0", "playwright": "^1.46.0", - "puppeteer": "^23.0.2", + "puppeteer": "^23.1.0", "rollup": "^4.20.0", "swc-loader": "^0.2.6", "ts-loader": "^9.5.1", diff --git a/test/mock/src/branch/branch.js b/test/mock/src/branch/branch.js index 6894ee1..c353daf 100644 --- a/test/mock/src/branch/branch.js +++ b/test/mock/src/branch/branch.js @@ -6,6 +6,7 @@ const IfStatement = require('./if.js'); const LogicalExpression = require('./logical.js'); const SwitchStatement = require('./switch.js'); const SwitchStatementNoBreak = require('./switch-no-break.js'); +const OptionalChaining = require('./optional-chaining.js'); const uncoveredFunction = (a) => { const list = [1, 2, 3, 4, 5]; @@ -154,6 +155,7 @@ const branch = (a) => { LogicalExpression(); SwitchStatement(); SwitchStatementNoBreak(); + OptionalChaining(); }; module.exports = { diff --git a/test/mock/src/branch/optional-chaining.js b/test/mock/src/branch/optional-chaining.js new file mode 100644 index 0000000..6076feb --- /dev/null +++ b/test/mock/src/branch/optional-chaining.js @@ -0,0 +1,34 @@ +/** + * Currently, The `Optional chaining` will be counted as: + * ✅ bytes coverage + * ✅ lines coverage + * ❌ not branches coverage + */ + +const adventurer = { + name: 'Alice', + cat: { + name: 'Dinah' + } +}; + +// obj.val?.prop +// obj.val?.[expr] +// obj.func?.(args) + +function OptionalChaining() { + + console.log(adventurer.cat?.name); + + // Expected output: undefined + console.log(adventurer.dog?.name); + + // Expected output: undefined + console.log(adventurer.someNonExistentMethod?.()); + + console.log(adventurer.cat?.first?.second); +} + +module.exports = () => { + OptionalChaining(); +}; diff --git a/test/package.json b/test/package.json index 666d21f..444be31 100644 --- a/test/package.json +++ b/test/package.json @@ -21,7 +21,7 @@ "mocha": "^10.7.3", "open": "^10.1.0", "playwright": "^1.46.0", - "puppeteer": "^23.0.2", + "puppeteer": "^23.1.0", "rollup": "^4.20.0", "swc-loader": "^0.2.6", "ts-loader": "^9.5.1", diff --git a/test/snapshot/cli.snapshot.json b/test/snapshot/cli.snapshot.json index 23d1489..b90555c 100644 --- a/test/snapshot/cli.snapshot.json +++ b/test/snapshot/cli.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "53.59 %", - "statements": "56.61 %", + "bytes": "54.97 %", + "statements": "57.37 %", "branches": "52.42 %", - "functions": "50.54 %", - "lines": "45.58 %" + "functions": "51.58 %", + "lines": "46.29 %" }, "files": { "test/mock/node/lib/app.js": { @@ -65,11 +65,11 @@ "test/mock/src/branch/branch.js": { "functions": "70.00 %", "branches": "65.85 %", - "statements": "85.14 %", - "lines": "74.34 %", - "bytes": "81.49 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "85.53 %", + "lines": "74.78 %", + "bytes": "81.98 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "test/mock/src/branch/conditional.js": { "functions": "100.00 %", @@ -98,6 +98,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "test/mock/src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "24-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "test/mock/src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %", diff --git a/test/snapshot/esbuild.snapshot.json b/test/snapshot/esbuild.snapshot.json index 880c8aa..7ba7432 100644 --- a/test/snapshot/esbuild.snapshot.json +++ b/test/snapshot/esbuild.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "82.76 %", - "statements": "83.73 %", + "bytes": "83.28 %", + "statements": "84.05 %", "branches": "60.08 %", - "functions": "84.16 %", - "lines": "72.48 %" + "functions": "84.62 %", + "lines": "72.70 %" }, "files": { "src/async.js": { @@ -29,11 +29,11 @@ "src/branch/branch.js": { "functions": "72.73 %", "branches": "65.85 %", - "statements": "86.08 %", - "lines": "74.34 %", - "bytes": "81.46 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "86.42 %", + "lines": "74.78 %", + "bytes": "81.95 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "src/branch/conditional.js": { "functions": "100.00 %", @@ -62,6 +62,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "24-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %", diff --git a/test/snapshot/istanbul.snapshot.json b/test/snapshot/istanbul.snapshot.json index ae63516..c696088 100644 --- a/test/snapshot/istanbul.snapshot.json +++ b/test/snapshot/istanbul.snapshot.json @@ -1,9 +1,9 @@ { "type": "istanbul", "summary": { - "lines": "82.54 %", - "statements": "82.46 %", - "functions": "77.38 %", + "lines": "82.85 %", + "statements": "82.76 %", + "functions": "77.90 %", "branches": "58.80 %" }, "files": { @@ -24,11 +24,11 @@ "extras": "" }, "branch/branch.js": { - "lines": "86.48 %", + "lines": "86.84 %", "functions": "70.00 %", - "statements": "86.84 %", + "statements": "87.17 %", "branches": "65.85 %", - "uncoveredLines": "11-18,59,82,120-121,138", + "uncoveredLines": "12-19,60,83,121-122,139", "extras": "" }, "branch/conditional.js": { @@ -55,6 +55,14 @@ "uncoveredLines": "", "extras": "" }, + "branch/optional-chaining.js": { + "lines": "100.00 %", + "functions": "100.00 %", + "statements": "100.00 %", + "branches": "100.00 %", + "uncoveredLines": "", + "extras": "" + }, "branch/switch-no-break.js": { "lines": "100.00 %", "functions": "100.00 %", diff --git a/test/snapshot/merge.snapshot.json b/test/snapshot/merge.snapshot.json index 0ac79b2..06d0bc5 100644 --- a/test/snapshot/merge.snapshot.json +++ b/test/snapshot/merge.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "75.97 %", - "statements": "78.39 %", + "bytes": "76.57 %", + "statements": "78.73 %", "branches": "60.13 %", - "functions": "72.90 %", - "lines": "65.58 %" + "functions": "73.39 %", + "lines": "65.87 %" }, "files": { "my-vm-filename.js": { @@ -83,11 +83,11 @@ "test/mock/src/branch/branch.js": { "functions": "70.00 %", "branches": "65.85 %", - "statements": "85.14 %", - "lines": "74.34 %", - "bytes": "81.49 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "85.53 %", + "lines": "74.78 %", + "bytes": "81.98 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "test/mock/src/branch/conditional.js": { "functions": "100.00 %", @@ -116,6 +116,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "test/mock/src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "24-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "test/mock/src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %", diff --git a/test/snapshot/node-api.snapshot.json b/test/snapshot/node-api.snapshot.json index d4bcbc1..8dfe069 100644 --- a/test/snapshot/node-api.snapshot.json +++ b/test/snapshot/node-api.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "83.86 %", - "statements": "84.58 %", + "bytes": "84.48 %", + "statements": "84.96 %", "branches": "60.94 %", - "functions": "88.89 %", - "lines": "71.53 %" + "functions": "89.29 %", + "lines": "71.85 %" }, "files": { "monocart-coverage-reports/test/mock/node/src/index.js": { @@ -29,11 +29,11 @@ "monocart-coverage-reports/test/mock/src/branch/branch.js": { "functions": "70.00 %", "branches": "65.85 %", - "statements": "85.14 %", - "lines": "74.34 %", - "bytes": "81.49 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "85.53 %", + "lines": "74.78 %", + "bytes": "81.98 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "monocart-coverage-reports/test/mock/src/branch/conditional.js": { "functions": "100.00 %", @@ -62,6 +62,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "monocart-coverage-reports/test/mock/src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "24-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "monocart-coverage-reports/test/mock/src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %", diff --git a/test/snapshot/node-cdp.snapshot.json b/test/snapshot/node-cdp.snapshot.json index d4bcbc1..8dfe069 100644 --- a/test/snapshot/node-cdp.snapshot.json +++ b/test/snapshot/node-cdp.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "83.86 %", - "statements": "84.58 %", + "bytes": "84.48 %", + "statements": "84.96 %", "branches": "60.94 %", - "functions": "88.89 %", - "lines": "71.53 %" + "functions": "89.29 %", + "lines": "71.85 %" }, "files": { "monocart-coverage-reports/test/mock/node/src/index.js": { @@ -29,11 +29,11 @@ "monocart-coverage-reports/test/mock/src/branch/branch.js": { "functions": "70.00 %", "branches": "65.85 %", - "statements": "85.14 %", - "lines": "74.34 %", - "bytes": "81.49 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "85.53 %", + "lines": "74.78 %", + "bytes": "81.98 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "monocart-coverage-reports/test/mock/src/branch/conditional.js": { "functions": "100.00 %", @@ -62,6 +62,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "monocart-coverage-reports/test/mock/src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "24-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "monocart-coverage-reports/test/mock/src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %", diff --git a/test/snapshot/node-env.snapshot.json b/test/snapshot/node-env.snapshot.json index d4bcbc1..8dfe069 100644 --- a/test/snapshot/node-env.snapshot.json +++ b/test/snapshot/node-env.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "83.86 %", - "statements": "84.58 %", + "bytes": "84.48 %", + "statements": "84.96 %", "branches": "60.94 %", - "functions": "88.89 %", - "lines": "71.53 %" + "functions": "89.29 %", + "lines": "71.85 %" }, "files": { "monocart-coverage-reports/test/mock/node/src/index.js": { @@ -29,11 +29,11 @@ "monocart-coverage-reports/test/mock/src/branch/branch.js": { "functions": "70.00 %", "branches": "65.85 %", - "statements": "85.14 %", - "lines": "74.34 %", - "bytes": "81.49 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "85.53 %", + "lines": "74.78 %", + "bytes": "81.98 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "monocart-coverage-reports/test/mock/src/branch/conditional.js": { "functions": "100.00 %", @@ -62,6 +62,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "monocart-coverage-reports/test/mock/src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "24-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "monocart-coverage-reports/test/mock/src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %", diff --git a/test/snapshot/node-fgc.snapshot.json b/test/snapshot/node-fgc.snapshot.json index d4bcbc1..8dfe069 100644 --- a/test/snapshot/node-fgc.snapshot.json +++ b/test/snapshot/node-fgc.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "83.86 %", - "statements": "84.58 %", + "bytes": "84.48 %", + "statements": "84.96 %", "branches": "60.94 %", - "functions": "88.89 %", - "lines": "71.53 %" + "functions": "89.29 %", + "lines": "71.85 %" }, "files": { "monocart-coverage-reports/test/mock/node/src/index.js": { @@ -29,11 +29,11 @@ "monocart-coverage-reports/test/mock/src/branch/branch.js": { "functions": "70.00 %", "branches": "65.85 %", - "statements": "85.14 %", - "lines": "74.34 %", - "bytes": "81.49 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "85.53 %", + "lines": "74.78 %", + "bytes": "81.98 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "monocart-coverage-reports/test/mock/src/branch/conditional.js": { "functions": "100.00 %", @@ -62,6 +62,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "monocart-coverage-reports/test/mock/src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "24-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "monocart-coverage-reports/test/mock/src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %", diff --git a/test/snapshot/node-ins.snapshot.json b/test/snapshot/node-ins.snapshot.json index d4bcbc1..8dfe069 100644 --- a/test/snapshot/node-ins.snapshot.json +++ b/test/snapshot/node-ins.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "83.86 %", - "statements": "84.58 %", + "bytes": "84.48 %", + "statements": "84.96 %", "branches": "60.94 %", - "functions": "88.89 %", - "lines": "71.53 %" + "functions": "89.29 %", + "lines": "71.85 %" }, "files": { "monocart-coverage-reports/test/mock/node/src/index.js": { @@ -29,11 +29,11 @@ "monocart-coverage-reports/test/mock/src/branch/branch.js": { "functions": "70.00 %", "branches": "65.85 %", - "statements": "85.14 %", - "lines": "74.34 %", - "bytes": "81.49 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "85.53 %", + "lines": "74.78 %", + "bytes": "81.98 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "monocart-coverage-reports/test/mock/src/branch/conditional.js": { "functions": "100.00 %", @@ -62,6 +62,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "monocart-coverage-reports/test/mock/src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "24-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "monocart-coverage-reports/test/mock/src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %", diff --git a/test/snapshot/puppeteer.snapshot.json b/test/snapshot/puppeteer.snapshot.json index 68d6e53..4e05f69 100644 --- a/test/snapshot/puppeteer.snapshot.json +++ b/test/snapshot/puppeteer.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "76.46 %", - "statements": "82.44 %", + "bytes": "77.13 %", + "statements": "82.77 %", "branches": "60.39 %", - "functions": "79.52 %", - "lines": "65.92 %" + "functions": "80.00 %", + "lines": "66.24 %" }, "files": { "test/mock/css/style.css": { @@ -38,11 +38,11 @@ "test/mock/src/branch/branch.js": { "functions": "70.00 %", "branches": "65.85 %", - "statements": "85.14 %", - "lines": "74.34 %", - "bytes": "81.49 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "85.53 %", + "lines": "74.78 %", + "bytes": "81.98 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "test/mock/src/branch/conditional.js": { "functions": "100.00 %", @@ -71,6 +71,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "test/mock/src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "24-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "test/mock/src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %", diff --git a/test/snapshot/rollup.snapshot.json b/test/snapshot/rollup.snapshot.json index a84269e..8316ade 100644 --- a/test/snapshot/rollup.snapshot.json +++ b/test/snapshot/rollup.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "82.76 %", - "statements": "82.46 %", + "bytes": "83.28 %", + "statements": "82.79 %", "branches": "60.08 %", - "functions": "80.25 %", - "lines": "72.48 %" + "functions": "80.72 %", + "lines": "72.70 %" }, "files": { "src/async.js": { @@ -29,11 +29,11 @@ "src/branch/branch.js": { "functions": "70.00 %", "branches": "65.85 %", - "statements": "85.14 %", - "lines": "74.34 %", - "bytes": "81.46 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "85.53 %", + "lines": "74.78 %", + "bytes": "81.95 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "src/branch/conditional.js": { "functions": "100.00 %", @@ -62,6 +62,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "24-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %", diff --git a/test/snapshot/swc.snapshot.json b/test/snapshot/swc.snapshot.json index 96aa1cc..67f0d35 100644 --- a/test/snapshot/swc.snapshot.json +++ b/test/snapshot/swc.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "82.76 %", - "statements": "83.05 %", - "branches": "60.08 %", - "functions": "80.49 %", - "lines": "72.48 %" + "bytes": "83.28 %", + "statements": "83.39 %", + "branches": "61.05 %", + "functions": "80.95 %", + "lines": "72.70 %" }, "files": { "src/async.js": { @@ -29,11 +29,11 @@ "src/branch/branch.js": { "functions": "70.00 %", "branches": "65.85 %", - "statements": "85.90 %", - "lines": "74.34 %", - "bytes": "81.46 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "86.25 %", + "lines": "74.78 %", + "bytes": "81.95 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "src/branch/conditional.js": { "functions": "100.00 %", @@ -62,6 +62,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "78.57 %", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "21,27-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %", diff --git a/test/snapshot/v8.snapshot.json b/test/snapshot/v8.snapshot.json index 68d6e53..4e05f69 100644 --- a/test/snapshot/v8.snapshot.json +++ b/test/snapshot/v8.snapshot.json @@ -1,11 +1,11 @@ { "type": "v8", "summary": { - "bytes": "76.46 %", - "statements": "82.44 %", + "bytes": "77.13 %", + "statements": "82.77 %", "branches": "60.39 %", - "functions": "79.52 %", - "lines": "65.92 %" + "functions": "80.00 %", + "lines": "66.24 %" }, "files": { "test/mock/css/style.css": { @@ -38,11 +38,11 @@ "test/mock/src/branch/branch.js": { "functions": "70.00 %", "branches": "65.85 %", - "statements": "85.14 %", - "lines": "74.34 %", - "bytes": "81.49 %", - "uncoveredLines": "10-20,28,57-60,74,81-83,108,119-124,136-139,144-146", - "extras": "1c,2b,9b,15b,17c,21b,26b,27c,30b,31c,35b,36c,37c,38c,39c,43b,45b,47b,56b,58c,61b,70b,72b,73c,76b,77c,85b,87b,98b,100b,105b,107c,111b,113b,115b,117b,118b,122c,125b,127b,134b,135b,137c,140b,141c,142c,150b,158b,162b" + "statements": "85.53 %", + "lines": "74.78 %", + "bytes": "81.98 %", + "uncoveredLines": "11-21,29,58-61,75,82-84,109,120-125,137-140,145-147", + "extras": "1c,2b,10b,16b,18c,22b,27b,28c,31b,32c,36b,37c,38c,39c,40c,44b,46b,48b,57b,59c,62b,71b,73b,74c,77b,78c,86b,88b,99b,101b,106b,108c,112b,114b,116b,118b,119b,123c,126b,128b,135b,136b,138c,141b,142c,143c,151b,160b,164b" }, "test/mock/src/branch/conditional.js": { "functions": "100.00 %", @@ -71,6 +71,15 @@ "uncoveredLines": "22-23,33-34,38,45,48-49,59-60", "extras": "1c,2b,4b,10b,15b,19b,25b,29b,36b,40b,47b,51b,58b,62b,65b,66b,68b,73b,75b" }, + "test/mock/src/branch/optional-chaining.js": { + "functions": "100.00 %", + "branches": "", + "statements": "100.00 %", + "lines": "80.00 %", + "bytes": "97.21 %", + "uncoveredLines": "24-29", + "extras": "1c,2c,3c,4c,5c,6c,7b,14b,15c,16c,17c,18b,20b,22b,23c,25b,26c,28b,31b,35b" + }, "test/mock/src/branch/switch-no-break.js": { "functions": "100.00 %", "branches": "100.00 %",