Skip to content

Commit

Permalink
Merge 680d939 into bfb2992
Browse files Browse the repository at this point in the history
  • Loading branch information
sunesimonsen committed Jan 5, 2019
2 parents bfb2992 + 680d939 commit ef46bba
Show file tree
Hide file tree
Showing 79 changed files with 1,321 additions and 1,092 deletions.
18 changes: 12 additions & 6 deletions .travis.yml
Expand Up @@ -4,20 +4,26 @@ env:
- TARGET=travis

node_js:
- "0.10"
- "0.12"
- "4"
- "5"
- "6"
- "7"
- "8.4.0"
- "9"
- "10"

matrix:
include:
- name: Travis main 8.4.0
- name: Lint (8.4.0)
node_js: "8.4.0"
env: TARGET=travis-main
env: TARGET=lint
- name: Jest (8.4.0)
node_js: "8.4.0"
env: TARGET=test-jest
- name: Jasmine (8.4.0)
node_js: "8.4.0"
env: TARGET=test-jasmine
- name: Coverage (8.4.0)
node_js: "8.4.0"
env: TARGET=travis-coverage
- name: BrowserStack IE11
node_js: "8.4.0"
env: TARGET=test-browserstack-ie11
Expand Down
18 changes: 8 additions & 10 deletions Makefile
@@ -1,6 +1,8 @@
REPORTER = dot

TARGETS ?= unexpected.js unexpected.js.map
.PHONY: unexpected.js
.SECONDARY: unexpected.js.map

CHEWBACCA_THRESHOLD ?= 25

