Gathering detailed insights and metrics for mocha-chai-jest-snapshot
Gathering detailed insights and metrics for mocha-chai-jest-snapshot
Gathering detailed insights and metrics for mocha-chai-jest-snapshot
Gathering detailed insights and metrics for mocha-chai-jest-snapshot
provides snapshot testing like jest
npm install mocha-chai-jest-snapshot
Typescript
Module System
Node Version
NPM Version
82.9
Supply Chain
73.4
Quality
73.2
Maintenance
100
Vulnerability
98.2
License
TypeScript (86.93%)
JavaScript (13.07%)
Total Downloads
2,637,049
Last Day
1,095
Last Week
22,383
Last Month
99,874
Last Year
862,270
MIT License
33 Stars
29 Commits
6 Forks
1 Watchers
1 Branches
3 Contributors
Updated on Feb 20, 2025
Minified
Minified + Gzipped
Latest Version
1.1.6
Package Id
mocha-chai-jest-snapshot@1.1.6
Unpacked Size
52.39 kB
Size
13.80 kB
File Count
85
NPM Version
10.7.0
Node Version
20.15.0
Published on
Sep 01, 2024
Cumulative downloads
Total Downloads
Last Day
-55.7%
1,095
Compared to previous day
Last Week
-23.7%
22,383
Compared to previous week
Last Month
9.7%
99,874
Compared to previous month
Last Year
27.7%
862,270
Compared to previous year
provides snapshot testing like jest
1npm i -D mocha-chai-jest-snapshot
then add it to the test setup:
1// e.g. setup.js (mocha --file setup.js) 2const chai = require("chai"); 3const { jestSnapshotPlugin } = require("mocha-chai-jest-snapshot"); 4 5chai.use(jestSnapshotPlugin());
enjoy.
1const { expect } = require("chai"); 2it("foo", function () { 3 expect({ foo: "bar" }).toMatchSnapshot(); 4});
> chai-snapshot@1.0.0 test /mnt/x/chai-snapshot
> npx mocha --file setup.js -r ts-node/register test/**/*.ts
✓ foo
Snapshot Summary
› 1 snapshot written from 1 test suite.
1 passing (9ms)
1// Jest Snapshot v1, https://goo.gl/fbAQLP 2 3exports[`foo 1`] = ` 4Object { 5 "foo": "bar", 6} 7`;
1# set envoriment 2UPDATE_SNAPSHOT=1 mocha ... 3# or add command line argument 4mocha ... --update
1npx mocha ... --reporter mocha-chai-jest-snapshot/reporters/spec
1const chai = require("chai"); 2const { jestSnapshotPlugin } = require("mocha-chai-jest-snapshot"); 3 4chai.use( 5 jestSnapshotPlugin({ 6 rootDir: "../", 7 snapshotResolver: "<rootDir>/jest/snapshotResolver", 8 snapshotSerializers: ["jest-serializer-vue"], 9 }) 10);
1{ 2 "jest": { 3 "rootDir": "../", 4 "snapshotResolver": "<rootDir>/jest/snapshotResolver", 5 "snapshotSerializers": ["jest-serializer-vue"] 6 } 7}
1module.exports = { 2 rootDir: "../", 3 snapshotResolver: "<rootDir>/jest/snapshotResolver", 4 snapshotSerializers: ["jest-serializer-vue"], 5};
1const chai = require("chai"); 2const { 3 jestSnapshotPlugin, 4 addSerializer, 5} = require("mocha-chai-jest-snapshot"); 6const customSerializer = require("..."); 7 8chai.use(jestSnapshotPlugin()); 9addSerializer(customSerializer);
or
1const { expect } = require("chai"); 2const customSerializer = require("..."); 3 4expect.addSnapshotSerializer(customSerializer);
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 2/28 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More