Skip to content

🎨 test: include expected result in error messages - #16039

Closed
keywordnew wants to merge 3 commits into
nodejs:masterfrom
keywordnew:code-and-learn-second-commit
Closed

🎨 test: include expected result in error messages#16039
keywordnew wants to merge 3 commits into
nodejs:masterfrom
keywordnew:code-and-learn-second-commit

Conversation

@keywordnew

@keywordnewkeywordnew commented Oct 6, 2017

Copy link
Copy Markdown
Contributor

The script being tested for is expected to be present only if the analytics id is provided. To improve user experience, the error message indicates whether the script is expected to be present or not.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

The script being tested for is expected to be present only if the analytics id is provided. To improve user experience, the error message indicates whether the script is expected to be present or not.
@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. labels Oct 6, 2017
Comment threadtest/doctool/test-doctool-html.js Outdated
assert(actual.includes('google-analytics.com'),
'Google Analytics script was not present');
assert(actual.includes(scriptDomain),
'Google Analytics script was not present, but it should be');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The idea here is to include the actual value and not only to change the message.
So it should actually be like

assert(actual.includes(scriptDomain),`Google Analytics script was not present in "${actual}"`);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@chowdhurian could you push a commit to this branch that makes the change @BridgeAR suggested? LGTM with those changes.

@TrottTrott added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Oct 6, 2017
Remove expected result from error message and include actual result for clarity and easier debugging.
@gibfahn

Copy link
Copy Markdown
Member

@gibfahn

Copy link
Copy Markdown
Member

Linter failed

notok30-/usr/home/iojs/build/workspace/node-test-linter/test/doctool/test-doctool-html.js---message: Missingsemicolon.severity: error
data:
line: 118
column: 54
ruleId: semi
messages:
-message: Line130exceedsthemaximumlinelengthof80.
severity: error
data:
line: 130
column: 1ruleId: max-len...

Linter errored for missing semi colon and line length.
@refack

Copy link
Copy Markdown
Contributor

Rerun linter: https://ci.nodejs.org/job/node-test-linter/12334/ ✔️

@BridgeARBridgeAR self-assigned this Oct 9, 2017
@BridgeAR

Copy link
Copy Markdown
Member

Landed in 6a9fd06

Thanks for the PR, and congratulations on becoming a Node.js Contributor 🎉 !

@BridgeARBridgeAR closed this Oct 9, 2017
BridgeAR pushed a commit that referenced this pull request Oct 9, 2017
PR-URL: #16039
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request Oct 11, 2017
PR-URL: #16039
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@MylesBorinsMylesBorins mentioned this pull request Oct 11, 2017
addaleax pushed a commit to addaleax/ayo that referenced this pull request Oct 12, 2017
PR-URL: nodejs/node#16039
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request Oct 17, 2017
PR-URL: #16039
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@MylesBorinsMylesBorins mentioned this pull request Oct 17, 2017
MylesBorins pushed a commit that referenced this pull request Oct 18, 2017
PR-URL: #16039
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request Oct 25, 2017
PR-URL: #16039
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@MylesBorinsMylesBorins mentioned this pull request Nov 3, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-and-learnIssues related to the Code-and-Learn events and PRs submitted during the events.docIssues and PRs related to the documentations.testIssues and PRs related to the tests.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@keywordnew@gibfahn@refack@BridgeAR@tniessen@hiroppy@MylesBorins@Trott@nodejs-github-bot