Expand All @@ -25,7 +27,6 @@ build/externaltests: externaltests/*

build: build/lib build/test build/externaltests

.PHONY: ${TARGETS}
${TARGETS}: build
./node_modules/.bin/rollup --config rollup.config.js --sourcemap --format umd --name weknowhow.expect -o unexpected.js build/lib/index.js

Expand All @@ -50,15 +51,12 @@ test-jest:
ifeq ($(MODERN_NODE), true)
./node_modules/.bin/jest
else
./node_modules/.bin/jest -c test/jest.es5.config.json
./node_modules/.bin/jest --rootDir . -c test/jest.es5.config.json
endif

test-jest-if-supported-node-version:
@node-version-gte-6 && make test-jest || echo Skipping, jest is unsupported with node $(shell node --version)

.PHONY: test
test: test-sources
@./node_modules/.bin/mocha --opts $(MOCHA_OPTS) $(TEST_SOURCES) $(TEST_SOURCE_MARKDOWN)
@./node_modules/.bin/mocha --opts $(MOCHA_OPTS) $(TEST_SOURCES) $(TEST_SOURCES_MARKDOWN)

nyc-includes:
ifeq ($(MODERN_NODE), true)
Expand All @@ -84,12 +82,12 @@ test-chrome-headless: ${TARGETS}
test-browserstack-%: ${TARGETS}
@./node_modules/.bin/karma start --browsers=$* --single-run

.PHONY: travis-main
travis-main: clean lint test test-jasmine test-jest coverage
.PHONY: travis-coverage
travis-coverage: clean coverage
-<coverage/lcov.info ./node_modules/coveralls/bin/coveralls.js

.PHONY: travis
travis: test test-jest-if-supported-node-version
travis: test

.PHONY: git-dirty-check
git-dirty-check:
Expand Down Expand Up @@ -117,7 +115,7 @@ changelog: git-dirty-check
fi

.PHONY: release-%
release-%: git-dirty-check lint ${TARGETS} test-chrome-headless test-jasmine test-jest-if-supported-node-version commit-unexpected deploy-site
release-%: git-dirty-check lint ${TARGETS} test-chrome-headless test-jasmine test-jest commit-unexpected
IS_MAKE_RELEASE=yes npm version $*
make changelog
@echo $* release ready to be publised to NPM
Expand Down
54 changes: 27 additions & 27 deletions documentation/api/addType.md
Expand Up @@ -299,32 +299,32 @@ block. The outputs below shows the contrast between setting the
inlineDiff = true;
expect(
{
'John Doe': new Person('John Doe', 42),
'Jane Doe': new Person('Janie Doe', 24)
JohnDoe: new Person('John Doe', 42),
JaneDoe: new Person('Janie Doe', 24)
},
'to equal',
{
'John Doe': new Person('John Doe', 42),
'Jane Doe': new Person('Jane Doe', 24)
JohnDoe: new Person('John Doe', 42),
JaneDoe: new Person('Jane Doe', 24)
}
);
```

```output
expected
{
'John Doe': new Person('John Doe', 42),
'Jane Doe': new Person('Janie Doe', 24)
JohnDoe: new Person('John Doe', 42),
JaneDoe: new Person('Janie Doe', 24)
}
to equal
{
'John Doe': new Person('John Doe', 42),
'Jane Doe': new Person('Jane Doe', 24)
JohnDoe: new Person('John Doe', 42),
JaneDoe: new Person('Jane Doe', 24)
}
{
'John Doe': new Person('John Doe', 42),
'Jane Doe': new Person(
JohnDoe: new Person('John Doe', 42),
JaneDoe: new Person(
'Janie Doe', // should be 'Jane Doe'
// -Janie Doe
// +Jane Doe
Expand All @@ -337,39 +337,39 @@ to equal
inlineDiff = false;
expect(
{
'John Doe': new Person('John Doe', 42),
'Jane Doe': new Person('Janie Doe', 24)
JohnDoe: new Person('John Doe', 42),
JaneDoe: new Person('Janie Doe', 24)
},
'to equal',
{
'John Doe': new Person('John Doe', 42),
'Jane Doe': new Person('Jane Doe', 24)
JohnDoe: new Person('John Doe', 42),
JaneDoe: new Person('Jane Doe', 24)
}
);
```

```output
expected
{
'John Doe': new Person('John Doe', 42),
'Jane Doe': new Person('Janie Doe', 24)
JohnDoe: new Person('John Doe', 42),
JaneDoe: new Person('Janie Doe', 24)
}
to equal
{
'John Doe': new Person('John Doe', 42),
'Jane Doe': new Person('Jane Doe', 24)
JohnDoe: new Person('John Doe', 42),
JaneDoe: new Person('Jane Doe', 24)
}
{
'John Doe': new Person('John Doe', 42),
'Jane Doe': new Person('Janie Doe', 24) // should equal new Person('Jane Doe', 24)
//
// new Person(
// 'Janie Doe', // should be 'Jane Doe'
// // -Janie Doe
// // +Jane Doe
// 24
// )
JohnDoe: new Person('John Doe', 42),
JaneDoe: new Person('Janie Doe', 24) // should equal new Person('Jane Doe', 24)
//
// new Person(
// 'Janie Doe', // should be 'Jane Doe'
// // -Janie Doe
// // +Jane Doe
// 24
// )
}
```

Expand Down
33 changes: 0 additions & 33 deletions documentation/api/async.md

This file was deleted.

2 changes: 1 addition & 1 deletion documentation/api/fail.md
Expand Up @@ -99,5 +99,5 @@ If you are using the default error mode, you don't have to specify the
error message as it is just thrown away.

The diff is a method that will create a custom diff lazily. To get a
better understanding of the diff method see the [type](/api/addType)
better understanding of the diff method see the [type](../addType/)
documentation.
4 changes: 2 additions & 2 deletions documentation/api/promise-all.md
Expand Up @@ -10,7 +10,7 @@ fulfilled. If any of the promises is rejected, the resulting promise will be
rejected with the same error.

This method is usually used in combination with
[expect.promise.settle](/api/promise-settle).
[expect.promise.settle](../promise-settle/).

Let's make an asynchronous assertion that we can use for the examples:

Expand All @@ -30,7 +30,7 @@ expect.addAssertion('to be a number after a short delay', function(
});
```

See the [promise](/api/promise) documentation for more details on how
See the [promise](../promise/) documentation for more details on how
expect.promise works.

The following code snippet creates a promise that is fulfilled when all the
Expand Down
2 changes: 1 addition & 1 deletion documentation/api/promise-any.md
Expand Up @@ -27,7 +27,7 @@ expect.addAssertion('to be a number after a short delay', function(
});
```

See the [promise](/api/promise) documentation for more details on how
See the [promise](../promise/) documentation for more details on how
expect.promise works.

The following code snippet creates a promise that will be fulfilled when any
Expand Down
2 changes: 1 addition & 1 deletion documentation/api/promise-settle.md
Expand Up @@ -28,7 +28,7 @@ expect.addAssertion('to be a number after a short delay', function(
});
```

See the [promise](/api/promise) documentation for more details on how
See the [promise](../promise/) documentation for more details on how
expect.promise works.

The following code snippet creates a promise that is rejected when any
Expand Down
2 changes: 1 addition & 1 deletion documentation/api/promise.md
@@ -1,6 +1,6 @@
# expect.promise(promiseBody)

This method is used inside [addAssertion](/api/addAssertion) to create
This method is used inside [addAssertion](../addAssertion/) to create
a promise from the given body function.

Signature:
Expand Down
4 changes: 2 additions & 2 deletions documentation/api/use.md
Expand Up @@ -37,7 +37,7 @@ to extend the instance.
expect.use(require('unexpected-sinon'));
```

Notice that it is usually a good idea to [clone](../clone) the instance before
Notice that it is usually a good idea to [clone](../clone/) the instance before
extending it with plugins.

## Example
Expand Down Expand Up @@ -101,4 +101,4 @@ expected [7,13] to contain 27
```

For more inspiration you can look at the source for existing plugins.
See [the plugin page](/plugins/) for a list.
See [the plugin page](../../plugins/) for a list.
2 changes: 1 addition & 1 deletion documentation/api/withError.md
Expand Up @@ -4,7 +4,7 @@ In some situations you want to modify an error thrown from
unexpected. This method handles all the details for you.

Notice that this method is only available inside
[expect.addAssertion](/api/addAssertion).
[expect.addAssertion](../addAssertion/).

The standard case is to attach a diff or change the error message of
an error being thrown.
Expand Down
Expand Up @@ -20,7 +20,7 @@ return expect(
```

The expected value will be matched against the value with
[to satisfy](/assertions/any/to-satisfy/) semantics, so you can pass any of the
[to satisfy](../../any/to-satisfy/) semantics, so you can pass any of the
values supported by `to satisfy`:

```js#async:true
Expand Down Expand Up @@ -50,7 +50,7 @@ expected Promise to be fulfilled with value satisfying 'def'
```

You can use the `exhaustively` flag to use strict
[to satisfy](/assertions/any/to-satisfy/) semantics:
[to satisfy](../../any/to-satisfy/) semantics:

```js#async:true
return expect(
Expand Down
2 changes: 1 addition & 1 deletion documentation/assertions/Promise/to-be-fulfilled-with.md
Expand Up @@ -18,7 +18,7 @@ return expect(
```

The expected value will be matched against the value with
[to satisfy](/assertions/any/to-satisfy/) semantics, so you can pass any of the
[to satisfy](../../any/to-satisfy/) semantics, so you can pass any of the
values supported by `to satisfy`:

```js#async:true
Expand Down
Expand Up @@ -18,7 +18,7 @@ return expect(
```

The expected reason will be matched against the rejection reason with
[to satisfy](/assertions/any/to-satisfy/) semantics, so you can pass any of the
[to satisfy](../../any/to-satisfy/) semantics, so you can pass any of the
values supported by `to satisfy`:

```js#async:true
Expand Down Expand Up @@ -70,7 +70,7 @@ expected Promise to be rejected with error satisfying Error('bugger')
```

You can use the `exhaustively` flag to use strict
[to satisfy](/assertions/any/to-satisfy/) semantics:
[to satisfy](../../any/to-satisfy/) semantics:

```js#async:true
var error = new Error('Oh dear');
Expand Down
2 changes: 1 addition & 1 deletion documentation/assertions/Promise/to-be-rejected-with.md
Expand Up @@ -18,7 +18,7 @@ return expect(
```

The expected reason will be matched against the rejection reason with
[to satisfy](/assertions/any/to-satisfy/) semantics, so you can pass any of the
[to satisfy](../../any/to-satisfy/) semantics, so you can pass any of the
values supported by `to satisfy`:

```js#async:true
Expand Down
2 changes: 1 addition & 1 deletion documentation/assertions/any/to-be-a.md
Expand Up @@ -4,7 +4,7 @@ This assertion makes use of the type system in Unexpected. That means
you can assert that a value is an instance of a type specified by
its name (as a string).

For more information abort the type system see: [Types](/api/addType/)
For more information abort the type system see: [Types](../../../api/addType/)

```js
expect(true, 'to be a', 'boolean');
Expand Down
2 changes: 1 addition & 1 deletion documentation/assertions/any/to-be-ok.md
@@ -1,6 +1,6 @@
Asserts that the value is _truthy_.

Alias for [to be truthy](../to-be-truthy).
Alias for [to be truthy](../../any/to-be-truthy/).

```js
expect(1, 'to be ok');
Expand Down
Expand Up @@ -21,7 +21,7 @@ when passed as parameter to function increment(n) { return n + 1; } to equal 3
```

This assertion delegates to the
[when passed as parameters to](/assertions/array-like/when-passed-as-parameters-to/)
[when passed as parameters to](../../array-like/when-passed-as-parameters-to/)
assertion and also supports the `async` and `constructor` flags.

If you don't provide an assertion to delegate to, the return value will be provided
Expand Down

0 comments on commit ef46bba

Please sign in to comment.