Skip to content

Commit

Permalink
esm: fix import assertion warning
Browse files Browse the repository at this point in the history
Refs: #46901 (comment)
PR-URL: #46971
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
aduh95 authored and danielleadams committed Apr 11, 2023
1 parent f8d4bf8 commit 5b94e2b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/internal/modules/esm/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ function validateAssertions(url, format,
if (!alreadyWarned && ObjectKeys(importAssertions).length !== 0) {
alreadyWarned = true;
process.emitWarning(
'Import assertions are not a stable feature of the JavaScript language, ' +
'avoid relying on their current behavior and syntax as those might change ' +
'Import assertions are not a stable feature of the JavaScript language. ' +
'Avoid relying on their current behavior and syntax as those might change ' +
'in a future version of Node.js.',
'ExperimentalWarning',
);
Expand Down
4 changes: 2 additions & 2 deletions test/es-module/test-esm-import-assertion-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const jsonModuleDataUrl = 'data:application/json,""';

common.expectWarning(
'ExperimentalWarning',
'Import assertions are not a stable feature of the JavaScript language, ' +
'avoid relying on their current behavior and syntax as those might change ' +
'Import assertions are not a stable feature of the JavaScript language. ' +
'Avoid relying on their current behavior and syntax as those might change ' +
'in a future version of Node.js.'
);

Expand Down
4 changes: 2 additions & 2 deletions test/es-module/test-esm-import-assertion-errors.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const jsonModuleDataUrl = 'data:application/json,""';

expectWarning(
'ExperimentalWarning',
'Import assertions are not a stable feature of the JavaScript language, ' +
'avoid relying on their current behavior and syntax as those might change ' +
'Import assertions are not a stable feature of the JavaScript language. ' +
'Avoid relying on their current behavior and syntax as those might change ' +
'in a future version of Node.js.'
);

Expand Down
4 changes: 2 additions & 2 deletions test/es-module/test-esm-import-assertion-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const { validateAssertions } = require('internal/modules/esm/assert');

common.expectWarning(
'ExperimentalWarning',
'Import assertions are not a stable feature of the JavaScript language, ' +
'avoid relying on their current behavior and syntax as those might change ' +
'Import assertions are not a stable feature of the JavaScript language. ' +
'Avoid relying on their current behavior and syntax as those might change ' +
'in a future version of Node.js.'
);

Expand Down
4 changes: 2 additions & 2 deletions test/es-module/test-esm-import-assertion-warning.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { expectWarning } from '../common/index.mjs';

expectWarning(
'ExperimentalWarning',
'Import assertions are not a stable feature of the JavaScript language, ' +
'avoid relying on their current behavior and syntax as those might change ' +
'Import assertions are not a stable feature of the JavaScript language. ' +
'Avoid relying on their current behavior and syntax as those might change ' +
'in a future version of Node.js.'
);

Expand Down

0 comments on commit 5b94e2b

Please sign in to comment.