Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fixed Node.js expected messages #6266

Merged
merged 3 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: remove the "node-version" logic
  • Loading branch information
Farfurix committed May 31, 2021
commit a12a9e47e4c22d2455a3accf401215b441cae8e8
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
"moment-duration-format-commonjs": "^1.0.0",
"mustache": "^2.1.2",
"nanoid": "^1.0.1",
"node-version": "^1.0.0",
"os-family": "^1.0.0",
"parse5": "^1.5.0",
"pify": "^2.3.0",
Expand Down
10 changes: 4 additions & 6 deletions test/functional/fixtures/api/es-next/generic-errors/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('[API] Generic errors', function () {

describe('External assertion library error', function () {
it('Should handle Node built-in assertion lib error', function () {
const NODE_12_ASSERTION_MESSAGE = [
const NODE_12_ASSERTION_MESSAGE_PARTS = [
'AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:',
'\'answer\' !== \'42\''
];
Expand All @@ -68,11 +68,9 @@ describe('[API] Generic errors', function () {
.catch(function (errs) {
expect(errs[0]).to.contains('> 13 | assert.strictEqual(\'answer\', \'42\');');

if (nodeVersion.major >= 12) {
NODE_12_ASSERTION_MESSAGE.forEach((item) => {
expect(errs[0]).to.contain(item);
});
}
NODE_12_ASSERTION_MESSAGE_PARTS.forEach((item) => {
expect(errs[0]).to.contain(item);
});
});
});

Expand Down