Uh oh!
There was an error while loading. Please reload this page.
Test doctool - #6031
Conversation
MylesBorins
commented
Apr 4, 2016
Should these tests be including in the Are we going to want to run these in ci? /cc @nodejs/build |
iankronquist
commented
Apr 4, 2016
@thealphanerd I put them there because tools/doc is its own independent package which could be distributed separately from node code. |
There was a problem hiding this comment.
Any reason not to use assert.equal(output.source, 'foo'), assert.deepStrictEqual(output, item.json)?
There was a problem hiding this comment.
Because I didn't know those existed. Let me fix that.
931ff1d to
f240d02Comparestevemao
commented
Apr 4, 2016
Should definitely run in ci.
I think these tests should be in docs/ |
Trott
commented
Apr 4, 2016
This PR adds |
Trott
commented
Apr 4, 2016
Yes. Tests should go in the As far as where in the |
Trott
commented
Apr 4, 2016
I see the logic there and wouldn't stand in the way if others agreed. I look at it this way, though: All tests for the project are in the |
Trott
commented
Apr 4, 2016
CI runs the |
Trott
commented
Apr 4, 2016
Another argument for adding these to the project-wide EDIT: Putting them in |
Trott
commented
Apr 4, 2016
Last comment for now, I promise, sorry for the storm of notifications: YES YES YES! +100 to having some tests for the doc tools. |
iankronquist
commented
Apr 4, 2016
@Trott I don't have access to a windows system. I could put some code in vcbuild.bat and hope that it works if you'd like. |
Trott
commented
Apr 4, 2016
One more benefit to putting these tests in |
iankronquist
commented
Apr 4, 2016
@Trott here's a version with the tests living under |
Trott
commented
Apr 4, 2016
💯 😍 👍 |
Trott
commented
Apr 4, 2016
@thealphanerd@jasnell I'm adding the |
| @@ -0,0 +1,50 @@ | |||
| 'use strict'; | |||
| var assert = require('assert'); | |||
There was a problem hiding this comment.
Nit (which means you can ignore this comment if you want to): The project has been favoring const over var for module imports like this.
Knighton910
commented
Apr 4, 2016
👍 |
eljefedelrodeodeljefe
commented
Apr 4, 2016
I think that is pretty much what @silverwind intended. Good stuff. |
| }); | ||
| } | ||
| test_toHTML(); |
There was a problem hiding this comment.
Can we not wrap this in a function. With this being the only thing in the file, it's a bit redundant.
evanlucas
commented
Apr 4, 2016
Thanks for the contribution! I'm with @Trott. Please make every variable I would prefer that we keep these in the |
| // Test data is a list of objects with two properties. | ||
| // The file property is the file path. | ||
| // The html property is some html which will be generated by the doctool. | ||
| // This html will be stripped of all whitespace. |
There was a problem hiding this comment.
Maybe change the comment to state that it will be stripped of all unnecessary whitespace?
Edit: disregard. I just realized why you were doing that. Maybe update the comment to be more clear?
iankronquist
commented
Apr 21, 2016
Looks like CI passed. |
7da4fd4 to
c7066fbCompareiankronquist
commented
Apr 28, 2016
@silverwind Is there anyone else I need to get to take a look at this? |
There was a problem hiding this comment.
shouldn't common.mustCall... be aligned with input?
silverwind
commented
Apr 28, 2016
@iankronquist after you've handled above comments, I suggest you squash the commits into a single one and add a nice summary of the changes in the commit message. |
Addresses nodejs#5955 on GitHub. * Test the toHTML function in html.js. Check that given valid markdown it produces the expected html. One test case will prevent regressions of big nodejs#5873. * Check that when given valid markdown toJSON produces valid JSON with the expected schema. * Add doctool to the list of built in tests so it runs in CI.
iankronquist
commented
Apr 28, 2016
@silverwind fixed & squashed. |
* Test the toHTML function in html.js. Check that given valid markdown it produces the expected html. One test case will prevent regressions of #5873. * Check that when given valid markdown toJSON produces valid JSON with the expected schema. * Add doctool to the list of built in tests so it runs in CI. PR-URL: #6031Fixes: #5955 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Rich Trott <rtrott@gmail.com>
silverwind
commented
Apr 28, 2016
Thanks! Landed in 2e845f8 with some minor corrections to the commit message. Nice work! |
eljefedelrodeodeljefe
commented
Apr 28, 2016
Yes, really nice. Thx for the effort. Time to try it myself :) Awesome guys. |
iankronquist
commented
Apr 29, 2016
@silverwind excellent, thanks! |
* Test the toHTML function in html.js. Check that given valid markdown it produces the expected html. One test case will prevent regressions of #5873. * Check that when given valid markdown toJSON produces valid JSON with the expected schema. * Add doctool to the list of built in tests so it runs in CI. PR-URL: #6031Fixes: #5955 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins
commented
May 17, 2016
if someone would like to see this landed it will need to be manually backported |
iankronquist
commented
May 18, 2016
@thealphanerd didn't this land in 2e845f8? Do you mean landed in the next release? |
MylesBorins
commented
May 18, 2016
Sorry for not being exact... I was referring to lts |
* Test the toHTML function in html.js. Check that given valid markdown it produces the expected html. One test case will prevent regressions of #5873. * Check that when given valid markdown toJSON produces valid JSON with the expected schema. * Add doctool to the list of built in tests so it runs in CI. PR-URL: #6031Fixes: #5955 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Rich Trott <rtrott@gmail.com>
* Test the toHTML function in html.js. Check that given valid markdown it produces the expected html. One test case will prevent regressions of #5873. * Check that when given valid markdown toJSON produces valid JSON with the expected schema. * Add doctool to the list of built in tests so it runs in CI. PR-URL: #6031Fixes: #5955 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Rich Trott <rtrott@gmail.com>
* Test the toHTML function in html.js. Check that given valid markdown it produces the expected html. One test case will prevent regressions of #5873. * Check that when given valid markdown toJSON produces valid JSON with the expected schema. * Add doctool to the list of built in tests so it runs in CI. PR-URL: #6031Fixes: #5955 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Rich Trott <rtrott@gmail.com>
Pull Request check-list
make -j8 test(UNIX) orvcbuild test nosign(Windows) pass withthis change (including linting)?
test (or a benchmark) included?
existing APIs, or introduces new ones)? (N/A)
Affected core subsystem(s)
tools/doc
Description of change
Add tests for tools/doc. Fixes#5955. Includes tests for the functions toHTML (in html.js) and doJSON (in json.js). Also includes a regression test for #5873. Also introduces a new make target to run the tests.
I expect to be asked to squash these commits.