Socket
Socket
Sign inDemoInstall

jest-specific-snapshot

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-specific-snapshot - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

9

dist/index.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addSerializer = undefined;
var _path = require('path');

@@ -50,2 +55,4 @@

}
});
});
exports.addSerializer = _jestSnapshot.addSerializer;

8

package.json
{
"name": "jest-specific-snapshot",
"version": "0.2.0",
"version": "0.3.0",
"license": "MIT",
"repository": "https://github.com/igor-dv/jest-specific-snapshot",
"main": "dist/index.js",

@@ -16,3 +18,3 @@ "scripts": {

"dependencies": {
"jest-snapshot": "^20.0.3"
"jest-snapshot": ">=20.0.3"
},

@@ -38,4 +40,4 @@ "devDependencies": {

"peerDependencies": {
"jest": "^20.0.4"
"jest": "*"
}
}
# Jest Specific Snapshot #
TBD
Jest matcher for multiple snapshot files per test

@@ -31,2 +31,16 @@ # Installation #

## With Custom Serializer ##
```js
// extend jest to have 'toMatchSpecificSnapshot' matcher
const addSerializer = require('jest-specifics-snapshot').addSerializer;
addSerializer(/* Add custom serializer here */);
test('test', () => {
expect(/* thing that matches the custom serializer */)
.toMatchSpecificSnapshot('./specific/custom_serializer/test.shot');
});
```
# Limitations #

@@ -36,2 +50,2 @@

2. In order to handle the `--updateSnapshot` (`-u`) parameter provided from CLI, there is an abuse of the `SnapshotState._updateSnapshot` private field. TBD - try to use the `globalConfig` to get this state.
3. TBD
3. `.toMatchSpecificSnapshot` does ignore a custom serializers strategy. In order to support custom serializers, you should use the `addSerializer` method explicitly.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc