
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
fixture-compare
Advanced tools
Compare test fixtures with each other, with strings, and against the results of transforms.
Compare test fixtures with each other, with strings, and against the results of transforms.
import {inputMatchesFile} from 'fixture-compare';
const input = 'some string';
const fixture = 'result.txt'
inputMatchesFile(input, fixture);
Loads a fixture, runs it through a transform, then compares the results to a
fixture with the same name, appended with .output.
import fixtureCompare from 'fixture-compare';
const fixture = 'test-1';
const transform = (text) => text.split('').reverse();
fixtureCompare(fixture, transform);
Same as the previous example, but allows you to specify a different output file.
import fixtureCompare from 'fixture-compare';
const input = 'test-2';
const output = 'test-2.result';
const transform = (text) => text.split('').reverse();
fixtureCompare(input, transform, output);
By default, paths to fixtures are assumed to be relative to {cwd}/test/fixtures.
To specify another directory...
import {setFixturesDir} from 'fixture-compare';
setFixturesDir(path.join(__dirname, 'somewhere/else'));
To log differences when fixtures do not match, use setLogging.
import {setLogging} from 'fixture-compare';
setLogging(true);
- expected
+ actual
- \n
"||"
+ \n
snett ik eltt il\n
"++---||++++|----||+++--||"
li ttle ki ttens \n
kickstarted by npm-boom
FAQs
Compare test fixtures with each other, with strings, and against the results of transforms.
We found that fixture-compare demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.