Skip to content

Testing best practices / guide / docs #1059

Closed

Description

@ritch

We should provide some guidance on how to test loopback applications. loopback-testing is really not well designed or documented for external usage.

/cc @bajtos @crandmck

Activity

  1. changed the title [-]Testing best practices guide / docs[/-] [+]Testing best practices / guide / docs[/+] on Feb 2, 2015
  2. added and removed on Feb 2, 2015
  3. jolafrite commented on Feb 17, 2015

    @jolafrite

    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 ?

  4. OwenBrotherwood commented on May 16, 2015

    @OwenBrotherwood
    Contributor

    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

  5. OwenBrotherwood commented on May 20, 2015

    @OwenBrotherwood
    Contributor
  6. crandmck commented on May 20, 2015

    @crandmck
    Contributor

    @rmg what do you think?

  7. rmg commented on May 20, 2015

    @rmg
    Member

    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.

  8. OwenBrotherwood commented on May 20, 2015

    @OwenBrotherwood
    Contributor

    @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)

  9. crandmck commented on May 20, 2015

    @crandmck
    Contributor

    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.

  10. bajtos commented on Jun 30, 2015

    @bajtos
    Member

    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.

  11. crandmck commented on Dec 29, 2015

    @crandmck
    Contributor

    The loopback-testing repo has been removed. If there is still a desire to cover testing best practices in docs, lets open a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions