-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: multi elements support for attribute
- Loading branch information
Showing
4 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {assert} from 'chai' | ||
import {getIntersection} from '../src/utilities-data.ts' | ||
|
||
describe('utilities - getIntersection', () => { | ||
it('should produce empty array from empty input', () => { | ||
const result = getIntersection() | ||
assert.sameMembers(result, []) | ||
}) | ||
it('should replicate single array', () => { | ||
const result = getIntersection([['a', 'b', 'c']]) | ||
assert.sameMembers(result, ['a', 'b', 'c']) | ||
}) | ||
it('should produce empty array if no intersection', () => { | ||
const result = getIntersection([['a', 'b', 'c'], ['x', 'y', 'z']]) | ||
assert.sameMembers(result, []) | ||
}) | ||
it('should produce intersecting members', () => { | ||
const result = getIntersection([['a', 'b', 'c'], ['b', 'c', 'd']]) | ||
assert.sameMembers(result, ['b', 'c']) | ||
}) | ||
}) |