-
Notifications
You must be signed in to change notification settings - Fork 14
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
Run docs/test.html tests on Node.js #42
Conversation
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's more to this integration. For example, when I open a pull request, it should run the tests on the pull request. I'll look into this a little later.
} | ||
|
||
const resultTemplateGood = ' Success: checkPublicSuffix({{a}}, {{b}})'; | ||
const resultTemplateBad = '\u2757 Failure: got {{r}} instead: checkPublicSuffix({{a}}, {{b}})'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Showing "❗️" in case of failure.
checkAll(); | ||
console.log(); | ||
|
||
console.log(`Finished with ${errorCount} errors ${errorCount === 0 ? '\ud83c\udf89' : '\u2620\ufe0f'}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Showing "🎉" and "☠️" in the cases of success and failure respectively.
console.log(); | ||
|
||
if ( errorCount > 0 ) { | ||
process.exit(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-zero exit code in case of any failures.
} | ||
} | ||
|
||
// This function is a verbatim copy of the one in docs/test.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an exact copy of the code in docs/test.html
. It should be easy to keep them in sync. In the end I expect that this file will become redundant as we have better tests in tests/*.js
eventually.
This patch brings the tests in
docs/test.html
to Node.js.There's a
tests.yml
file that runs the tests on GitHub.README.md
includes a badge and brief development instructions.More in inline comments.