Guseyn Ismayylov
Guseyn Ismayylov

Reputation: 393

Node.js test coverage

Could anyone, please, recommend simple test coverage tool for Node.js without using Mocha because I use simple functions from assert module of Node in my own test framework.

Upvotes: 1

Views: 3686

Answers (2)

Elliot Nelson
Elliot Nelson

Reputation: 11557

The standard library for code coverage is nyc, so that's my suggestion; however, you aren't going to get code coverage to work with a test framework you came up with yourself for free -- you'll need to make sure you are instrumenting the appropriate source files so the report contains what you expect.

The following links, which discuss non-standard uses of nyc (non-standard meaning, not jasmine or mocha) might be useful - one for classic istanbul, one for the newer nyc: https://github.com/gotwarlost/istanbul/issues/574 https://github.com/istanbuljs/nyc/issues/548

Upvotes: 3

Jair A. Diaz Zambrano
Jair A. Diaz Zambrano

Reputation: 49

You can use Jest and Supertest.

Upvotes: 1

Related Questions