Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 15 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions napi/parser/test/parse-raw-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ async function runTsCase(

expect(oxcJson).toEqual(standardJson);

// Move `message` field to last in `ErrorLabel`s to match NAPI-RS, which puts optional fields last
for (const error of errors) {
for (const label of error.labels) {
if (hasOwn(label, "message")) {
const { message } = label;
delete label.message;
label.message = message;
}
}
}

const errorsRawJson = JSON.stringify(removeNullProperties(errors), null, 2);
const errorsStandardJson = JSON.stringify(errorsStandard, null, 2);
expect(errorsRawJson).toEqual(errorsStandardJson);
Expand Down
Loading
Loading