Repository: unexpectedjs/unexpected
Pull request #419 (2017-09-03 09:22:10)

Revert "Babel"
Reverts unexpectedjs/unexpected#418


Patch:
diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index a76a3af2..00000000
--- a/.babelrc
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "presets": [
-    "es2015-without-strict"
-  ]
-}
diff --git a/.eslintignore b/.eslintignore
index b8d8476d..7b4da59c 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,6 +1,5 @@
 /documentation/
 /images/
-/build/
 /vendor/
 /coverage/
 /site-build/
diff --git a/.gitignore b/.gitignore
index 460002f5..77de10ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,5 @@
 /node_modules/
 /coverage/
-/build/
 /site-build/
 /test/tests.html
 /test/JasmineRunner.html
diff --git a/.npmignore b/.npmignore
index a25538b8..ef9de606 100644
--- a/.npmignore
+++ b/.npmignore
@@ -1,7 +1,5 @@
 /node_modules/
 /site-build/
-/build/test/
-/build/externaltests/
 /test/
 /documentation/
 /coverage/
diff --git a/.npmrc b/.npmrc
deleted file mode 100644
index caa445c1..00000000
--- a/.npmrc
+++ /dev/null
@@ -1,2 +0,0 @@
-save-prefix=''
-package-lock=false
diff --git a/.nvmrc b/.nvmrc
deleted file mode 100644
index 33edba2d..00000000
--- a/.nvmrc
+++ /dev/null
@@ -1,1 +0,0 @@
-v8.4.0
diff --git a/.travis.yml b/.travis.yml
index fe3029eb..a390e60d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,5 +6,5 @@ node_js:
    - "5"
    - "6"
    - "7"
-   - "8.4.0"
+   - "8"
 script: "make travis"
diff --git a/Makefile b/Makefile
index 5e7a0d00..f9bcb4e3 100644
--- a/Makefile
+++ b/Makefile
@@ -4,107 +4,64 @@ TARGETS ?= unexpected.js unexpected.js.map
 
 CHEWBACCA_THRESHOLD ?= 25
 
-TEST_SOURCES_MARKDOWN =  $(shell find documentation -name '*.md')
-
-MODERN_NODE = $(shell node -p -e 'require("node-version-check").gte(require("fs").readFileSync(".nvmrc", "utf8").trim())')
-
 lint:
 	npm run lint
 
 .PHONY: lint
 
-build/lib: lib/*
-	babel --copy-files --out-dir build/lib --quiet lib
-
-build/test: test/*
-	babel --copy-files --out-dir build/test --quiet test
-	sed -i -e 's#--require ./test#--require ./build/test#g' ./build/test/mocha.opts
-
-build/externaltests: externaltests/*
-	babel --copy-files --out-dir build/externaltests --quiet externaltests
-
-build: build/lib build/test build/externaltests
-
 .PHONY: ${TARGETS}
-${TARGETS}: build
-	./node_modules/.bin/rollup --config --sourcemap --format umd --name weknowhow.expect -o unexpected.js build/lib/index.js
+${TARGETS}: lib/*
+	./node_modules/.bin/rollup --config --sourcemap --format umd --name weknowhow.expect -o unexpected.js lib/index.js
 
-create-html-runners: build/test test/tests.tpl.html test/JasmineRunner.tpl.html
+create-html-runners: test/tests.tpl.html test/JasmineRunner.tpl.html
 	@for file in tests JasmineRunner ; do \
-		(sed '/test files/q' ./build/test/$${file}.tpl.html | sed '$$d' && \
+		(sed '/test files/q' ./test/$${file}.tpl.html | sed '$$d' && \
 		find test -name '*.spec.js' | sed 's/test/    <script src="./' | sed 's/$$/"><\/script>/' && \
-		sed -n '/test files/,$$p' ./build/test/$${file}.tpl.html | sed '1d') > ./build/test/$${file}.html;\
+		sed -n '/test files/,$$p' ./test/$${file}.tpl.html | sed '1d') > ./test/$${file}.html;\
 	done
 
 .PHONY: create-html-runners
 
 test-phantomjs: create-html-runners ${TARGETS}
-	phantomjs ./node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js build/test/tests.html spec "`node -pe 'JSON.stringify({useColors:true,grep:process.env.grep})'`"
+	phantomjs ./node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/tests.html spec "`node -pe 'JSON.stringify({useColors:true,grep:process.env.grep})'`"
+
+test-jest-if-supported-node-version:
+ifeq ($(shell node --version | grep -vP '^v[0123]\.'),)
+	@echo Skipping, jest is unsupported with node $(shell node --version)
+else
+	./node_modules/.bin/jest
+endif
 
 test-jasmine:
 	./node_modules/.bin/jasmine JASMINE_CONFIG_PATH=test/support/jasmine.json
 
 test-jasmine-browser: create-html-runners ${TARGETS}
-	@echo open http://localhost:5000/build/test/JasmineRunner.html
 	@./node_modules/.bin/serve .
 
-test-sources:
-ifeq ($(MODERN_NODE), true)
-MOCHA_OPTS = ./test/mocha.opts
-TEST_SOURCES = $(shell find test -name '*.spec.js')
-else
-	make build
-MOCHA_OPTS = ./build/test/mocha.opts
-TEST_SOURCES = $(shell find build/test -name '*.spec.js')
-endif
-
-.PHONY: test-jest
-test-jest:
-ifeq ($(MODERN_NODE), true)
-	./node_modules/.bin/jest
-else
-	./node_modules/.bin/jest -c test/jest.es5.config.json
-endif
-
-test-jest-if-supported-node-version:
-	@node-version-gte-4 && 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)
-
-nyc-includes:
-ifeq ($(MODERN_NODE), true)
-NYC_INCLUDES='lib/**'
-else
-NYC_INCLUDES='build/lib/**'
-endif
+TEST_SOURCES = $(shell find test -name '*.spec.js') $(shell find documentation -name '*.md')
+test: lint
+	@./node_modules/.bin/mocha $(TEST_SOURCES)
 
 .PHONY: coverage
-coverage: nyc-includes test-sources
-	@./node_modules/.bin/nyc --include $(NYC_INCLUDES) --reporter=lcov --reporter=text --all -- mocha --opts $(MOCHA_OPTS) $(TEST_SOURCES) $(TEST_SOURCES_MARKDOWN)
+coverage:
+	@./node_modules/.bin/nyc --reporter=lcov --reporter=text --all -- mocha --compilers md:unexpected-markdown test/*.js $(TEST_SOURCES)
 	@echo google-chrome coverage/lcov-report/index.html
 
 .PHONY: test-browser
 test-browser: create-html-runners ${TARGETS}
-	@echo open http://localhost:5000/build/test/tests.html
 	@./node_modules/.bin/serve .
 
-.PHONY: travis-secondary
-travis-secondary: test test-jest-if-supported-node-version coverage
+.PHONY: travis-chewbacca
+travis-chewbacca:
+	./node_modules/.bin/chewbacca --threshold ${CHEWBACCA_THRESHOLD} `echo ${TRAVIS_COMMIT_RANGE} | sed -e 's/\.\.\..*//;'` -- test/benchmark.spec.js
 
-.PHONY: travis-main
-travis-main: clean lint test test-jasmine test-jest coverage
+travis: clean lint test travis-chewbacca test-jasmine test-jest-if-supported-node-version coverage
+ifneq ($(shell node --version | grep -vP '^v[0123]\.'),)
 	make site-build
 	make test-phantomjs
-	-<coverage/lcov.info ./node_modules/coveralls/bin/coveralls.js
-
-travis:
-ifeq ($(MODERN_NODE), true)
-	make travis-main
-else
-	make travis-secondary
 endif
+	-<coverage/lcov.info ./node_modules/coveralls/bin/coveralls.js
 
 .PHONY: git-dirty-check
 git-dirty-check:
@@ -126,6 +83,7 @@ commit-unexpected: ${TARGETS}
 
 .PHONY: release-%
 release-%: git-dirty-check lint ${TARGETS} test-phantomjs test-jasmine test-jest-if-supported-node-version commit-unexpected deploy-site
+	./node_modules/.bin/chewbacca --threshold ${CHEWBACCA_THRESHOLD} `git describe --abbrev=0 --tags --match 'v*'` -- test/benchmark.spec.js
 	IS_MAKE_RELEASE=yes npm version $*
 	@echo $* release ready to be publised to NPM
 	@echo Remember to push tags
@@ -141,3 +99,7 @@ site-build:
 .PHONY: update-examples
 update-examples:
 	npm run update-examples
+
+.PHONY: benchmark
+benchmark:
+	./node_modules/.bin/mocha --no-timeouts --ui chewbacca/mocha-benchmark-ui --reporter chewbacca/mocha-benchmark-reporter test/benchmark.spec.js
diff --git a/documentation/api/shift.md b/documentation/api/shift.md
index cb372fab..3619e308 100644
--- a/documentation/api/shift.md
+++ b/documentation/api/shift.md
@@ -29,7 +29,7 @@ optionally takes one via `<assertion?>` and is invoked without,
 `expect.shift` will propagate its argument as the fulfillment value of the
 promise returned from your assertion:
 
