Comments (3)
Tests are failing as expected on my end
pnpm nx run simple-sample:test
> [email protected] nx /home/jay/Documents/code/projects/testing-nestjs
> nx "run" "simple-sample:test"
> nx run simple-sample:test
● Validation Warning:
Unknown option "collectCoverage" with value true was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://jestjs.io/docs/configuration
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typ
escript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typ
escript-2-7/#easier-ecmascript-module-interoperability for more information.
FAIL apps/simple-sample/src/app.service.spec.ts
● AppService › getHello › should fail for being blatantly wrong
expect(received).toEqual(expected) // deep equality
Expected: 42
Received: 20
21 | });
22 | it('should fail for being blatantly wrong', () => {
> 23 | expect(20).toEqual(42);
| ^
24 | });
25 | });
26 | });
at Object.<anonymous> (src/app.service.spec.ts:23:18)
PASS apps/simple-sample/src/app.controller.spec.ts
-------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
app.controller.ts | 100 | 100 | 100 | 100 |
app.service.ts | 100 | 100 | 100 | 100 |
-------------------|---------|----------|---------|---------|-------------------
Test Suites: 1 failed, 1 passed, 2 total
Tests: 1 failed, 4 passed, 5 total
Snapshots: 0 total
Time: 4.251 s
Ran all test suites.
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
> NX Ran target test for project simple-sample (5s)
✖ 1/1 failed
✔ 0/1 succeeded [0 read from cache]
ELIFECYCLE Command failed with exit code 1.
Try using the nx
executor runner in the form of pnpm nx run <project-name>:test
, e.g. pnpm nx run simple-sample:test
.
If you're modifying a test in one of the test
directories, you'll need to use the e2e
executor instead, pnpm nx run <project-name>:e2e
from testing-nestjs.
Ok thank you, the e2e worked, I did change tests in test folder ! I didn't think of changing specs files. Thanks !
from testing-nestjs.
There are e2e tests in the apps/<name>/test
directories and unit tests in apps/<name>/src/**/*.spec.ts
files
from testing-nestjs.
Related Issues (20)
- About import {DocumentQuery} from 'mongoose' at mongo-sample
- Suggestion: convert testing-nestjs into monorepo with Lerna HOT 3
- [Question] How I mock another service method? HOT 8
- Suggestion: create tests for Prisma (alternative to TypeORM) HOT 7
- [FAILING TEST] Unit testing a NestJS Service that consumes a TypeORM Repository HOT 6
- [NEW TEST] Testing for interceptor failure HOT 3
- [NEW TEST] KnexJs Sample test HOT 1
- Multiple mocked dependencies with the same content HOT 5
- [NEW TEST] Bull HOT 4
- Prisma transactions and rollbacks now available HOT 2
- [NEW TEST] - (Contract Testing) - Incorporate NestJS Consumer Driven Contract testing with nestjs-pact HOT 6
- README refers to non-existing cat.integration.spec.ts HOT 3
- Test against Solidity smart contracts
- [NEW TEST] Tests for mikro-orm
- [NEW TEST] Sequelize transactions HOT 1
- Add code comment for documenting the tests. HOT 1
- Unable to commit the file in file-up-and-down-sample HOT 1
- Can't push to sidebranch for PR - getting permission denied HOT 1
- npm install doesn't work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testing-nestjs.