-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b317ab6
commit 2b5724f
Showing
6 changed files
with
89 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/coverage/ | ||
/node_modules/ | ||
/site-build/ |
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 |
---|---|---|
@@ -1,13 +1,10 @@ | ||
Unexpected-set | ||
============== | ||
# Unexpected-set | ||
|
||
Add support to [Unexpected](http://unexpected.js.org) for testing [Set](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Set) instances. | ||
|
||
[![NPM version](https://badge.fury.io/js/unexpected-set.svg)](http://badge.fury.io/js/unexpected-set) | ||
[![Build Status](https://travis-ci.org/unexpectedjs/unexpected-set.svg?branch=master)](https://travis-ci.org/unexpectedjs/unexpected-set) | ||
[![Coverage Status](https://coveralls.io/repos/unexpectedjs/unexpected-set/badge.svg)](https://coveralls.io/r/unexpectedjs/unexpected-set) | ||
[![Dependency Status](https://david-dm.org/unexpectedjs/unexpected-set.svg)](https://david-dm.org/unexpectedjs/unexpected-express) | ||
|
||
License | ||
------- | ||
[![Dependency Status](https://david-dm.org/unexpectedjs/unexpected-set.svg)](https://david-dm.org/unexpectedjs/unexpected-set) | ||
|
||
Unexpected-set is licensed under a standard 3-clause BSD license | ||
-- see the `LICENSE` file for details. | ||
Read [the documentation](http://unexpected.js.org/unexpected-set/). |
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,6 @@ | ||
/*global unexpected:true*/ | ||
unexpected = require('unexpected'); | ||
unexpected.use(require('./lib/unexpected-set')); | ||
unexpected.output.preferredWidth = 80; | ||
|
||
require('es6-set/implement'); |
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,42 @@ | ||
Asserts that a Set instance has at least one element satisfying each given | ||
spec. | ||
|
||
```js | ||
expect(new Set([1, 2, 3]), 'to satisfy', [ | ||
1, | ||
expect.it('to be less than or equal to', 1), | ||
expect.it('to be greater than', 10) | ||
]); | ||
``` | ||
|
||
```output | ||
expected Set([ 1, 2, 3 ]) to satisfy | ||
[ | ||
1, | ||
expect.it('to be less than or equal to', 1), | ||
expect.it('to be greater than', 10) | ||
] | ||
Set([ | ||
1, | ||
2, | ||
3 | ||
// missing: should be greater than 10 | ||
]) | ||
``` | ||
|
||
If the subject should not contain additional elements, use the `exhaustively` | ||
flag: | ||
|
||
```js | ||
expect(new Set([1, 2]), 'to exhaustively satisfy', [2]); | ||
``` | ||
|
||
```output | ||
expected Set([ 1, 2 ]) to exhaustively satisfy [ 2 ] | ||
Set([ | ||
1, // should be removed | ||
2 | ||
]) | ||
``` |
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,28 @@ | ||
--- | ||
template: default.ejs | ||
theme: dark | ||
title: Unexpected-set | ||
repository: https://github.com/unexpectedjs/unexpected-set | ||
--- | ||
|
||
Add support to [Unexpected](http://unexpected.js.org) for testing [Set](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Set) instances. | ||
|
||
[![NPM version](https://badge.fury.io/js/unexpected-set.svg)](http://badge.fury.io/js/unexpected-set) | ||
[![Build Status](https://travis-ci.org/unexpectedjs/unexpected-set.svg?branch=master)](https://travis-ci.org/unexpectedjs/unexpected-set) | ||
[![Coverage Status](https://coveralls.io/repos/unexpectedjs/unexpected-set/badge.svg)](https://coveralls.io/r/unexpectedjs/unexpected-set) | ||
[![Dependency Status](https://david-dm.org/unexpectedjs/unexpected-set.svg)](https://david-dm.org/unexpectedjs/unexpected-set) | ||
|
||
```js | ||
expect(new Set([1, 2, 3]), 'to satisfy', [3, 4]); | ||
``` | ||
|
||
```output | ||
expected Set([ 1, 2, 3 ]) to satisfy [ 3, 4 ] | ||
Set([ | ||
1, | ||
2, | ||
3 | ||
// missing 4 | ||
]) | ||
``` |
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