You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basic Documentation to allow for successful Pull Requests
As a contributor; I would like to be able to present a Pull Request where tests are included in my contribution
Loopback uses http://mochajs.org for tests. Please take a look at the test directory to find some inspiration for a test. Running the test is as easy as writing mocha -g some-words-in-your-test (-g enables grep in mocha)
As a contributor, I would like to understand the loopback method of tests for a Pull Request, such that my Pull Request passes first time
There are grunt tasks in a loopback repo that check for well formed code,
grunt jscs and grunt jshint.
Please run the tasks on your code before submitting a pull request, as the tests run on the Pull Request are based on these tasks.
The above is basic info for contributing. However, ensuring knowledge of tests reduces developer time used in explaining or asking for a tests and allows more time to making some magic.
@rmg : yep, I know @crandmck fills in the details as to "why are we 'here' now"
Edit After @crandmck comment below
The title for the issue and it's placement in the loopback repo plus nothing happens with the issue while the community makes PR's with failed tests (and the waste of time latter) indicate that 'something' should be done.
The 'issue' of ensuring PR's come thru first time is solvable or at least, can be improved.
Is it @ritch that deceides that this issue has been hijacked and that a new issue be made in loopback repo?
(and this is no problem for me: the work is saved and I can delete my comments to ensure a clean thread)
OK, I think the two issues of testing applications and testing contributions have gotten somewhat conflated here.
@rmg you are right that this issue was for the former, and the above query seems to be about the latter. Since I had nothing to do with CONTRIBUTING.md, I just punted it to you. Perhaps it makes sense to suggest that any contributions to LoopBack have corresponding tests--I don't know. That's the gist, and perhaps it does deserve a separate issue, but I will leave it to others if so.
We should provide some guidance on how to test loopback applications. loopback-testing is really not well designed or documented for external usage.
My two cents: developers should use supertest together with whatever testing framework they prefer (mocha, tap, etc.) If they find data-builders helpful, then they can use that part of loopback-testing too. For everything else, they should write their own helpers specific to the application they are developing.
Activity
[-]Testing best practices guide / docs[/-][+]Testing best practices / guide / docs[/+]jolafrite commentedon Feb 17, 2015
Hi
There is no +1 button on Github but I definitely would be interested by this feature
Is there a place where I can start to have a look ?
OwenBrotherwood commentedon May 16, 2015
Basic Documentation to allow for successful Pull Requests
As a contributor; I would like to be able to present a Pull Request where tests are included in my contribution
Loopback uses http://mochajs.org for tests. Please take a look at the test directory to find some inspiration for a test. Running the test is as easy as writing mocha -g some-words-in-your-test (-g enables grep in mocha)
As a contributor, I would like to understand the loopback method of tests for a Pull Request, such that my Pull Request passes first time
There are grunt tasks in a loopback repo that check for well formed code,
grunt jscs and grunt jshint.
Please run the tasks on your code before submitting a pull request, as the tests run on the Pull Request are based on these tasks.
The above is basic info for contributing. However, ensuring knowledge of tests reduces developer time used in explaining or asking for a tests and allows more time to making some magic.
https://github.com/strongloop/loopback/blob/8d851e8b5f574a16ee480251b1d5b5fc2d989913/CONTRIBUTING.md
@crandmck
https://docs.google.com/document/d/1OQJqgfdyBHSqLLChKDn1FpFJZxvP_W_AtgL9-uTBy6A/edit?usp=sharing
https://github.com/strongloop/loopback-testing the loopback-testing ritch referred to
OwenBrotherwood commentedon May 20, 2015
@crandmck What about some short mention of tests in https://github.com/strongloop/loopback/blob/8d851e8b5f574a16ee480251b1d5b5fc2d989913/CONTRIBUTING.md
crandmck commentedon May 20, 2015
@rmg what do you think?
rmg commentedon May 20, 2015
As far as I can tell, this issue is about guidelines for testing loopback applications, not writing tests for loopback contributions.
@crandmck @OwenBrotherwood I'm not sure what you are asking for my opinion on.
OwenBrotherwood commentedon May 20, 2015
@rmg : yep, I know
@crandmck fills in the details as to "why are we 'here' now"
Edit After @crandmck comment below
The title for the issue and it's placement in the loopback repo plus nothing happens with the issue while the community makes PR's with failed tests (and the waste of time latter) indicate that 'something' should be done.
The 'issue' of ensuring PR's come thru first time is solvable or at least, can be improved.
Is it @ritch that deceides that this issue has been hijacked and that a new issue be made in loopback repo?
(and this is no problem for me: the work is saved and I can delete my comments to ensure a clean thread)
crandmck commentedon May 20, 2015
OK, I think the two issues of testing applications and testing contributions have gotten somewhat conflated here.
@rmg you are right that this issue was for the former, and the above query seems to be about the latter. Since I had nothing to do with
CONTRIBUTING.md, I just punted it to you. Perhaps it makes sense to suggest that any contributions to LoopBack have corresponding tests--I don't know. That's the gist, and perhaps it does deserve a separate issue, but I will leave it to others if so.bajtos commentedon Jun 30, 2015
My two cents: developers should use
supertesttogether with whatever testing framework they prefer (mocha, tap, etc.) If they find data-builders helpful, then they can use that part of loopback-testing too. For everything else, they should write their own helpers specific to the application they are developing.crandmck commentedon Dec 29, 2015
The
loopback-testingrepo has been removed. If there is still a desire to cover testing best practices in docs, lets open a separate issue.