-```js#async:true&freshExpect:true
+```js#freshExpect:true
 expect.addAssertion('<string> [when] parsed as an integer <assertion?>', function (expect, subject) {
     expect(subject, 'to match', /^[1-9][0-9]*$/);
     return expect.shift(parseInt(subject, 10));
diff --git a/documentation/assertions/Buffer/when-decoded-as.md b/documentation/assertions/Buffer/when-decoded-as.md
index b6eb915f..878f47a8 100644
--- a/documentation/assertions/Buffer/when-decoded-as.md
+++ b/documentation/assertions/Buffer/when-decoded-as.md
@@ -21,7 +21,7 @@ expected Buffer([0xE2, 0x98, 0xBA]) when decoded as 'utf-8' to equal 'happy face
 If you don't provide an assertion to delegate to, the decoded value will be provided
 as the fulfillment value of the promise:
 
-```js#async:true,skipBrowser:true
+```js#skipBrowser:true
 return expect(new Buffer([0xe2, 0x98, 0xba]), 'decoded as', 'utf-8').then(function (result) {
     expect(result, 'to equal', '☺');
 });
diff --git a/documentation/assertions/any/when-passed-as-parameter-to.md b/documentation/assertions/any/when-passed-as-parameter-to.md
index 07a523e6..49df62cc 100644
--- a/documentation/assertions/any/when-passed-as-parameter-to.md
+++ b/documentation/assertions/any/when-passed-as-parameter-to.md
@@ -27,7 +27,7 @@ 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
 as the fulfillment value of the promise:
 
-```js#async:true
+```js
 return expect(10, 'passed as parameter to', increment).then(function (result) {
     expect(result, 'to equal', 11);
 });
diff --git a/documentation/assertions/array-like/when-passed-as-parameters-to.md b/documentation/assertions/array-like/when-passed-as-parameters-to.md
index 5c4dc1fd..ef128b2d 100644
--- a/documentation/assertions/array-like/when-passed-as-parameters-to.md
+++ b/documentation/assertions/array-like/when-passed-as-parameters-to.md
@@ -50,7 +50,7 @@ expect([123], 'when passed as parameters to constructor', Foo, 'to be a', Foo);
 If you don't provide an assertion to delegate to, the return value will be provided
 as the fulfillment value of the promise:
 
-```js#async:true
+```js
 return expect([1, 3], 'passed as parameters to', add).then(function (result) {
     expect(result, 'to equal', 4);
 });
diff --git a/documentation/assertions/function/when-called-with.md b/documentation/assertions/function/when-called-with.md
index 4fbd40da..bfda6545 100644
--- a/documentation/assertions/function/when-called-with.md
+++ b/documentation/assertions/function/when-called-with.md
@@ -22,7 +22,7 @@ expected function add(a, b) { return a + b; } when called with 1, 2 to equal 9
 If you don't provide an assertion to delegate to, the returned value will be
 provided as the fulfillment value of the promise:
 
-```js#async
+```js
 return expect(add, 'called with', [1, 2]).then(function (result) {
     expect(result, 'to equal', 3);
 });
diff --git a/documentation/assertions/function/when-called.md b/documentation/assertions/function/when-called.md
index b0b00aed..381d7f7b 100644
--- a/documentation/assertions/function/when-called.md
+++ b/documentation/assertions/function/when-called.md
@@ -22,7 +22,7 @@ expected function giveMeFive() { return 5; } when called to equal 7
 If you don't provide an assertion to delegate to, the return value will be provided
 as the fulfillment value of the promise:
 
-```js#async:true
+```js
 return expect(giveMeFive, 'called').then(function (result) {
     expect(result, 'to equal', 5);
 });
diff --git a/lib/Unexpected.js b/lib/Unexpected.js
index dafe4aee..8d5f51a8 100644
--- a/lib/Unexpected.js
+++ b/lib/Unexpected.js
@@ -300,7 +300,7 @@ Unexpected.prototype.equal = function (actual, expected, depth, seen) {
 Unexpected.prototype.inspect = function (obj, depth, outputOrFormat) {
     var seen = [];
     var that = this;
-    function printOutput(obj, currentDepth, output) {
+    var printOutput = function (obj, currentDepth, output) {
         var objType = that.findTypeOf(obj);
         if (currentDepth <= 0 && objType.is('object') && !objType.is('expect.it')) {
             return output.text('...');
@@ -852,9 +852,9 @@ function installExpectMethods(unexpected) {
     expect.equal = unexpected.equal.bind(unexpected);
     expect.inspect = unexpected.inspect.bind(unexpected);
     expect.findTypeOf = unexpected.findTypeOf; // Already bound
-    expect.fail = function (...args) {
+    expect.fail = function () {
         try {
-            unexpected.fail(...args);
+            unexpected.fail.apply(unexpected, arguments);
         } catch (e) {
             if (e && e._isUnexpected) {
                 unexpected.setErrorMessage(e);
diff --git a/lib/addAdditionalPromiseMethods.js b/lib/addAdditionalPromiseMethods.js
index 7fdce372..65368068 100644
--- a/lib/addAdditionalPromiseMethods.js
+++ b/lib/addAdditionalPromiseMethods.js
@@ -1,5 +1,6 @@
-function addAdditionalPromiseMethods(promise, expect, subject) {
-    promise.and = function (...args) {
+module.exports = function addAdditionalPromiseMethods(promise, expect, subject) {
+    promise.and = function () { // ...
+        var args = Array.prototype.slice.call(arguments);
         function executeAnd() {
             if (expect.findTypeOf(args[0]).is('expect.it')) {
                 return addAdditionalPromiseMethods(args[0](subject), expect, subject);
@@ -17,5 +18,3 @@ function addAdditionalPromiseMethods(promise, expect, subject) {
 
     return promise;
 };
-
-module.exports = addAdditionalPromiseMethods;
diff --git a/lib/assertions.js b/lib/assertions.js
index b674e7d2..7a24ec7f 100644
--- a/lib/assertions.js
+++ b/lib/assertions.js
@@ -1545,9 +1545,7 @@ module.exports = function (expect) {
                 return a - b;
             };
         }
-        return expect.shift(Array.prototype.slice.call(subject).sort(
-            typeof compareFunction === 'function' ? compareFunction : undefined
-        ));
+        return expect.shift(Array.prototype.slice.call(subject).sort(compareFunction));
     });
 
     expect.addAssertion('<Promise> to be rejected', function (expect, subject) {
diff --git a/lib/throwIfNonUnexpectedError.js b/lib/throwIfNonUnexpectedError.js
index 3cbb202d..36afe6e7 100644
--- a/lib/throwIfNonUnexpectedError.js
+++ b/lib/throwIfNonUnexpectedError.js
@@ -1,4 +1,4 @@
-function throwIfNonUnexpectedError(err) {
+module.exports = function throwIfNonUnexpectedError(err) {
     if (err && err.message === 'aggregate error') {
         for (var i = 0 ; i < err.length ; i += 1) {
             throwIfNonUnexpectedError(err[i]);
@@ -7,5 +7,3 @@ function throwIfNonUnexpectedError(err) {
         throw err;
     }
 };
-
-module.exports = throwIfNonUnexpectedError;
diff --git a/package.json b/package.json
index 80a35aed..ad8933e8 100644
--- a/package.json
+++ b/package.json
@@ -20,7 +20,7 @@
     "update-examples": "generate-site --require ./bootstrap-unexpected-markdown.js --update-examples",
     "preversion": "test -n \"${IS_MAKE_RELEASE}\" || (echo Please run make release instead && exit 1)"
   },
-  "main": "./build/lib/index.js",
+  "main": "./lib/index.js",
   "dependencies": {
     "array-changes": "2.0.0",
     "array-changes-async": "3.0.0",
@@ -32,14 +32,12 @@
     "unexpected-bluebird": "2.9.34-longstack2"
   },
   "devDependencies": {
-    "babel-cli": "6.26.0",
-    "babel-preset-es2015-without-strict": "0.0.4",
+    "chewbacca": "1.10.0",
     "coveralls": "^2.11.9",
     "es5-shim": "4.0.5",
     "eslint": "2.13.1",
     "eslint-config-onelint": "1.2.0",
     "eslint-plugin-import": "1.16.0",
-    "find-node-modules": "1.0.4",
     "istanbul": "0.3.16",
     "jasmine": "2.2.1",
     "jasmine-core": "~2.2.0",
@@ -48,8 +46,7 @@
     "mocha": "^3.2.0",
     "mocha-phantomjs-core": "2.0.1",
     "mocha-slow-reporter": "*",
-    "node-version-check": "2.2.0",
-    "nyc": "10.3.2",
+    "nyc": "11.1.0",
     "rollup": "0.45.2",
     "rollup-plugin-commonjs": "8.0.2",
     "rollup-plugin-node-globals": "1.1.0",
@@ -57,20 +54,29 @@
     "rollup-plugin-uglify": "2.0.1",
     "rsvp": "3.0.18",
     "serve": "*",
-    "unexpected-documentation-site-generator": "^4.6.1",
+    "unexpected-documentation-site-generator": "^4.4.0",
     "unexpected-magicpen": "0.2.1",
-    "unexpected-markdown": "^1.7.4"
+    "unexpected-markdown": "^1.7.2"
   },
   "jspm": {
     "dependencies": {},
     "main": "unexpected.js",
     "jspmPackage": true
   },
+  "nyc": {
+    "include": [
+      "lib/**"
+    ]
+  },
   "jest": {
     "setupFiles": [
       "<rootDir>/test/promisePolyfill"
     ],
     "setupTestFrameworkScriptFile": "<rootDir>/test/common.js",
-    "testRegex": "<rootDir>/test\\/.*\\.spec\\.js$"
+    "testRegex": "test\\/.*\\.spec\\.js$",
+    "transformIgnorePatterns": [
+      "/node_modules/",
+      "/test/"
+    ]
   }
 }


Test patch:
diff --git a/externaltests/assertionSucceedsWhilePromiseIsPending.spec.js b/externaltests/assertionSucceedsWhilePromiseIsPending.spec.js
index 01f99974..d2190e77 100644
--- a/externaltests/assertionSucceedsWhilePromiseIsPending.spec.js
+++ b/externaltests/assertionSucceedsWhilePromiseIsPending.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+var expect = require('../');
 
 expect.addAssertion('<any> to bar', function (expect, subject) {
     expect(subject, 'to equal', 'bar');
diff --git a/externaltests/deepObject.spec.js b/externaltests/deepObject.spec.js
index 4e6a80e3..7e78ae91 100644
--- a/externaltests/deepObject.spec.js
+++ b/externaltests/deepObject.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+var expect = require('../');
 it('should not dot out the object in the diff', function () {
     expect(function () {
         expect({0: {0: {0: {0: {0: {0: {}}}}}}}, 'to equal', {});
diff --git a/externaltests/failingAsync.spec.js b/externaltests/failingAsync.spec.js
index 9f2e58ff..1f332bd7 100644
--- a/externaltests/failingAsync.spec.js
+++ b/externaltests/failingAsync.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+var expect = require('../');
 
 expect.addAssertion('<any> when delayed a little bit <assertion?>', function (expect, subject) {
     return expect.promise(function (run) {
diff --git a/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.spec.js b/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.spec.js
index 24c15759..75f334c6 100644
--- a/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.spec.js
+++ b/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+var expect = require('../');
 
 it('should call the callback', function () {
     expect(function () {}, 'to call the callback');
diff --git a/externaltests/forgotToReturnPendingPromiseFromItSuccessfulItBlock.spec.js b/externaltests/forgotToReturnPendingPromiseFromItSuccessfulItBlock.spec.js
index 191f2091..d7399125 100644
--- a/externaltests/forgotToReturnPendingPromiseFromItSuccessfulItBlock.spec.js
+++ b/externaltests/forgotToReturnPendingPromiseFromItSuccessfulItBlock.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+var expect = require('../');
 
 it('should call the callback', function () {
     expect(function () {}, 'to call the callback');
diff --git a/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.spec.js b/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.spec.js
index 191f2091..d7399125 100644
--- a/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.spec.js
+++ b/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+var expect = require('../');
 
 it('should call the callback', function () {
     expect(function () {}, 'to call the callback');
diff --git a/externaltests/forgotToReturnPromiseRejectedInTheNextTick.spec.js b/externaltests/forgotToReturnPromiseRejectedInTheNextTick.spec.js
index e0d0bdca..da10c605 100644
--- a/externaltests/forgotToReturnPromiseRejectedInTheNextTick.spec.js
+++ b/externaltests/forgotToReturnPromiseRejectedInTheNextTick.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+var expect = require('../');
 
 it('should fail', function () {
     expect.addAssertion('<any> to foo', function (expect, subject) {
diff --git a/externaltests/fullTrace.spec.js b/externaltests/fullTrace.spec.js
index 35d2a7bc..ca386c40 100644
--- a/externaltests/fullTrace.spec.js
+++ b/externaltests/fullTrace.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib').clone().use(require('./node_modules/unexpected-bogus/index.js'));
+var expect = require('../').clone().use(require('./node_modules/unexpected-bogus/index.js'));
 
 it('should fail with a full trace', function () {
     expect('abc', 'to be bogus');
diff --git a/externaltests/notToErrorCaughtError.spec.js b/externaltests/notToErrorCaughtError.spec.js
index d4ddb496..f025661f 100644
--- a/externaltests/notToErrorCaughtError.spec.js
+++ b/externaltests/notToErrorCaughtError.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+var expect = require('../');
 
 it('should foo', function () {
     return expect(function () {
diff --git a/externaltests/successful.spec.js b/externaltests/successful.spec.js
index 9e26605e..e25fc1fd 100644
--- a/externaltests/successful.spec.js
+++ b/externaltests/successful.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+var expect = require('../');
 
 it('should call the callback', function () {
     expect(true, 'to be true');
diff --git a/test/JasmineRunner.tpl.html b/test/JasmineRunner.tpl.html
index 9a0f734b..4dd66212 100644
--- a/test/JasmineRunner.tpl.html
+++ b/test/JasmineRunner.tpl.html
@@ -4,18 +4,18 @@
     <meta charset="utf-8">
     <title>Jasmine Spec Runner v2.2.0</title>
 
-    <link rel="stylesheet" href="../../node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
+    <link rel="stylesheet" href="../node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
 
-    <script src="../../node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
-    <script src="../../node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
+    <script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
+    <script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
     <script src="./support/jasmineHtmlMessages.js"></script>
-    <script src="../../node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
-    <script src="../../vendor/rsvp.js"></script>
+    <script src="../node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
+    <script src="../vendor/rsvp.js"></script>
     <script src="./promisePolyfill.js"></script>
     <script src="./support/jasmineSetup.js"></script>
 
-    <script src="../../unexpected.js"></script>
-    <script src="../../vendor/unexpected-magicpen.min.js"></script>
+    <script src="../unexpected.js"></script>
+    <script src="../vendor/unexpected-magicpen.min.js"></script>
     <script src="./common.js"></script>
 
     <!-- test files -->
diff --git a/test/api/inspect.spec.js b/test/api/inspect.spec.js
index e6758a22..041bd1d1 100644
--- a/test/api/inspect.spec.js
+++ b/test/api/inspect.spec.js
@@ -298,7 +298,8 @@ describe('inspect', function () {
             var foo = 'bar';
             var quux = 'baz';
             while (foo) {
-                foo = foo.substr(0, foo.length - 1);
+                foo = foo
+                    .substr(0, foo.length - 1);
             }
             return quux;
         }, 'to inspect as',
@@ -306,7 +307,8 @@ describe('inspect', function () {
                '  var foo = \'bar\';\n' +
                '  var quux = \'baz\';\n' +
                '  while (foo) {\n' +
-               '    foo = foo.substr(0, foo.length - 1);\n' +
+               '    foo = foo\n' +
+               '      .substr(0, foo.length - 1);\n' +
                '  }\n' +
                '  return quux;\n' +
                '}');
@@ -345,8 +347,8 @@ describe('inspect', function () {
 
     it('should bail out of removing the indentation of one-liner functions', function () {
         expect(function () {
-            var foo = 123;return foo;
-        }, 'to inspect as', 'function () { var foo = 123;return foo; }');
+            var foo = 123; return foo;
+        }, 'to inspect as', 'function () { var foo = 123; return foo; }');
     });
 
     it('should not show the body of a function with native code', function () {
diff --git a/test/assertions/to-be-fulfilled-with-value-satisfying.spec.js b/test/assertions/to-be-fulfilled-with-value-satisfying.spec.js
index da975b28..f00aa9d8 100644
--- a/test/assertions/to-be-fulfilled-with-value-satisfying.spec.js
+++ b/test/assertions/to-be-fulfilled-with-value-satisfying.spec.js
@@ -136,7 +136,11 @@ describe('to be fulfilled with value satisfying assertion', function () {
                     function () {
                         return expect(
                             function () {
-                                return Promise.resolve({ foo: 'foo', bar: 'bar', quux: 'quux' });
+                                return Promise.resolve({
+                                    foo: 'foo',
+                                    bar: 'bar',
+                                    quux: 'quux'
+                                });
                             },
                             'to be fulfilled with value exhaustively satisfying',
                             {
@@ -148,7 +152,11 @@ describe('to be fulfilled with value satisfying assertion', function () {
                     'to be rejected with',
                     "expected\n" +
                     "function () {\n" +
-                    "  return Promise.resolve({ foo: 'foo', bar: 'bar', quux: 'quux' });\n" +
+                    "  return Promise.resolve({\n" +
+                    "    foo: 'foo',\n" +
+                    "    bar: 'bar',\n" +
+                    "    quux: 'quux'\n" +
+                    "  });\n" +
                     "}\n" +
                     "to be fulfilled with value exhaustively satisfying { foo: 'foo', bar: 'bar' }\n" +
                     "  expected Promise (fulfilled) => { foo: 'foo', bar: 'bar', quux: 'quux' }\n" +
@@ -172,7 +180,8 @@ describe('to be fulfilled with value satisfying assertion', function () {
                         return expect.promise.resolve({
                             foo: 'foo',
                             bar: 'bar',
-                            quux: 'quux' });
+                            quux: 'quux'
+                        });
                     },
                     'to be fulfilled with value satisfying',
                     {
diff --git a/test/assertions/to-have-message.spec.js b/test/assertions/to-have-message.spec.js
index 45ca2a6a..6d11bd01 100644
--- a/test/assertions/to-have-message.spec.js
+++ b/test/assertions/to-have-message.spec.js
@@ -159,7 +159,8 @@ describe('to have message/diff assertion', function () {
                     expect(function () {
                         expect('abc', 'to equal', 'def');
                     }, 'to throw', expect.it('to have ansi diff', function () {
-                        this.red('-').text('abc').nl().green('+').text('def', ['bgGreen', 'black']);
+                        this.red('-').text('abc').nl()
+                            .green('+').text('def', ['bgGreen', 'black']);
                     }));
                 }, 'to throw',
                        "expected\n" +
@@ -168,7 +169,8 @@ describe('to have message/diff assertion', function () {
                        "}\n" +
                        "to throw\n" +
                        "expect.it('to have ansi diff', function () {\n" +
-                       "  this.red('-').text('abc').nl().green('+').text('def', ['bgGreen', 'black']);\n" +
+                       "  this.red('-').text('abc').nl()\n" +
+                       "    .green('+').text('def', ['bgGreen', 'black']);\n" +
                        "})\n" +
                        "  expected\n" +
                        "  UnexpectedError(\n" +
@@ -179,7 +181,8 @@ describe('to have message/diff assertion', function () {
                        "  )\n" +
                        "  to have ansi diff\n" +
                        "  function () {\n" +
-                       "    this.red('-').text('abc').nl().green('+').text('def', ['bgGreen', 'black']);\n" +
+                       "    this.red('-').text('abc').nl()\n" +
+                       "      .green('+').text('def', ['bgGreen', 'black']);\n" +
                        "  }\n" +
                        "    expected\n" +
                        "    magicpen('ansi')\n" +
diff --git a/test/assertions/to-satisfy.spec.js b/test/assertions/to-satisfy.spec.js
index 6ae24e0f..ace0eaae 100644
--- a/test/assertions/to-satisfy.spec.js
+++ b/test/assertions/to-satisfy.spec.js
@@ -1743,7 +1743,10 @@ describe('to satisfy assertion', function () {
             }, 'to throw', function (err) {
                 // Compensate for V8 5.1+ setting { foo: function () {} }.foo.name === 'foo'
                 // http://v8project.blogspot.dk/2016/04/v8-release-51.html
-                expect(err.getErrorMessage('text').toString().replace('function foo', 'function '), 'to contain',
+                expect(err.getErrorMessage('text').toString().replace('function foo', 'function '), 'to satisfy',
+                    "expected {}\n" +
+                    "to satisfy { foo: function (value) { expect(value, 'to be a string'); } }\n" +
+                    "\n" +
                     "{\n" +
                     "  // missing: foo: should be a string\n" +
                     "}"
diff --git a/test/benchmark.spec.js b/test/benchmark.spec.js
new file mode 100644
index 00000000..05c7ace5
--- /dev/null
+++ b/test/benchmark.spec.js
@@ -0,0 +1,72 @@
+/*global unexpected*/
+describe('benchmark:', function () {
+    var expect = unexpected.clone();
+
+    describe('to be truthy', function () {
+        it('on numbers', function () {
+            expect(42, 'to be truthy');
+        });
+
+        it('on strings', function () {
+            expect('foo', 'to be truthy');
+        });
+
+        it('on object', function () {
+            expect({ label: 'this is an object', list: [ 0, 1, 2]}, 'to be truthy');
+        });
+    });
+
+    describe('to be', function () {
+        it('on numbers', function () {
+            expect(42, "to be", 42);
+        });
+
+        it('on strings', function () {
+            expect(42, "to be", 42);
+        });
+
+        it('on same object', function () {
+            var obj = { label: 'this is an object', list: [ 0, 1, 2]};
+            expect(obj, "to be", obj);
+        });
+    });
+
+    describe('to equal', function () {
+        it('on numbers', function () {
+            expect(42, "to equal", 42);
+        });
+
+        it('on strings', function () {
+            expect("foo", "to equal", "foo");
+        });
+
+        it('on objects', function () {
+            expect({ label: 'this is an object', list: [ 0, 1, 2]},
+                   "to equal",
+                   { label: 'this is an object', list: [ 0, 1, 2]});
+        });
+
+        it('on same object', function () {
+            var obj = { label: 'this is an object', list: [ 0, 1, 2]};
+            expect(obj, "to equal", obj);
+        });
+    });
+
+    describe('to match', function () {
+        it('on a small string', function () {
+            expect('foobarbaz', 'to match', /ba./g);
+        });
+    });
+
+    describe('to satisfy', function () {
+        it('on objects', function () {
+            expect({ label: 'this is an object', list: [ 0, 1, 2]},
+                   "to satisfy",
+                   { label: /object/, list: { 0: 0 }});
+        });
+    });
+
+    it('to call the callback async', function () {
+        return expect(setImmediate, 'to call the callback');
+    });
+});
diff --git a/test/common.js b/test/common.js
index 43f3e541..a12faed0 100644
--- a/test/common.js
+++ b/test/common.js
@@ -1,4 +1,4 @@
-/*global unexpected:true, expect:true, expectWithUnexpectedMagicPen:true, setImmediate:true, weknowhow, jasmine*/
+/*global unexpected:true, expect:true, expectWithUnexpectedMagicPen:true, setImmediate:true, weknowhow*/
 /* eslint no-unused-vars: "off" */
 unexpected = typeof weknowhow === 'undefined' ?
     require('../lib/').clone() :
@@ -34,7 +34,3 @@ if (typeof setImmediate !== 'function') {
         setTimeout(cb, 0);
     };
 }
-
-if (typeof jasmine !== 'undefined') {
-    jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
-}
diff --git a/test/external.spec.js b/test/external.spec.js
index 7346f16c..e8640d23 100644
--- a/test/external.spec.js
+++ b/test/external.spec.js
@@ -4,11 +4,9 @@ var expect = unexpected.clone();
 
 if (typeof process === 'object') {
     describe('invoked in a test via an external test runner', function () {
-        var findNodeModules = require('find-node-modules');
         var pathModule = require('path');
         var childProcess = require('child_process');
-        var basePath = pathModule.join(findNodeModules()[0], '..');
-        var externaltestsDir = pathModule.join(__dirname, '..', 'externaltests');
+        var basePath = pathModule.resolve(__dirname, '..');
         var extend = require('../lib/utils').extend;
         describe('executed through mocha', function () {
             expect.addAssertion('<array|string> executed through mocha <object?>', function (expect, subject, env) {
@@ -16,9 +14,9 @@ if (typeof process === 'object') {
                     subject = [subject];
                 }
                 return expect.promise(function (run) {
-                    childProcess.execFile(pathModule.resolve(basePath, 'node_modules', '.bin', 'mocha'), ['--opts', 'mocha.opts'].concat(subject.map(function (fileName) {
-                        return pathModule.resolve(externaltestsDir, fileName + '.spec.js');
-                    })), {
+                    childProcess.execFile(pathModule.resolve(basePath, 'node_modules', '.bin', 'mocha'), subject.map(function (fileName) {
+                        return pathModule.resolve(basePath, 'externaltests', fileName + '.spec.js');
+                    }), {
                         cwd: basePath,
                         env: extend({}, process.env, env || {})
                     }, run(function (err, stdout, stderr) {
@@ -118,10 +116,10 @@ if (typeof process === 'object') {
         describe('executed through jasmine', function () {
             expect.addAssertion('<string> executed through jasmine', function (expect, subject) {
                 return expect.promise(function (run) {
-                    childProcess.execFile(pathModule.resolve(basePath, 'node_modules', '.bin', 'jasmine'), {
-                        cwd: pathModule.join(externaltestsDir, '..'),
+                    childProcess.execFile(pathModule.resolve(__dirname, '..', 'node_modules', '.bin', 'jasmine'), {
+                        cwd: basePath,
                         env: extend({}, process.env, {
-                            JASMINE_CONFIG_PATH: externaltestsDir + '/' + subject + '.jasmine.json'
+                            JASMINE_CONFIG_PATH: 'externaltests/' + subject + '.jasmine.json'
                         })
                     }, run(function (err, stdout, stderr) {
                         return [err, stdout, stderr];
@@ -167,9 +165,9 @@ if (typeof process === 'object') {
                     }
                     return expect.promise(function (run) {
                         childProcess.execFile(pathModule.resolve(basePath, 'node_modules', '.bin', 'jest'), [
-                            '--config', pathModule.resolve(externaltestsDir, 'jestconfig.json')
+                            '--config', pathModule.resolve(basePath, 'externaltests', 'jestconfig.json')
                         ].concat(subject.map(function (fileName) {
-                            return pathModule.resolve(externaltestsDir, fileName + '.spec.js');
+                            return pathModule.resolve(__dirname, '..', 'externaltests', fileName + '.spec.js');
                         })), {
                             cwd: basePath,
                             env: extend({}, process.env, env || {})
diff --git a/test/jest.es5.config.json b/test/jest.es5.config.json
deleted file mode 100644
index 5206e6fa..00000000
--- a/test/jest.es5.config.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-    "setupFiles": [
-        "<rootDir>/build/test/promisePolyfill"
-    ],
-    "setupTestFrameworkScriptFile": "<rootDir>/build/test/common.js",
-    "testRegex": "<rootDir>/build/test\\/.*\\.spec\\.js$"
-}
diff --git a/test/tests.tpl.html b/test/tests.tpl.html
index 8ebeb8af..28676403 100644
--- a/test/tests.tpl.html
+++ b/test/tests.tpl.html
@@ -2,20 +2,20 @@
   <head>
     <title>Mocha</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    <link rel="stylesheet" href="../../vendor/mocha.css" />
+    <link rel="stylesheet" href="../vendor/mocha.css" />
   </head>
   <body>
     <div id="mocha"></div>
-    <script src="../../vendor/es5-shim.js"></script>
-    <script src="../../vendor/es5-sham.js"></script>
-    <script src="../../vendor/rsvp.js"></script>
+    <script src="../vendor/es5-shim.js"></script>
+    <script src="../vendor/es5-sham.js"></script>
+    <script src="../vendor/rsvp.js"></script>
     <script src="./promisePolyfill.js"></script>
-    <script src="../../vendor/mocha.js"></script>
+    <script src="../vendor/mocha.js"></script>
     <script>mocha.setup('bdd')</script>
 
-    <script src="../../unexpected.js"></script>
-    <script src="../../vendor/unexpected-magicpen.min.js"></script>
-    <script src="./common.js"></script>
+    <script src="../unexpected.js"></script>
+    <script src="../vendor/unexpected-magicpen.min.js"></script>
+    <script src="common.js"></script>
 
     <!-- test files -->
 
diff --git a/test/types/Symbol-type.spec.js b/test/types/Symbol-type.spec.js
index 021a0dd3..75143c51 100644
--- a/test/types/Symbol-type.spec.js
+++ b/test/types/Symbol-type.spec.js
@@ -1,6 +1,5 @@
 /*global expect, Symbol*/
-// babel-polyfill's implementation of Symbol serializes very wonkily, so skip these tests when it's active:
-if (typeof Symbol === 'function' && Symbol('foo').toString() === 'Symbol(foo)') {
+if (typeof Symbol === 'function') {
     describe('Symbol type', function () {
         var symbolA = Symbol('a');
         var anotherSymbolA = Symbol('a');
diff --git a/test/types/function-type.spec.js b/test/types/function-type.spec.js
index 031d021f..d9531cbe 100644
--- a/test/types/function-type.spec.js
+++ b/test/types/function-type.spec.js
@@ -59,17 +59,17 @@ describe('function type', function () {
     it('should inspect a one-line function correctly', function () {
         /* eslint-disable no-unused-vars */
         expect(function () {
-            var a = 123;a = 456;
-        }, 'to inspect as', 'function () { var a = 123;a = 456; }');
+            var a = 123; a = 456;
+        }, 'to inspect as', 'function () { var a = 123; a = 456; }');
         /* eslint-enable no-unused-vars */
     });
 
     it('should inspect a short one-line function with leading and trailing newline correctly', function () {
         /* eslint-disable no-unused-vars */
         expect(function () {
-            var a = 123;a = 456;
+            var a = 123; a = 456;
         }, 'to inspect as',
-               'function () { var a = 123;a = 456; }'
+               'function () { var a = 123; a = 456; }'
               );
         /* eslint-enable no-unused-vars */
     });
@@ -77,10 +77,10 @@ describe('function type', function () {
     it('should inspect a long one-line function with leading and trailing newline correctly', function () {
         /* eslint-disable no-unused-vars */
         expect(function () {
-            var a = 123 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;a = 456;
+            var a = 123 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2; a = 456;
         }, 'to inspect as',
                'function () {\n' +
-               '  var a = 123 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;a = 456;\n' +
+               '  var a = 123 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2; a = 456;\n' +
                '}'
               );
       /* eslint-enable no-unused-vars */
@@ -98,10 +98,10 @@ describe('function type', function () {
         it('should inspect a short one-line function with leading and trailing newline correctly and a C++-style comment correctly', function () {
             /* eslint-disable no-unused-vars */
             expect(function () {
-                var a = 123;a = 456; // foo
+                var a = 123; a = 456; // foo
             }, 'to inspect as',
                    'function () {\n' +
-                   '  var a = 123;a = 456; // foo\n' +
+                   '  var a = 123; a = 456; // foo\n' +
                    '}'
                   );
             /* eslint-enable no-unused-vars */