1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-30 16:40:57 -05:00

chore: update node_compat setup script, show remaining percentage (#27053)

This commit is contained in:
Yoshiya Hinosawa 2024-11-26 22:51:57 +09:00 committed by GitHub
parent 584631d281
commit 4f776a7d49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View file

@ -1,6 +1,8 @@
<!-- deno-fmt-ignore-file -->
# Remaining Node Tests
594 tests out of 3681 have been ported from Node 20.11.1 (16.14% ported, 83.97% remaining).
NOTE: This file should not be manually edited. Please edit `tests/node_compat/config.json` and run `deno task setup` in `tests/node_compat/runner` dir instead.
- [abort/test-abort-backtrace.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-abort-backtrace.js)

View file

@ -74,15 +74,24 @@ async function updateToDo() {
truncate: true,
});
const missingTests = withoutAll(await getNodeTests(), await getDenoTests());
const nodeTests = await getNodeTests();
const portedTests = getDenoTests();
const remainingTests = withoutAll(nodeTests, portedTests);
const numPorted = portedTests.length;
const numMissing = remainingTests.length;
const numTotal = nodeTests.length;
const portedPercentage = (numPorted / numTotal * 100).toFixed(2);
const remainingPercentage = (numMissing / numTotal * 100).toFixed(2);
await file.write(encoder.encode(`<!-- deno-fmt-ignore-file -->
# Remaining Node Tests
${numPorted} tests out of ${numTotal} have been ported from Node ${NODE_VERSION} (${portedPercentage}% ported, ${remainingPercentage}% remaining).
NOTE: This file should not be manually edited. Please edit \`tests/node_compat/config.json\` and run \`deno task setup\` in \`tests/node_compat/runner\` dir instead.
`));
for (const test of missingTests) {
for (const test of remainingTests) {
await file.write(
encoder.encode(
`- [${test}](https://github.com/nodejs/node/tree/v${NODE_VERSION}/test/${test})\n`,