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

Add testing guideline #109

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

kazuhitoyokoi
Copy link
Member

@kazuhitoyokoi kazuhitoyokoi commented Apr 8, 2019

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.

@ryoichi-obara
Copy link
Contributor

I support this PR because of users convenience.
I suppose to users want to focus main content, so better than referring both docs(page and wiki).
The head of this wiki page says "finish this discussion around March 10.", have you finished discussion?

@kazuhitoyokoi
Copy link
Member Author

@ryoichi-obara Yes, the discussion has been finished. Currently, it is under review in this pull request.
@dceejay @knolleary Could you review this pull request when you have time?

docs/creating-nodes/testing.md Outdated Show resolved Hide resolved
docs/creating-nodes/testing.md Show resolved Hide resolved
docs/creating-nodes/testing.md Outdated Show resolved Hide resolved
docs/creating-nodes/testing.md Outdated Show resolved Hide resolved
docs/creating-nodes/testing.md Outdated Show resolved Hide resolved
├── test-node.js
├── test-node.html
├── package.json
└── test
Copy link
Member

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...?))

Copy link
Member

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.

| 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) |
Copy link
Member

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.

docs/creating-nodes/testing.md Outdated Show resolved Hide resolved
├── test-node.js
├── test-node.html
├── package.json
└── test
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants