Giter VIP home page Giter VIP logo

Comments (3)

jmcdo29 avatar jmcdo29 commented on July 22, 2024 1

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.

Psycokwet avatar Psycokwet commented on July 22, 2024

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.

jmcdo29 avatar jmcdo29 commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.