
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.
A BDD-style assertion library for Sass. Eventually it will maybe work with True.
It's not on npm yet!
Use the expect() mixin to write an assertion. Pass a value to check, and then a series of language functions. Most assertions also require a final value to compare with.
@import 'ocha';
$value: 5
@require expect($value to equal 5);
These functions don't do anything—they just make your assertion more readable.
tobebeeniswhichandhashavewithatofsameThrow the word not in an assertion to check for the opposite result.
Note that, since not is a special keyword in Sass, you have to put it in quotes.
@include expect(5 to 'not' equal 6);
Check if a value equals $value.
@include expect(5 to equal 5);
@include expect('string' to equal 'string');
Check if a value is greater than $floor.
@include expect(5 to be above 3);
Check if a value is greater than or equal to $floor.
@include expect(5 to be at least 5);
@include expect(10 to be at least 5);
Check if a value is less than $floor.
@include expect(5 to be below 3);
Check if a value is less than or equal to $floor.
@include expect(5 to be at most 5);
@include expect(10 to be at most 5);
Check if a value is within the range of $floor and $ceiling (including those values).
@include expect(5 to be within (0, 10));
Check if a value has the type of $type.
@include expect(5 to be a number);
@include expect('string' to be a string);
@include expect(#fff to be a color);
@include expect((0, 1, 2) to be a list);
Check if a value is truthy:
true@include expect(true to be ok);
Check if a value is true. Note that this function has to be used with quotes around it, because it's a special keyword in Sass.
@include expect(true to be 'true');
Check if a value is false. Note that this function has to be used with quotes around it, because it's a special keyword in Sass.
@include expect(false to be 'false');
Check if a value is null. Note that this function has to be used with quotes around it, because it's a special keyword in Sass.
@include expect(null to be 'null');
Check if a list has a length equal to $length.
$list: (0, 1, 2);
@include expect($list to have lengthOf 3);
Check if a list has a length that satisfies a certain criteria. Pair it with above, least, below, most, or within.
$list: (0, 1, 2);
@include expect($list to have length above 1);
@include expect($list to have length below 4);
@include expect($list to have length within (0, 5));
Check if a list has a length of 0.
$list: ();
@include expect($list to be empty);
Check if a string contains $substring.
@include expect('string' to have string 'str');
Check if a string contains $needle, or check if a list contains $needle.
@include expect('string' to contain 'str');
@include expect((one, two) to contain 'one');
Check if a string contains $needle, or check if a list contains $needle.
@include expect('string' to include 'str');
@include expect((one, two) to include 'one');
If you call keys by itself, check if a map contains every key within $keys and no other keys.
$map: (
one: 'one',
two: 'two',
);
@include expect($map to have keys (one, two));
If you call contain keys, check if a map contains every key within $keys. If the map has other keys, that's fine.
$map: (
one: 'one',
two: 'two',
);
@include expect($map to have keys (one));
If you call any keys, check if a map contains any key within $keys.
$map: (
one: 'one',
two: 'two',
);
@include expect($map to have keys (one, two, three, four));
FAQs
BDD-style Sass assertion library.
The npm package ocha receives a total of 8 weekly downloads. As such, ocha popularity was classified as not popular.
We found that ocha 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.