Skip to content

Commit

Permalink
Add support for multiple matching blocks
Browse files Browse the repository at this point in the history
Add support for `contians` when multiple matching selectors exists
  • Loading branch information
codr committed Nov 8, 2022
1 parent 17003e5 commit 5140352
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
path (or string), 3) optional Sass options
- BREAKING: Require `sass` as a peer-dependency, removing True `sass` option
- BREAKING: Drop support for node < 14.15.0
- FEATURE: Check for contains across multiple block with matching styles.
[#243](https://github.com/oddbird/true/pull/243)
- INTERNAL: Use both Jest and Mocha for internal testing
- INTERNAL: Update dependencies

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const contains = function (output: string, expected: string) {
// This is the assertion itself!
return expectedProperties.every((property) =>
matchingOutputBlocks.some((outputBlock) =>
outputBlock.output.includes(property)
outputBlock.output.includes(property),
),
);
}
Expand Down
1 change: 1 addition & 0 deletions test/scss/assert/_output.scss
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@

@include contains {
.selector {
width: 10px;
min-height: 5px;
}
}
Expand Down

0 comments on commit 5140352

Please sign in to comment.