Skip to content

Conversation

AugustinMauroy
Copy link
Member

Description

use oxc-parser instead of acorn to have better perf

Validation

Test should pass

Related Issues

No related issues

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

Copy link

vercel bot commented Aug 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
api-docs-tooling Ready Ready Preview Aug 18, 2025 7:26am

Copy link

codecov bot commented Aug 18, 2025

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
186 6 180 0
View the top 3 failed test(s) by shortest run time
test::reverse.js
Stack Traces | 0.00409s run time
[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal:
�[32m+ actual�[39m �[31m- expected�[39m

�[32m+�[39m '\n{}\n'
�[31m-�[39m '\n' +
�[31m-�[39m   '{\n' +
�[31m-�[39m   '  "asserts": "lib/reverse.js#L8",\n' +
�[31m-�[39m   '  "asserts.ok": "lib/reverse.js#L5",\n' +
�[31m-�[39m   '  "asserts.strictEqual": "lib/reverse.js#L12"\n' +
�[31m-�[39m   '}\n'
] {
  code: 'ERR_TEST_FAILURE',
  failureType: 'testCodeFailure',
  cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  �[32m+ actual�[39m �[31m- expected�[39m
  
  �[32m+�[39m '\n{}\n'
  �[31m-�[39m '\n' +
  �[31m-�[39m   '{\n' +
  �[31m-�[39m   '  "asserts": "lib/reverse.js#L8",\n' +
  �[31m-�[39m   '  "asserts.ok": "lib/reverse.js#L5",\n' +
  �[31m-�[39m   '  "asserts.strictEqual": "lib/reverse.js#L12"\n' +
  �[31m-�[39m   '}\n'
  
      at TestContext.snapshotAssertion (node:internal/test_runner/snapshot:206:9)
      at assert.<computed> [as snapshot] (node:internal/test_runner/test:320:18)
      at TestContext.<anonymous> (file:.../api-links/__tests__/fixtures.test.mjs:31:18)
      at async Test.run (node:internal/test_runner/test:1054:7)
      at async Suite.processPendingSubtests (node:internal/test_runner/test:744:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: '\n{}\n',
    expected: '\n{\n  "asserts": "lib/reverse.js#L8",\n  "asserts.ok": "lib/reverse.js#L5",\n  "asserts.strictEqual": "lib/reverse.js#L12"\n}\n',
    operator: 'strictEqual'
  }
}
test::exports.js
Stack Traces | 0.00419s run time
[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal:
�[32m+ actual�[39m �[31m- expected�[39m

�[32m+�[39m '\n{}\n'
�[31m-�[39m '\n' +
�[31m-�[39m   '{\n' +
�[31m-�[39m   '  "exports.fn1": "lib/exports.js#L8",\n' +
�[31m-�[39m   '  "exports.fn2": "lib/exports.js#L10",\n' +
�[31m-�[39m   '  "exports.Buffer": "lib/exports.js#L5",\n' +
�[31m-�[39m   '  "exports.fn3": "lib/exports.js#L12"\n' +
�[31m-�[39m   '}\n'
] {
  code: 'ERR_TEST_FAILURE',
  failureType: 'testCodeFailure',
  cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  �[32m+ actual�[39m �[31m- expected�[39m
  
  �[32m+�[39m '\n{}\n'
  �[31m-�[39m '\n' +
  �[31m-�[39m   '{\n' +
  �[31m-�[39m   '  "exports.fn1": "lib/exports.js#L8",\n' +
  �[31m-�[39m   '  "exports.fn2": "lib/exports.js#L10",\n' +
  �[31m-�[39m   '  "exports.Buffer": "lib/exports.js#L5",\n' +
  �[31m-�[39m   '  "exports.fn3": "lib/exports.js#L12"\n' +
  �[31m-�[39m   '}\n'
  
      at TestContext.snapshotAssertion (node:internal/test_runner/snapshot:206:9)
      at assert.<computed> [as snapshot] (node:internal/test_runner/test:320:18)
      at TestContext.<anonymous> (file:.../api-links/__tests__/fixtures.test.mjs:31:18)
      at async Test.run (node:internal/test_runner/test:1054:7)
      at async Suite.processPendingSubtests (node:internal/test_runner/test:744:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: '\n{}\n',
    expected: '\n{\n  "exports.fn1": "lib/exports.js#L8",\n  "exports.fn2": "lib/exports.js#L10",\n  "exports.Buffer": "lib/exports.js#L5",\n  "exports.fn3": "lib/exports.js#L12"\n}\n',
    operator: 'strictEqual'
  }
}
test::mod.js
Stack Traces | 0.00453s run time
[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal:
�[32mactual�[39m �[31mexpected�[39m

�[39m'�[39m�[39m\�[39m�[39mn�[39m�[39m{�[39m�[31m\�[39m�[31mn�[39m�[31m �[39m�[31m �[39m�[31m"�[39m�[31mm�[39m�[31mo�[39m�[31md�[39m�[31m.�[39m�[31mf�[39m�[31mo�[39m�[31mo�[39m�[31m"�[39m�[31m:�[39m�[31m �[39m�[31m"�[39m�[31ml�[39m�[31mi�[39m�[31mb�[39m�[31m/�[39m�[31mm�[39m�[31mo�[39m�[31md�[39m�[31m.�[39m�[31mj�[39m�[31ms�[39m�[31m#�[39m�[31mL�[39m�[31m5�[39m�[31m"�[39m�[31m\�[39m�[31mn�[39m�[39m}�[39m�[39m\�[39m�[39mn�[39m�[39m'�[39m
] {
  code: 'ERR_TEST_FAILURE',
  failureType: 'testCodeFailure',
  cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  �[32mactual�[39m �[31mexpected�[39m
  
  �[39m'�[39m�[39m\�[39m�[39mn�[39m�[39m{�[39m�[31m\�[39m�[31mn�[39m�[31m �[39m�[31m �[39m�[31m"�[39m�[31mm�[39m�[31mo�[39m�[31md�[39m�[31m.�[39m�[31mf�[39m�[31mo�[39m�[31mo�[39m�[31m"�[39m�[31m:�[39m�[31m �[39m�[31m"�[39m�[31ml�[39m�[31mi�[39m�[31mb�[39m�[31m/�[39m�[31mm�[39m�[31mo�[39m�[31md�[39m�[31m.�[39m�[31mj�[39m�[31ms�[39m�[31m#�[39m�[31mL�[39m�[31m5�[39m�[31m"�[39m�[31m\�[39m�[31mn�[39m�[39m}�[39m�[39m\�[39m�[39mn�[39m�[39m'�[39m
  
      at TestContext.snapshotAssertion (node:internal/test_runner/snapshot:206:9)
      at assert.<computed> [as snapshot] (node:internal/test_runner/test:320:18)
      at TestContext.<anonymous> (file:.../api-links/__tests__/fixtures.test.mjs:31:18)
      at async Test.run (node:internal/test_runner/test:1054:7)
      at async Suite.processPendingSubtests (node:internal/test_runner/test:744:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: '\n{}\n',
    expected: '\n{\n  "mod.foo": "lib/mod.js#L5"\n}\n',
    operator: 'strictEqual'
  }
}

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@AugustinMauroy
Copy link
Member Author

Okay loc property isn't supported now by oxc-parser ...

Comment on lines +28 to +33
{
range: false,
lang: 'js',
astType: 'js',
sourceType: 'script',
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{
range: false,
lang: 'js',
astType: 'js',
sourceType: 'script',
}

These are all the default

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

humm yeah right. but range will need to be used since loc isn't available.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.start and .end exist on all nodes, regardless of range setting, does Github support that syntax (over L?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.start and .end exist on all nodes, regardless of range setting

Good to know

does Github support that syntax (over L?)

any idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants