-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add testing guideline #109
base: master
Are you sure you want to change the base?
Conversation
I support this PR because of users convenience. |
@ryoichi-obara Yes, the discussion has been finished. Currently, it is under review in this pull request. |
├── test-node.js | ||
├── test-node.html | ||
├── package.json | ||
└── test |
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.
I must admit we don't currently do this for most nodes - This is sensible.
(If this is done correctly can we then add a line to run the test via npm in the package.json? or does that then require we have all the deps in every node (inc node-red...?))
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 is a general discussion over whether a module should include its test material when published to npm. In the wider node community it is a similar discussion to tabs vs spaces - ie, no clear winner and a lot of energy spent not coming to agreement.
docs/creating-nodes/testing.md
Outdated
| 2 | Should.js | Assertion | [https://shouldjs.github.io](https://shouldjs.github.io/) | | ||
| 3 | Sinon.js | Test double | [http://sinonjs.org](http://sinonjs.org/) | | ||
| 4 | Nock | Test double | [https://github.com/nock/nock](https://github.com/nock/nock) | | ||
| 5 | Istanbul | Coverage | [https://github.com/gotwarlost/istanbul](https://github.com/gotwarlost/istanbul) | |
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.
Istanbul is deprecated so we shouldn't included it here. (see https://www.npmjs.com/package/istanbul)
We have a general task to migrate the whole project over to something else, probably nyc.
├── test-node.js | ||
├── test-node.html | ||
├── package.json | ||
└── test |
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 is a general discussion over whether a module should include its test material when published to npm. In the wider node community it is a similar discussion to tabs vs spaces - ie, no clear winner and a lot of energy spent not coming to agreement.
I added testing guideline page which we discussed on the following wiki page.
If there is a suggestion about the contents, please add the comments.