Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
jest-snapshot
Advanced tools
The jest-snapshot package is a part of the Jest testing framework. It allows developers to capture snapshots of values, typically React component trees, and compare them to previously recorded snapshots to detect changes. This is useful for ensuring that UI does not change unexpectedly.
Snapshot Testing
This feature allows you to create a snapshot of a value, which will be saved to a file. On subsequent test runs, the saved snapshot is compared to the current value, and any differences will cause the test to fail. This is useful for testing the output of components.
expect(value).toMatchSnapshot();
Inline Snapshots
Inline snapshots work similarly to regular snapshots, but instead of saving the snapshot to a separate file, it is embedded directly in the test file. This can be more convenient for smaller snapshots or when you want to keep the test and its expected output closely tied together.
expect(value).toMatchInlineSnapshot();
Snapshot Property Matchers
Snapshot property matchers allow you to ignore certain properties within a snapshot by using matchers from Jest's expect API. This is useful when you want to ignore dynamic values that change between test runs, such as timestamps or generated IDs.
expect(value).toMatchSnapshot({ createdAt: expect.any(Date) });
This package integrates Jest's snapshot testing feature with the Chai assertion library. It allows developers using Chai to utilize snapshot testing in a similar way to Jest. It is useful for those who prefer Chai's syntax but want to leverage snapshot testing.
AVA is a test runner that comes with built-in support for snapshot testing. While it serves a similar purpose to Jest's snapshot feature, AVA is a separate testing framework with its own syntax and features. It is designed to be fast and concurrent.
This package adds snapshot testing capabilities to the Mocha test framework. It allows Mocha users to take advantage of snapshot testing without switching to Jest. However, it may not be as tightly integrated or feature-rich as Jest's built-in snapshot functionality.
29.4.0
[expect, @jest/expect-utils]
Support custom equality testers (#13654)[jest-config, jest-worker]
Use os.availableParallelism
if available to calculate number of workers to spawn (#13738)[@jest/globals, jest-mock]
Add jest.replaceProperty()
that replaces property value (#13496)[jest-haste-map]
ignore Sapling vcs directories (.sl/
) (#13674)[jest-resolve]
Support subpath imports (#13705, #13723, #13777)[jest-runtime]
Add jest.isolateModulesAsync
for scoped module initialization of asynchronous functions (#13680)[jest-runtime]
Add jest.isEnvironmentTornDown
function (#13741)[jest-test-result]
Added skipped
and focused
status to FormattedTestResult
(#13700)[jest-transform]
Support for asynchronous createTransformer
(#13762)[jest-environment-node]
Fix non-configurable globals (#13687)[@jest/expect-utils]
toMatchObject
should handle Symbol
properties (#13639)[jest-mock]
Fix mockReset
and resetAllMocks
undefined
return value(#13692)[jest-resolve]
Add global paths to require.resolve.paths
(#13633)[jest-resolve]
Correct node core module detection when using node:
specifiers (#13806)[jest-runtime]
Support WASM files that import JS resources (#13608)[jest-runtime]
Use the scriptTransformer
cache in jest-runner
(#13735)[jest-runtime]
Enforce import assertions when importing JSON in ESM (#12755 & #13805)[jest-snapshot]
Make sure to import babel
outside of the sandbox (#13694)[jest-transform]
Ensure the correct configuration is passed to preprocessors specified multiple times in the transform
option (#13770)FAQs
Unknown package
The npm package jest-snapshot receives a total of 15,185,527 weekly downloads. As such, jest-snapshot popularity was classified as popular.
We found that jest-snapshot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.