Skip to content

[Doc request] Add unit/e2e tests to repo's samples #1539

@SKCrawford

Description

@SKCrawford

I'm submitting a...


[ ] Regression 
[ ] Bug report
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Samples in nest/samples are missing examples of unit and/or e2e tests. Particularly of interest to me is 05-sql-typeorm, but other samples seem to be the same. Sample 01-cats-app contains some tests, but they are quite basic.

Expected Desired behavior

Samples for specific features/techniques include unit and/or e2e tests pertaining to those features/techniques. For example, the sample given above (05) could include tests that show how to test endpoints, mock data, or connect to a testing database.

Minimal reproduction of the problem with instructions

Sample 05-sql-typeorm. Notably, the tests/ dir and /src/**/*.spec.ts files are not present. Also, they are excluded by the samples' local gitignore.

What is the motivation / use case for changing the behavior?

  • Give new users like me simple and practical examples for implementing tests for different features/techniques.
  • Better reflect the documentation's perspective of testing as one of the "fundamentals" (if it's a fundamental, it could be reasoned that having more than a page in the docs would be suitable)
  • Serve as quick reference to users.

Environment

Nest version: master branch

For Tooling issues: N/A

Others: N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions