Gathering detailed insights and metrics for mocha-chai-jest-snapshot
Gathering detailed insights and metrics for mocha-chai-jest-snapshot
npm install mocha-chai-jest-snapshot
Typescript
Module System
Node Version
NPM Version
75.9
Supply Chain
77.9
Quality
73.6
Maintenance
100
Vulnerability
98.2
License
TypeScript (86.93%)
JavaScript (13.07%)
Total Downloads
2,284,751
Last Day
2,724
Last Week
12,865
Last Month
57,038
Last Year
741,835
31 Stars
29 Commits
5 Forks
2 Watching
1 Branches
3 Contributors
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
Publised On
01 Sept 2024
Cumulative downloads
Total Downloads
Last day
-1.1%
2,724
Compared to previous day
Last week
0.8%
12,865
Compared to previous week
Last month
11.9%
57,038
Compared to previous month
Last year
1.6%
741,835
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
1 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
Found 2/28 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
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-01-27
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