![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@adeira/fixtures-tester
Advanced tools
Readme
Install (via Yarn or NPM):
yarn add @adeira/fixtures-tester
generateTestsFromFixtures
This function loads all the fixture files (their file content) from your folder and snapshots the result of your callback operation. This is handy when you have several example files, you want to perform some operation on top of them and snapshot the results.
import { generateTestsFromFixtures } from '@adeira/fixtures-tester';
generateTestsFromFixtures(
`${__dirname}/__fixtures__`,
(input: string): string => {
return doSomethingWithTheInput(input); // this result will be saved in a Jest snapshot
},
// optionally a snapshot name
);
There are two additional modes which allow you to control the fixtures behavior more precisely. There are based on the fixture name:
simpleExample.graphql
- fixture will snapshot as expectedsimpleExample.only.graphql
- only these snapshots will run (for debug only)simpleExample.error.graphql
- it's expected that fixture will throw an error (expected to fail tests)The error file convention is required to prevent unintentional snapshots of exceptions.
verifyTestsFromFixtures
This function simply verifies that the callback returns true
but it doesn't snapshot anything:
import { verifyTestsFromFixtures } from '@adeira/fixtures-tester';
verifyTestsFromFixtures(`${__dirname}/__fixtures__`, (input: string): boolean => {
return isInputValid(input) === true;
});
This is handy when the snapshot from generateTestsFromFixtures
would be meaningless but you still want to check all available fixtures.
FAQs
Utility to ease testing with fixtures.
The npm package @adeira/fixtures-tester receives a total of 85 weekly downloads. As such, @adeira/fixtures-tester popularity was classified as not popular.
We found that @adeira/fixtures-tester demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.