Skip to content

Commit

Permalink
Merge 3a7d8b7 into 8c88ad9
Browse files Browse the repository at this point in the history
  • Loading branch information
joelmukuthu committed Jul 28, 2016
2 parents 8c88ad9 + 3a7d8b7 commit 665569e
Show file tree
Hide file tree
Showing 15 changed files with 1,232 additions and 412 deletions.
4 changes: 2 additions & 2 deletions documentation/assertions/moment/to-be-after.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ expect(moment('2015-02-03'), 'to be after', moment('2015-04-03'));
```

```output
expected moment(2015-02-03T00:00:00.000+01:00)
to be after moment(2015-04-03T00:00:00.000+02:00)
expected moment('2015-02-03T00:00:00.000+01:00')
to be after moment('2015-04-03T00:00:00.000+02:00')
```
4 changes: 2 additions & 2 deletions documentation/assertions/moment/to-be-before.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ expect(moment('2015-04-03'), 'to be before', moment('2015-02-03'));
```

```output
expected moment(2015-04-03T00:00:00.000+02:00)
to be before moment(2015-02-03T00:00:00.000+01:00)
expected moment('2015-04-03T00:00:00.000+02:00')
to be before moment('2015-02-03T00:00:00.000+01:00')
```
4 changes: 2 additions & 2 deletions documentation/assertions/moment/to-be-between.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ expect(moment('2015-01-01'), 'to be between', moment('2015-02-01'), moment('2015
```

```output
expected moment(2015-01-01T00:00:00.000+01:00)
to be between moment(2015-02-01T00:00:00.000+01:00) and moment(2015-03-01T00:00:00.000+01:00)
expected moment('2015-01-01T00:00:00.000+01:00')
to be between moment('2015-02-01T00:00:00.000+01:00') and moment('2015-03-01T00:00:00.000+01:00')
```
4 changes: 2 additions & 2 deletions documentation/assertions/moment/to-be-same-or-after.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ expect(moment('2015-02-03'), 'to be same or after', moment('2015-04-03'));
```

```output
expected moment(2015-02-03T00:00:00.000+01:00)
to be same or after moment(2015-04-03T00:00:00.000+02:00)
expected moment('2015-02-03T00:00:00.000+01:00')
to be same or after moment('2015-04-03T00:00:00.000+02:00')
```
4 changes: 2 additions & 2 deletions documentation/assertions/moment/to-be-same-or-before.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ expect(moment('2015-04-01'), 'to be same or before', moment('2015-01-01'));
```

```output
expected moment(2015-04-01T00:00:00.000+02:00)
to be same or before moment(2015-01-01T00:00:00.000+01:00)
expected moment('2015-04-01T00:00:00.000+02:00')
to be same or before moment('2015-01-01T00:00:00.000+01:00')
```
8 changes: 7 additions & 1 deletion documentation/assertions/moment/to-be-the-end-of.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ expect(moment('2015-01-01 00:00:00'), 'to be the end of day');
```

```output
expected moment(2015-01-01T00:00:00.000+01:00) to be the end of day
expected moment('2015-01-01T00:00:00.000+01:00') to be the end of day
moment(
'2015-01-01T00:00:00.000+01:00' // should be '2015-01-01T23:59:59.999+01:00'
// -2015-01-01T00:00:00.000+01:00
// +2015-01-01T23:59:59.999+01:00
)
```
8 changes: 7 additions & 1 deletion documentation/assertions/moment/to-be-the-start-of.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ expect(moment('2015-01-01 01'), 'to be the start of year');
```

```output
expected moment(2015-01-01T01:00:00.000+01:00) to be the start of year
expected moment('2015-01-01T01:00:00.000+01:00') to be the start of year
moment(
'2015-01-01T01:00:00.000+01:00' // should be '2015-01-01T00:00:00.000+01:00'
// -2015-01-01T01:00:00.000+01:00
// +2015-01-01T00:00:00.000+01:00
)
```
11 changes: 7 additions & 4 deletions documentation/assertions/moment/to-equal.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ expect(moment('2015-11-01'), 'to equal', moment('2015-11-02'), 'in days');
```

```output
expected moment(2015-11-01T00:00:00.000+01:00)
to equal moment(2015-11-02T00:00:00.000+01:00) in days
expected moment('2015-11-01T00:00:00.000+01:00')
to equal moment('2015-11-02T00:00:00.000+01:00') in days
-2015-11-01T00:00:00.000+01:00
+2015-11-02T00:00:00.000+01:00
moment(
'2015-11-01T00:00:00.000+01:00' // should be '2015-11-02T00:00:00.000+01:00'
// -2015-11-01T00:00:00.000+01:00
// +2015-11-02T00:00:00.000+01:00
)
```
10 changes: 9 additions & 1 deletion documentation/assertions/moment/to-satisfy.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ expect(moment('2015-11-01'), 'to satisfy', { year: 2015, month: 11, day: 1 });
```

```output
expected moment(2015-11-01T00:00:00.000+01:00)
expected moment('2015-11-01T00:00:00.000+01:00')
to satisfy { year: 2015, month: 11, day: 1 }
moment(
{
years: 2015,
months: 10, // should equal 11
date: 1
}
)
```
2 changes: 1 addition & 1 deletion documentation/assertions/moment/when-formatted-with.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ expect(moment('2015-11-02'), 'when formatted with', 'YYYYMMDD', 'to be', '2015')
```

```output
expected moment(2015-11-02T00:00:00.000+01:00)
expected moment('2015-11-02T00:00:00.000+01:00')
when formatted with 'YYYYMMDD' to be '2015'
-20151102
Expand Down
18 changes: 18 additions & 0 deletions documentation/assertions/moment/when-formatted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Format a moment instance using [the default ISO8601 format](http://momentjs.com/docs/#/displaying/format/), then delegate the formatted value to another assertion.

```js
expect(moment('2015-11-02'), 'when formatted to be', '2015-11-02T00:00:00+01:00');
```

When the assertion fails you'll get this output:

```js
expect(moment('2015-11-02'), 'when formatted to be', '2015');
```

```output
expected moment('2015-11-02T00:00:00.000+01:00') when formatted to be '2015'
-2015-11-02T00:00:00+01:00
+2015
```
13 changes: 8 additions & 5 deletions documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ expect(date, 'to equal', moment('2015-11-03'));
```

```output
expected moment(2015-11-06T00:00:00.000+01:00)
to equal moment(2015-11-03T00:00:00.000+01:00)
-2015-11-06T00:00:00.000+01:00
+2015-11-03T00:00:00.000+01:00
expected moment('2015-11-06T00:00:00.000+01:00')
to equal moment('2015-11-03T00:00:00.000+01:00')
moment(
'2015-11-06T00:00:00.000+01:00' // should be '2015-11-03T00:00:00.000+01:00'
// -2015-11-06T00:00:00.000+01:00
// +2015-11-03T00:00:00.000+01:00
)
```

[![NPM version](https://badge.fury.io/js/unexpected-moment.svg)](http://badge.fury.io/js/unexpected-moment)
Expand Down

0 comments on commit 665569e

Please sign in to comment.