Repository: unexpectedjs/unexpected
Pull request #773 (2020-11-18 21:37:09)

Require node.js 10+, update dependencies


Patch:
diff --git a/.eslintignore b/.eslintignore
index 294de9f1..48dcd5ac 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -2,6 +2,7 @@
 /build/
 /vendor/
 /coverage/
+/.nyc_output/
 /site-build/
 /unexpected.js
 /unexpected.esm.js
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 00000000..6b8fd35f
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,54 @@
+name: Tests
+'on':
+  push:
+  pull_request:
+
+env:
+  BROWSER_STACK_ACCESS_KEY: '${{ secrets.BROWSER_STACK_ACCESS_KEY }}'
+  BROWSER_STACK_USERNAME: '${{ secrets.BROWSER_STACK_USERNAME }}'
+
+jobs:
+  test:
+    runs-on: ubuntu-18.04
+    name: Node ${{ matrix.node }}
+    strategy:
+      matrix:
+        node:
+          - '10'
+          - '12'
+          - '14'
+    steps:
+      - uses: actions/checkout@v2
+      - name: Setup node
+        uses: actions/setup-node@v1
+        with:
+          node-version: ${{ matrix.node }}
+      - run: npm install
+      - run: make test
+
+  test-targets:
+    runs-on: ubuntu-18.04
+    name: ${{ matrix.targets.name }}
+    strategy:
+      matrix:
+        targets:
+          - target: 'coverage'
+            name: 'Coverage'
+          - target: 'test-jest'
+            name: 'Jest'
+          - target: 'test-jasmine'
+            name: 'Jasmine'
+          - target: 'test-plugins'
+            name: 'Plugins'
+          - target: 'test-browserstack-ie11'
+            name: 'Browser - IE11'
+          - target: 'test-deno'
+            name: 'Deno'
+    steps:
+      - uses: actions/checkout@v2
+      - name: Setup node
+        uses: actions/setup-node@v1
+        with:
+          node-version: '14'
+      - run: npm install
+      - run: make ${{ matrix.targets.target }}
diff --git a/.mocharc.json b/.mocharc.json
new file mode 100644
index 00000000..09901b1b
--- /dev/null
+++ b/.mocharc.json
@@ -0,0 +1,7 @@
+{
+  "reporter": "spec",
+  "recursive": true,
+  "check-leaks": true,
+  "timeout": 20000,
+  "require": ["./test/common", "./test/promisePolyfill"]
+}
diff --git a/.prettierignore b/.prettierignore
index 9904e031..3e955907 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,6 +1,7 @@
 /build/
 /vendor/
 /coverage/
+/.nyc_output/
 /site-build/
 /unexpected.js
 /unexpected.esm.js
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 7d126299..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-language: node_js
-
-env:
-  - TARGET=travis
-
-node_js:
-  - 6
-  - 8
-  - 9
-  - 10
-  - 12
-
-matrix:
-  include:
-    - name: Lint (12)
-      node_js: 12
-      env: TARGET=lint
-    - name: Jest (12)
-      node_js: 12
-      env: TARGET=test-jest
-    - name: Jasmine (12)
-      node_js: 12
-      env: TARGET=test-jasmine
-    - name: Coverage (12)
-      node_js: 12
-      env: TARGET=travis-coverage
-    - name: Plugins (12)
-      node_js: 12
-      env: TARGET=test-plugins
-    - name: BrowserStack IE11
-      node_js: 12
-      env: TARGET=test-browserstack-ie11
-    - name: Chrome headless
-      node_js: 12
-      env: TARGET=test-chrome-headless
-    - name: Deno
-      node_js: 12
-      env: TARGET=test-deno
-
-addons:
-  chrome: stable
-
-script: make $TARGET
diff --git a/Makefile b/Makefile
index d312875c..00b9995f 100644
--- a/Makefile
+++ b/Makefile
@@ -4,12 +4,8 @@ TARGETS ?= unexpected.js unexpected.js.map unexpected.esm.js unexpected.esm.js.m
 .PHONY: unexpected.js unexpected.esm.js
 .SECONDARY: unexpected.js.map unexpected.esm.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
 
@@ -22,8 +18,8 @@ build/lib: lib/*
 build/test: $(shell find test -type f)
 	mkdir -p ./build
 	./node_modules/.bin/buble -o build/test test
-	cp ./test/mocha.opts ./build/test/mocha.opts
-	sed -i -e 's#--require ./test#--require ./build/test#g' ./build/test/mocha.opts
+	cp ./.mocharc.json ./build/test/.mocharc.json
+	sed -i -e 's#./test#./build/test#g' ./build/test/.mocharc.json
 
 build/externaltests: externaltests/*
 	./node_modules/.bin/buble -o build/externaltests externaltests
@@ -43,50 +39,28 @@ unexpected.esm.js unexpected.esm.js.map: build
 test-jasmine:
 	./node_modules/.bin/jasmine JASMINE_CONFIG_PATH=test/support/jasmine.json
 
-ifeq ($(MODERN_NODE), true)
-MOCHA_OPTS = ./test/mocha.opts
+MOCHA_CONFIG = .mocharc.json
 TEST_SOURCES = $(shell find test -name '*.spec.js')
-else
-MOCHA_OPTS = ./build/test/mocha.opts
-TEST_SOURCES = $(shell find build/test -name '*.spec.js')
-endif
-
-test-sources:
-ifneq ($(MODERN_NODE), true)
-	make build
-endif
 
 .PHONY: test-jest
 test-jest:
-ifeq ($(MODERN_NODE), true)
 	./node_modules/.bin/jest
-else
-	./node_modules/.bin/jest --rootDir . -c test/jest.es5.config.json
-endif
 
 .PHONY: test
-test: test-sources
-	@./node_modules/.bin/mocha --opts $(MOCHA_OPTS) $(TEST_SOURCES)
+test:
+	@./node_modules/.bin/mocha --config $(MOCHA_CONFIG) $(TEST_SOURCES)
 	make test-docs
 
 .PHONY: test-docs
 test-docs:
-ifeq ($(MODERN_NODE), true)
 	@./node_modules/.bin/evaldown --comment-marker unexpected-markdown --require ./bootstrap-unexpected-markdown.js --validate --reporter spec ./documentation
-else
-	echo "testing documentation is not supported on this version of node"
-endif
 
 nyc-includes:
-ifeq ($(MODERN_NODE), true)
 NYC_INCLUDES='lib/**'
-else
-NYC_INCLUDES='build/lib/**'
-endif
 
 .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)
+coverage: nyc-includes
+	@./node_modules/.bin/nyc --include $(NYC_INCLUDES) --reporter=lcov --reporter=text --all -- node_modules/.bin/mocha --config $(MOCHA_CONFIG) $(TEST_SOURCES)
 	@echo google-chrome coverage/lcov-report/index.html
 
  .PHONY: test-browser
diff --git a/README.md b/README.md
index 64e02a54..5413264b 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
 Extensible BDD assertion toolkit
 
 [![NPM version](https://badge.fury.io/js/unexpected.svg)](http://badge.fury.io/js/unexpected)
-[![Build Status](https://travis-ci.org/unexpectedjs/unexpected.svg?branch=master)](https://travis-ci.org/unexpectedjs/unexpected)
+[![Build Status](https://github.com/unexpectedjs/unexpected/workflows/build/badge.svg)](https://travis-ci.org/unexpectedjs/unexpected)
 [![Coverage Status](https://coveralls.io/repos/unexpectedjs/unexpected/badge.svg)](https://coveralls.io/r/unexpectedjs/unexpected)
 [![Dependency Status](https://david-dm.org/unexpectedjs/unexpected.svg)](https://david-dm.org/unexpectedjs/unexpected)
 [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/unexpectedjs/unexpected?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
diff --git a/bower.json b/bower.json
index 37aeae1e..0d20dbfc 100644
--- a/bower.json
+++ b/bower.json
@@ -1,15 +1,9 @@
 {
   "name": "unexpected",
-  "authors": [
-    "Sune Simonsen <sune@we-knowhow.dk>"
-  ],
+  "authors": ["Sune Simonsen <sune@we-knowhow.dk>"],
   "description": "The extensible BDD assertion toolkit",
   "main": "unexpected.js",
-  "moduleType": [
-    "amd",
-    "globals",
-    "node"
-  ],
+  "moduleType": ["amd", "globals", "node"],
   "keywords": [
     "assert",
     "expect",
diff --git a/documentation/api/UnexpectedError.md b/documentation/api/UnexpectedError.md
index c15fa041..2b8d5b52 100644
--- a/documentation/api/UnexpectedError.md
+++ b/documentation/api/UnexpectedError.md
@@ -31,15 +31,15 @@ expect.addAssertion('<array> to have item satisfying <any+>', function (
   expect,
   subject
 ) {
-  var args = Array.prototype.slice.call(arguments, 2);
-  var promises = subject.map(function (item) {
+  const args = Array.prototype.slice.call(arguments, 2);
+  const promises = subject.map(function (item) {
     return expect.promise(function () {
       return expect.apply(expect, [item].concat(args));
     });
   });
 
   return expect.promise.settle(promises).then(function () {
-    var failed = promises.every(function (promise) {
+    const failed = promises.every(function (promise) {
       return promise.isRejected();
     });
 
@@ -51,7 +51,7 @@ expect.addAssertion('<array> to have item satisfying <any+>', function (
             if (index > 0) {
               output.nl(2);
             }
-            var error = promise.reason();
+            const error = promise.reason();
             // the error is connected to the current scope
             // but we are just interested in the nested error
             error.errorMode = 'bubble';
@@ -168,7 +168,7 @@ expect.addAssertion('<any> to be completely custom', function (
       expect(subject, 'to satisfy', { custom: true });
     },
     function (err) {
-      var createDiff = err.getDiffMethod();
+      const createDiff = err.getDiffMethod();
       expect.fail({
         diff: function (output, diff, inspect, equal) {
           output
diff --git a/documentation/api/addAssertion.md b/documentation/api/addAssertion.md
index ed418775..7b07a714 100644
--- a/documentation/api/addAssertion.md
+++ b/documentation/api/addAssertion.md
@@ -264,7 +264,7 @@ value's type definition. For instance, this can be used to define optional
 `function` values:
 
 ```js
-var errorMode = 'default'; // use to control the error mode in later examples
+const errorMode = 'default'; // use to control the error mode in later examples
 expect.addAssertion(
   '<array> [not] to be (sorted|ordered) [by] <function?>',
   function (expect, subject, cmp) {
@@ -483,7 +483,7 @@ function Timelock(value, delay) {
 }
 
 Timelock.prototype.getValue = function (cb) {
-  var that = this;
+  const that = this;
   setTimeout(function () {
     cb(that.value);
   }, this.delay);
diff --git a/documentation/api/addStyle.md b/documentation/api/addStyle.md
index 1fad9dd3..223aca86 100644
--- a/documentation/api/addStyle.md
+++ b/documentation/api/addStyle.md
@@ -19,8 +19,8 @@ expect.addStyle('jsString', function (text, rainbowColors) {
     'magenta',
     'cyan',
   ];
-  for (var i = 0; i < text.length; i += 1) {
-    var color = rainbowColors[i % rainbowColors.length];
+  for (let i = 0; i < text.length; i += 1) {
+    const color = rainbowColors[i % rainbowColors.length];
     this.text(text[i], color);
   }
 });
diff --git a/documentation/api/addType.md b/documentation/api/addType.md
index 12d62c44..010be799 100644
--- a/documentation/api/addType.md
+++ b/documentation/api/addType.md
@@ -256,7 +256,7 @@ expect = originalExpect;
 ```
 
 ```js
-var inlineDiff = true; // used to change inlining in a later example
+const inlineDiff = true; // used to change inlining in a later example
 
 expect.addType({
   name: 'Person',
@@ -277,7 +277,7 @@ expect.addType({
   },
   diff: function (actual, expected, output, diff, inspect) {
     output.inline = inlineDiff;
-    var nameDiff = diff(actual.name, expected.name);
+    const nameDiff = diff(actual.name, expected.name);
 
     output.text('new Person(').nl().indentLines();
 
diff --git a/documentation/api/child.md b/documentation/api/child.md
index ed502fdb..2499ad6d 100644
--- a/documentation/api/child.md
+++ b/documentation/api/child.md
@@ -18,7 +18,7 @@ methods. These methods have the same signature as `addAssertion`, `addType`,
 and `addStyle`, respectively, but affect the parent `expect`:
 
 ```js
-var childExpect = expect.child();
+const childExpect = expect.child();
 
 // Only available in childExpect:
 childExpect.addAssertion('<string> to begin with foo', function (
@@ -50,7 +50,7 @@ Note that in order to reference a type in the signature used with
 In other words, this won't work:
 
 ```js
-var childExpect = expect.child();
+const childExpect = expect.child();
 
 childExpect.addType({
   name: 'foosomething',
diff --git a/documentation/api/clone.md b/documentation/api/clone.md
index f0ba7083..f93e32d7 100644
--- a/documentation/api/clone.md
+++ b/documentation/api/clone.md
@@ -8,7 +8,7 @@ Adding new functionality to the cloned instance will not affect the
 original instance:
 
 ```js
-var clonedExpect = expect
+const clonedExpect = expect
   .clone()
   .addAssertion('<number> to be an integer', function (expect, subject) {
     expect(Math.round(subject), 'to be', subject);
diff --git a/documentation/api/fail.md b/documentation/api/fail.md
index 1731103a..1efce694 100644
--- a/documentation/api/fail.md
+++ b/documentation/api/fail.md
@@ -31,7 +31,7 @@ In case you want to rethrow an error, you should always use
 for the different error modes.
 
 ```js
-var error = new Error('throw me');
+const error = new Error('throw me');
 expect.fail(new Error(error));
 ```
 
@@ -50,7 +50,7 @@ expect.fail(function (output) {
     if (index > 0) {
       output.sp();
     }
-    var style = index % 2 === 0 ? 'jsPrimitive' : 'jsString';
+    const style = index % 2 === 0 ? 'jsPrimitive' : 'jsString';
     output[style](word);
   });
 });
@@ -70,7 +70,7 @@ expect.fail({
       if (index > 0) {
         output.sp();
       }
-      var style = index % 2 === 0 ? 'jsPrimitive' : 'jsString';
+      const style = index % 2 === 0 ? 'jsPrimitive' : 'jsString';
       output[style](word);
     });
   },
diff --git a/documentation/api/promise-any.md b/documentation/api/promise-any.md
index 4e9e9046..b2905126 100644
--- a/documentation/api/promise-any.md
+++ b/documentation/api/promise-any.md
@@ -77,8 +77,8 @@ return expect.promise
     // Let's reformat the error a bit
     expect.fail(function (output) {
       output.error(aggregateError.message);
-      var errors = [];
-      for (var i = 0; i < aggregateError.length; i += 1) {
+      const errors = [];
+      for (let i = 0; i < aggregateError.length; i += 1) {
         aggregateError[i].serializeMessage(expect.outputFormat());
         errors.push(aggregateError[i]);
       }
diff --git a/documentation/api/promise-settle.md b/documentation/api/promise-settle.md
index 47796a58..0ab535f5 100644
--- a/documentation/api/promise-settle.md
+++ b/documentation/api/promise-settle.md
@@ -38,7 +38,7 @@ is rejected it create an error report with the details.
 <!-- unexpected-markdown async:true -->
 
 ```js
-var promises = {
+const promises = {
   foo: expect('42', 'to be a number after a short delay'),
   bar: expect(
     [0, 1, 2],
diff --git a/documentation/api/promise.md b/documentation/api/promise.md
index a06c72d0..9904a29b 100644
--- a/documentation/api/promise.md
+++ b/documentation/api/promise.md
@@ -23,7 +23,7 @@ the following way:
 <!-- unexpected-markdown evaluate:false -->
 
 ```js
-var promises = items.map(function (item) {
+const promises = items.map(function (item) {
   return expect.promise(function () {
     expect(item, 'to be a number');
   });
diff --git a/documentation/api/shift.md b/documentation/api/shift.md
index 7544d8e3..de5da100 100644
--- a/documentation/api/shift.md
+++ b/documentation/api/shift.md
@@ -61,9 +61,9 @@ expect.addAssertion(
   '<number> up to [and including] <number> <assertion?>',
   function (expect, subject, value) {
     expect.errorMode = 'nested';
-    var numbers = [];
+    const numbers = [];
     for (
-      var i = subject;
+      let i = subject;
       i < (expect.flags['and including'] ? value + 1 : value);
       i += 1
     ) {
diff --git a/documentation/assertions/Promise/to-be-fulfilled-with-value-satisfying.md b/documentation/assertions/Promise/to-be-fulfilled-with-value-satisfying.md
index 3273a75f..47b5977e 100644
--- a/documentation/assertions/Promise/to-be-fulfilled-with-value-satisfying.md
+++ b/documentation/assertions/Promise/to-be-fulfilled-with-value-satisfying.md
@@ -3,7 +3,7 @@ Asserts that a promise is fulfilled with a specific value:
 <!-- unexpected-markdown async:true -->
 
 ```js
-var promiseThatWillBeFulfilledWithAValue = new Promise(function (
+const promiseThatWillBeFulfilledWithAValue = new Promise(function (
   resolve,
   reject
 ) {
diff --git a/documentation/assertions/Promise/to-be-fulfilled-with.md b/documentation/assertions/Promise/to-be-fulfilled-with.md
index 68ee5162..c16f49c2 100644
--- a/documentation/assertions/Promise/to-be-fulfilled-with.md
+++ b/documentation/assertions/Promise/to-be-fulfilled-with.md
@@ -3,7 +3,7 @@ Asserts that a promise is fulfilled with a specific value:
 <!-- unexpected-markdown async:true -->
 
 ```js
-var promiseThatWillBeFulfilledWithAValue = new Promise(function (
+const promiseThatWillBeFulfilledWithAValue = new Promise(function (
   resolve,
   reject
 ) {
diff --git a/documentation/assertions/Promise/to-be-fulfilled.md b/documentation/assertions/Promise/to-be-fulfilled.md
index d0b049e5..18b78e5c 100644
--- a/documentation/assertions/Promise/to-be-fulfilled.md
+++ b/documentation/assertions/Promise/to-be-fulfilled.md
@@ -3,7 +3,7 @@ Asserts that a promise is fulfilled.
 <!-- unexpected-markdown async:true -->
 
 ```js
-var promiseThatWillBeFulfilled = new Promise(function (resolve, reject) {
+const promiseThatWillBeFulfilled = new Promise(function (resolve, reject) {
   setTimeout(resolve, 1);
 });
 
@@ -15,7 +15,7 @@ If the promise is rejected, the assertion will fail with the following output:
 <!-- unexpected-markdown async:true -->
 
 ```js
-var rejectedPromise = new Promise(function (resolve, reject) {
+const rejectedPromise = new Promise(function (resolve, reject) {
   setTimeout(function () {
     reject(new Error('argh'));
   }, 1);
diff --git a/documentation/assertions/Promise/to-be-rejected-with-error-satisfying.md b/documentation/assertions/Promise/to-be-rejected-with-error-satisfying.md
index d8b7ffb2..e8db98d1 100644
--- a/documentation/assertions/Promise/to-be-rejected-with-error-satisfying.md
+++ b/documentation/assertions/Promise/to-be-rejected-with-error-satisfying.md
@@ -3,7 +3,7 @@ Asserts that a promise is rejected with a specific reason (error):
 <!-- unexpected-markdown async:true -->
 
 ```js
-var promiseThatWillBeRejectedWithAReason = new Promise(function (
+const promiseThatWillBeRejectedWithAReason = new Promise(function (
   resolve,
   reject
 ) {
@@ -26,7 +26,7 @@ values supported by `to satisfy`:
 <!-- unexpected-markdown async:true -->
 
 ```js
-var promiseThatWillBeRejectedWithAReason = new Promise(function (
+const promiseThatWillBeRejectedWithAReason = new Promise(function (
   resolve,
   reject
 ) {
@@ -47,7 +47,7 @@ You get a nice diff if the assertion fails:
 <!-- unexpected-markdown async:true -->
 
 ```js
-var promiseThatWillBeRejectedWithAReason = new Promise(function (
+const promiseThatWillBeRejectedWithAReason = new Promise(function (
   resolve,
   reject
 ) {
@@ -81,7 +81,7 @@ You can use the `exhaustively` flag to use strict
 <!-- unexpected-markdown async:true -->
 
 ```js
-var error = new Error('Oh dear');
+const error = new Error('Oh dear');
 error.data = { foo: 'bar' };
 return expect(
   Promise.reject(error),
diff --git a/documentation/assertions/Promise/to-be-rejected-with.md b/documentation/assertions/Promise/to-be-rejected-with.md
index 07f1f8c6..6aa4f79e 100644
--- a/documentation/assertions/Promise/to-be-rejected-with.md
+++ b/documentation/assertions/Promise/to-be-rejected-with.md
@@ -3,7 +3,7 @@ Asserts that a promise is rejected with a specific reason (error):
 <!-- unexpected-markdown async:true -->
 
 ```js
-var promiseThatWillBeRejectedWithAReason = new Promise(function (
+const promiseThatWillBeRejectedWithAReason = new Promise(function (
   resolve,
   reject
 ) {
@@ -26,7 +26,7 @@ values supported by `to satisfy`:
 <!-- unexpected-markdown async:true -->
 
 ```js
-var promiseThatWillBeRejectedWithAReason = new Promise(function (
+const promiseThatWillBeRejectedWithAReason = new Promise(function (
   resolve,
   reject
 ) {
@@ -47,7 +47,7 @@ You get a nice diff if the assertion fails:
 <!-- unexpected-markdown async:true -->
 
 ```js
-var promiseThatWillBeRejectedWithAReason = new Promise(function (
+const promiseThatWillBeRejectedWithAReason = new Promise(function (
   resolve,
   reject
 ) {
diff --git a/documentation/assertions/Promise/to-be-rejected.md b/documentation/assertions/Promise/to-be-rejected.md
index a9700832..357865c8 100644
--- a/documentation/assertions/Promise/to-be-rejected.md
+++ b/documentation/assertions/Promise/to-be-rejected.md
@@ -3,7 +3,7 @@ Asserts that a promise is rejected.
 <!-- unexpected-markdown async:true -->
 
 ```js
-var promiseThatWillBeRejected = new Promise(function (resolve, reject) {
+const promiseThatWillBeRejected = new Promise(function (resolve, reject) {
   setTimeout(reject, 1);
 });
 
@@ -15,7 +15,7 @@ If the promise is fulfilled, the assertion will fail with the following output:
 <!-- unexpected-markdown async:true -->
 
 ```js
-var fulfilledPromise = new Promise(function (resolve, reject) {
+const fulfilledPromise = new Promise(function (resolve, reject) {
   setTimeout(resolve, 1);
 });
 
diff --git a/documentation/assertions/Promise/when-fulfilled.md b/documentation/assertions/Promise/when-fulfilled.md
index bb4fcfbb..1ce1ec4c 100644
--- a/documentation/assertions/Promise/when-fulfilled.md
+++ b/documentation/assertions/Promise/when-fulfilled.md
@@ -3,7 +3,7 @@ Wait for a promise to be fulfilled, then delegate the value to another assertion
 <!-- unexpected-markdown async:true -->
 
 ```js
-var fulfilledPromise = new Promise(function (resolve, reject) {
+const fulfilledPromise = new Promise(function (resolve, reject) {
   setTimeout(function () {
     resolve(123);
   }, 1);
@@ -29,7 +29,7 @@ If the response is rejected, the assertion fails with the following output:
 <!-- unexpected-markdown async:true -->
 
 ```js
-var rejectedPromise = new Promise(function (resolve, reject) {
+const rejectedPromise = new Promise(function (resolve, reject) {
   setTimeout(function () {
     reject(new Error('argh'));
   }, 1);
diff --git a/documentation/assertions/Promise/when-rejected.md b/documentation/assertions/Promise/when-rejected.md
index 220bd3bd..309a67a8 100644
--- a/documentation/assertions/Promise/when-rejected.md
+++ b/documentation/assertions/Promise/when-rejected.md
@@ -3,7 +3,7 @@ Wait for a promise to be rejected, then delegate the reason to another assertion
 <!-- unexpected-markdown async:true -->
 
 ```js
-var rejectedPromise = new Promise(function (resolve, reject) {
+const rejectedPromise = new Promise(function (resolve, reject) {
   setTimeout(function () {
     reject(new Error('argh'));
   }, 1);
diff --git a/documentation/assertions/any/to-be.md b/documentation/assertions/any/to-be.md
index 6475de13..fa5e53e3 100644
--- a/documentation/assertions/any/to-be.md
+++ b/documentation/assertions/any/to-be.md
@@ -1,7 +1,7 @@
 Asserts equality using `Object.is`/the [SameValue](http://ecma-international.org/ecma-262/5.1/#sec-9.12) algorithm.
 
 ```js
-var obj = {};
+const obj = {};
 expect(obj, 'to be', obj);
 expect(1, 'to be', 1);
 expect(null, 'to be', null);
diff --git a/documentation/assertions/any/to-equal.md b/documentation/assertions/any/to-equal.md
index 615c2da9..cc8cae68 100644
--- a/documentation/assertions/any/to-equal.md
+++ b/documentation/assertions/any/to-equal.md
@@ -2,7 +2,7 @@ Asserts deep equality.
 
 ```js
 expect({ a: 'b' }, 'to equal', { a: 'b' });
-var now = new Date();
+const now = new Date();
 expect(now, 'to equal', now);
 expect(now, 'to equal', new Date(now.getTime()));
 expect({ now: now }, 'to equal', { now: now });
@@ -99,8 +99,8 @@ This assertion can be negated using the `not` flag:
 expect(1, 'not to equal', '1');
 expect({ one: 1 }, 'not to equal', { one: '1' });
 expect(null, 'not to equal', '1');
-var now = new Date();
-var later = new Date(now.getTime() + 42);
+const now = new Date();
+const later = new Date(now.getTime() + 42);
 expect(now, 'not to equal', later);
 expect({ time: now }, 'not to equal', { time: later });
 ```
diff --git a/documentation/assertions/function/to-error.md b/documentation/assertions/function/to-error.md
index 52939344..98d8f37c 100644
--- a/documentation/assertions/function/to-error.md
+++ b/documentation/assertions/function/to-error.md
@@ -154,11 +154,11 @@ You can even do async assertions in the function that you pass in.
 <!-- unexpected-markdown async:true -->
 
 ```js
-var errorCount = 0;
+let errorCount = 0;
 function willBeRejectedAsync() {
   return new Promise(function (resolve, reject) {
     setTimeout(function () {
-      var error = new Error('async error');
+      const error = new Error('async error');
       errorCount += 1;
       error.errorCount = errorCount;
       reject(error);
diff --git a/documentation/assertions/function/when-called-with.md b/documentation/assertions/function/when-called-with.md
index cdbe70bb..5f3c58f5 100644
--- a/documentation/assertions/function/when-called-with.md
+++ b/documentation/assertions/function/when-called-with.md
@@ -42,7 +42,7 @@ Greeter.prototype.greet = function (name) {
   return this.prefix + name;
 };
 
-var helloGreeter = new Greeter('Hello, ');
+const helloGreeter = new Greeter('Hello, ');
 
 expect(helloGreeter, 'to satisfy', {
   greet: expect.it(
diff --git a/documentation/assertions/string/to-be.md b/documentation/assertions/string/to-be.md
index a02359b6..843a4d68 100644
--- a/documentation/assertions/string/to-be.md
+++ b/documentation/assertions/string/to-be.md
@@ -37,7 +37,7 @@ expected 'Hello world!' not to be 'Hello world!'
 If you compare large strings, we truncate the similar parts:
 
 ```js
-var text = `\
+const text = `\
 Bacon ipsum amet tri-tip kielbasa kevin spare RIBS. Sirloin chuck jerky
 venison leberkas. T-bone alcatra short loin short ribs spare ribs rump, brisket
 pastrami frankfurter corned beef kielbasa fatback cupim andouille. Pastrami
@@ -55,7 +55,7 @@ meatloaf turkey kielbasa. Tenderloin porchetta biltong burgdoggen sirloin, strip
 steak pastrami ham hock beef spare ribs shank kevin bacon. Pork loin sausage
 boudin meatball chuck.`;
 
-var expectedText = `\
+const expectedText = `\
 Bacon ipsum dolor amet tri-tip kielbasa kevin spare ribs. Sirloin chuck jerky
 venison leberkas. T-bone alcatra short loin short ribs spare ribs rump, brisket
 pastrami frankfurter corned beef kielbasa fatback cupim andouille. Pastrami
diff --git a/documentation/index.md b/documentation/index.md
index d180a60a..5b277e09 100644
--- a/documentation/index.md
+++ b/documentation/index.md
@@ -39,7 +39,7 @@ to satisfy { name: 'Unexpected', created: 2013 }
 ## Badges
 
 [![NPM version](https://badge.fury.io/js/unexpected.svg)](https://www.npmjs.com/package/unexpected)
-[![Build Status](https://api.travis-ci.org/unexpectedjs/unexpected.svg?branch=master)](https://travis-ci.org/unexpectedjs/unexpected)
+[![Build Status](https://github.com/unexpectedjs/unexpected/workflows/build/badge.svg)](https://travis-ci.org/unexpectedjs/unexpected)
 [![Coverage Status](https://coveralls.io/repos/unexpectedjs/unexpected/badge.svg)](https://coveralls.io/github/unexpectedjs/unexpected)
 [![Dependency Status](https://david-dm.org/unexpectedjs/unexpected.svg)](https://david-dm.org/unexpectedjs/unexpected)
 [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/unexpectedjs/unexpected?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
@@ -72,7 +72,7 @@ Then:
 <!-- eslint-disable import/no-extraneous-dependencies -->
 
 ```js
-var expect = require('unexpected');
+const expect = require('unexpected');
 ```
 
 ### Browser
@@ -88,7 +88,7 @@ This will expose the `expect` function under the following namespace:
 <!-- unexpected-markdown evaluate:false -->
 
 ```js
-var expect = weknowhow.expect;
+const expect = weknowhow.expect;
 ```
 
 ### RequireJS
diff --git a/documentation/plugins.md b/documentation/plugins.md
index 2cb3aad3..417070c4 100644
--- a/documentation/plugins.md
+++ b/documentation/plugins.md
@@ -55,7 +55,7 @@ And then in your test suite:
 <!-- eslint-disable import/no-extraneous-dependencies -->
 
 ```js
-var expect = require('unexpected').clone().use(require('unexpected-dom'));
+const expect = require('unexpected').clone().use(require('unexpected-dom'));
 ```
 
 For plugins that work in the browser, you'll either need to add an extra `<script>`, or
@@ -72,13 +72,13 @@ app serves an HTML response body that contains a yellow `<div>`:
 <!-- eslint-disable import/no-extraneous-dependencies -->
 
 ```js
-var expect = require('unexpected')
+const expect = require('unexpected')
   .clone()
   .use(require('unexpected-express'))
   .use(require('unexpected-dom'))
   .use(require('unexpected-color'));
 
-var app = require('express')().get('/myPage', function (req, res, next) {
+const app = require('express')().get('/myPage', function (req, res, next) {
   res.send('<html><body><div style="color: #ff0">Hey!</div></body></html>');
 });
 
@@ -112,14 +112,14 @@ Or you could assert that a node.js readable stream outputs an image that's at mo
 <!-- eslint-disable import/no-extraneous-dependencies -->
 
 ```js
-var expect = require('unexpected')
+const expect = require('unexpected')
   .clone()
   .use(require('unexpected-stream'))
   .use(require('unexpected-image'))
   .use(require('unexpected-resemble'));
 
 it('should spew out the expected image', function () {
-  var myStream = require('fs').createReadStream('foo.png');
+  const myStream = require('fs').createReadStream('foo.png');
 
   return expect(
     myStream,
diff --git a/documentation/releases.md b/documentation/releases.md
index 23d5af4b..8f53f18d 100644
--- a/documentation/releases.md
+++ b/documentation/releases.md
@@ -12,6 +12,10 @@ Here is a very high level overview of the major releases. See the
 [changelog](https://github.com/unexpectedjs/unexpected/blob/master/CHANGELOG.md)
 for more details.
 
+### v12.0.0 (2020-11-18)
+
+- Drop support for node.js < 10
+
 ### v11.0.0 (2019-01-06)
 
 This release includes backwards-incompatible changes. There's a [migration
diff --git a/lib/assertions.js b/lib/assertions.js
index 8a9b0dd5..47905ce9 100644
--- a/lib/assertions.js
+++ b/lib/assertions.js
@@ -807,10 +807,11 @@ module.exports = (expect) => {
                   )
                 );
               } else if (expect.flags.only) {
-                var excessItems = Array.prototype.filter.call(subject, (item) =>
-                  args.some((arg) => equal(item, arg))
+                const excessItems = Array.prototype.filter.call(
+                  subject,
+                  (item) => args.some((arg) => equal(item, arg))
                 );
-                var missingItems = args.filter(
+                const missingItems = args.filter(
                   (arg) =>
                     !Array.prototype.some.call(subject, (item) =>
                       equal(arg, item)
@@ -837,8 +838,8 @@ module.exports = (expect) => {
           `The '${expect.testDescription}' assertion does not support a prefix of the empty string`
         );
       }
-      var isTruncated = false;
-      var outputSubject = utils.truncateSubjectStringForBegin(subject, value);
+      let isTruncated = false;
+      let outputSubject = utils.truncateSubjectStringForBegin(subject, value);
       if (outputSubject === null) {
         outputSubject = subject;
       } else {
@@ -895,8 +896,8 @@ module.exports = (expect) => {
           `The '${expect.testDescription}' assertion does not support a suffix of the empty string`
         );
       }
-      var isTruncated = false;
-      var outputSubject = utils.truncateSubjectStringForEnd(subject, value);
+      let isTruncated = false;
+      let outputSubject = utils.truncateSubjectStringForEnd(subject, value);
       if (outputSubject === null) {
         outputSubject = subject;
       } else {
@@ -2576,7 +2577,7 @@ module.exports = (expect) => {
         }
       }
 
-      var assert = run(() => {
+      const assert = run(() => {
         if (calledTwice) {
           expect.fail(function () {
             this.error('The callback was called twice');
diff --git a/lib/types.js b/lib/types.js
index 96985bba..b00bdecb 100644
--- a/lib/types.js
+++ b/lib/types.js
@@ -604,11 +604,14 @@ module.exports = function (expect) {
         output.indentLines();
       }
 
-      var actualElements = utils.duplicateArrayLikeUsingType(actual, this);
-      var actualKeys = this.getKeys(actual);
-      var expectedElements = utils.duplicateArrayLikeUsingType(expected, this);
-      var expectedKeys = this.getKeys(expected);
-      var nonNumericalKeysAndSymbols =
+      const actualElements = utils.duplicateArrayLikeUsingType(actual, this);
+      const actualKeys = this.getKeys(actual);
+      const expectedElements = utils.duplicateArrayLikeUsingType(
+        expected,
+        this
+      );
+      const expectedKeys = this.getKeys(expected);
+      const nonNumericalKeysAndSymbols =
         !this.numericalPropertiesOnly &&
         utils.uniqueNonNumericalStringsAndSymbols(actualKeys, expectedKeys);
 
diff --git a/lib/utils.js b/lib/utils.js
index 29085ef9..7716e73e 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -339,11 +339,11 @@ const utils = (module.exports = {
   },
 
   truncateSubjectStringForBegin(subject, value) {
-    var contextLength = value.length + 25;
+    const contextLength = value.length + 25;
     if (subject.length <= contextLength) {
       return null;
     }
-    var truncationIndex = subject.indexOf(' ', value.length + 1);
+    const truncationIndex = subject.indexOf(' ', value.length + 1);
     if (truncationIndex > -1 && truncationIndex < contextLength) {
       return subject.substring(0, truncationIndex);
     } else {
@@ -352,11 +352,11 @@ const utils = (module.exports = {
   },
 
   truncateSubjectStringForEnd(subject, value) {
-    var contextLength = subject.length - value.length - 25;
+    const contextLength = subject.length - value.length - 25;
     if (contextLength <= 0) {
       return null;
     }
-    var truncationIndex = subject.lastIndexOf(' ', value.length + 1);
+    const truncationIndex = subject.lastIndexOf(' ', value.length + 1);
     if (truncationIndex > -1 && truncationIndex >= contextLength) {
       return subject.substring(truncationIndex + 1, subject.length);
     } else {
diff --git a/package.json b/package.json
index dcbb0de7..9c23b2ea 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,7 @@
   "scripts": {
     "prepare": "make build/lib",
     "test": "make test && make test-chrome-headless",
-    "lint": "eslint . && prettier --check '**/*.{js,md}'",
+    "lint": "eslint . && prettier --check '**/*.{js,json,md}'",
     "generate-site": "generate-site --require ./bootstrap-unexpected-markdown.js",
     "update-examples": "evaldown --comment-marker unexpected-markdown --require ./bootstrap-unexpected-markdown.js --inplace ./documentation",
     "version": "(test -n \"${IS_MAKE_RELEASE}\" || (echo Please run make release instead && exit 1)) && offline-github-changelog --next=${npm_package_version} > CHANGELOG.md && git add CHANGELOG.md"
@@ -26,7 +26,7 @@
     "array-changes": "3.0.1",
     "array-changes-async": "3.0.1",
     "detect-indent": "3.0.1",
-    "diff": "4.0.2",
+    "diff": "^5.0.0",
     "greedy-interval-packer": "1.2.0",
     "magicpen": "^6.2.1",
     "ukkonen": "^1.4.0",
@@ -37,7 +37,7 @@
     "coveralls": "^3.0.0",
     "eslint": "^7.0.0",
     "eslint-config-prettier": "^6.0.0",
-    "eslint-config-standard": "^14.0.0",
+    "eslint-config-standard": "^16.0.2",
     "eslint-plugin-import": "^2.14.0",
     "eslint-plugin-markdown": "^1.0.0",
     "eslint-plugin-mocha": "^8.0.0",
@@ -52,17 +52,17 @@
     "istanbul": "^0.4.5",
     "jasmine": "~3.6.1",
     "jasmine-core": "^3.1.0",
-    "jest": "^24.4.0",
+    "jest": "^26.6.3",
     "karma": "5.2.3",
     "karma-browserstack-launcher": "1.6.0",
     "karma-chrome-launcher": "3.1.0",
     "karma-mocha": "2.0.1",
     "minimist": "^1.2.0",
-    "mocha": "^6.1.2",
+    "mocha": "^8.2.1",
     "mocha-slow-reporter": "^*",
     "node-version-check": "^2.2.0",
     "nyc": "^15.0.0",
-    "offline-github-changelog": "^1.6.1",
+    "offline-github-changelog": "^2.0.0",
     "prettier": "~2.1.0",
     "rollup": "^2.0.3",
     "rollup-plugin-commonjs": "^10.0.0",


Test patch:
diff --git a/externaltests/assertionSucceedsWhilePromiseIsPending.spec.js b/externaltests/assertionSucceedsWhilePromiseIsPending.spec.js
index b9b33652..fa676e07 100644
--- a/externaltests/assertionSucceedsWhilePromiseIsPending.spec.js
+++ b/externaltests/assertionSucceedsWhilePromiseIsPending.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib').clone();
+const expect = require('../lib').clone();
 
 expect.addAssertion('<any> to bar', function (expect, subject) {
   expect(subject, 'to equal', 'bar');
diff --git a/externaltests/avoidPromiseAnyFootgunFalsePositive.spec.js b/externaltests/avoidPromiseAnyFootgunFalsePositive.spec.js
index d3ccd9c8..364dffae 100644
--- a/externaltests/avoidPromiseAnyFootgunFalsePositive.spec.js
+++ b/externaltests/avoidPromiseAnyFootgunFalsePositive.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib')
+const expect = require('../lib')
   .clone()
   .addAssertion('<any> to be a number after a (short|long) delay', function (
     expect,
diff --git a/externaltests/avoidPromiseRaceFootgunFalsePositive.spec.js b/externaltests/avoidPromiseRaceFootgunFalsePositive.spec.js
index ddc17178..7c1acb1e 100644
--- a/externaltests/avoidPromiseRaceFootgunFalsePositive.spec.js
+++ b/externaltests/avoidPromiseRaceFootgunFalsePositive.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib')
+const expect = require('../lib')
   .clone()
   .addAssertion('<any> to be a number after a (short|long) delay', function (
     expect,
diff --git a/externaltests/deepObject.spec.js b/externaltests/deepObject.spec.js
index df459304..0b36cf90 100644
--- a/externaltests/deepObject.spec.js
+++ b/externaltests/deepObject.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+const expect = require('../lib');
 it('should not dot out the object in the diff', () => {
   expect(
     function () {
diff --git a/externaltests/failingAsync.spec.js b/externaltests/failingAsync.spec.js
index e53cc3bc..942fc0e8 100644
--- a/externaltests/failingAsync.spec.js
+++ b/externaltests/failingAsync.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib').clone();
+const expect = require('../lib').clone();
 
 expect.addAssertion('<any> when delayed a little bit <assertion?>', function (
   expect,
diff --git a/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.jasmine.json b/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.jasmine.json
index 71baae86..3874fbea 100644
--- a/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.jasmine.json
+++ b/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.jasmine.json
@@ -1,6 +1,4 @@
 {
   "spec_dir": "externaltests",
-  "spec_files": [
-    "forgotToReturnPendingPromiseFromFailingItBlock.spec.js"
-  ]
+  "spec_files": ["forgotToReturnPendingPromiseFromFailingItBlock.spec.js"]
 }
diff --git a/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.spec.js b/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.spec.js
index 863b3af9..5d604caf 100644
--- a/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.spec.js
+++ b/externaltests/forgotToReturnPendingPromiseFromFailingItBlock.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+const expect = require('../lib');
 
 it('should call the callback', () => {
   expect(function () {}, 'to call the callback');
diff --git a/externaltests/forgotToReturnPendingPromiseFromItSuccessfulItBlock.spec.js b/externaltests/forgotToReturnPendingPromiseFromItSuccessfulItBlock.spec.js
index d3d3d26a..063b657c 100644
--- a/externaltests/forgotToReturnPendingPromiseFromItSuccessfulItBlock.spec.js
+++ b/externaltests/forgotToReturnPendingPromiseFromItSuccessfulItBlock.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+const expect = require('../lib');
 
 it('should call the callback', () => {
   expect(function () {}, 'to call the callback');
diff --git a/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.jasmine.json b/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.jasmine.json
index 922e4c2b..cee45356 100644
--- a/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.jasmine.json
+++ b/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.jasmine.json
@@ -1,6 +1,4 @@
 {
   "spec_dir": "externaltests",
-  "spec_files": [
-    "forgotToReturnPendingPromiseFromSuccessfulItBlock.spec.js"
-  ]
+  "spec_files": ["forgotToReturnPendingPromiseFromSuccessfulItBlock.spec.js"]
 }
diff --git a/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.spec.js b/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.spec.js
index d3d3d26a..063b657c 100644
--- a/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.spec.js
+++ b/externaltests/forgotToReturnPendingPromiseFromSuccessfulItBlock.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+const expect = require('../lib');
 
 it('should call the callback', () => {
   expect(function () {}, 'to call the callback');
diff --git a/externaltests/forgotToReturnPromiseRejectedInTheNextTick.spec.js b/externaltests/forgotToReturnPromiseRejectedInTheNextTick.spec.js
index b81225da..ee50c19c 100644
--- a/externaltests/forgotToReturnPromiseRejectedInTheNextTick.spec.js
+++ b/externaltests/forgotToReturnPromiseRejectedInTheNextTick.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib').clone();
+const expect = require('../lib').clone();
 
 it('should fail', () => {
   expect.addAssertion('<any> to foo', function (expect, subject) {
diff --git a/externaltests/fullTrace.spec.js b/externaltests/fullTrace.spec.js
index d2497eaf..3c0cd040 100644
--- a/externaltests/fullTrace.spec.js
+++ b/externaltests/fullTrace.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib')
+const expect = require('../lib')
   .clone()
   .use(require('./node_modules/unexpected-bogus/index.js'));
 
diff --git a/externaltests/notToErrorCaughtError.jasmine.json b/externaltests/notToErrorCaughtError.jasmine.json
index 087cec68..0cf3c91b 100644
--- a/externaltests/notToErrorCaughtError.jasmine.json
+++ b/externaltests/notToErrorCaughtError.jasmine.json
@@ -1,6 +1,4 @@
 {
   "spec_dir": "externaltests",
-  "spec_files": [
-    "notToErrorCaughtError.spec.js"
-  ]
+  "spec_files": ["notToErrorCaughtError.spec.js"]
 }
diff --git a/externaltests/notToErrorCaughtError.spec.js b/externaltests/notToErrorCaughtError.spec.js
index 1fa8ba40..92694b7b 100644
--- a/externaltests/notToErrorCaughtError.spec.js
+++ b/externaltests/notToErrorCaughtError.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+const expect = require('../lib');
 
 it('should foo', () => {
   return expect(function () {
diff --git a/externaltests/successful.spec.js b/externaltests/successful.spec.js
index fb87bae5..c533376d 100644
--- a/externaltests/successful.spec.js
+++ b/externaltests/successful.spec.js
@@ -1,4 +1,4 @@
-var expect = require('../lib');
+const expect = require('../lib');
 
 it('should call the callback', () => {
   expect(true, 'to be true');
diff --git a/test/api/addAssertion.spec.js b/test/api/addAssertion.spec.js
index 2ff14f4b..40a2ceb7 100644
--- a/test/api/addAssertion.spec.js
+++ b/test/api/addAssertion.spec.js
@@ -9,7 +9,7 @@ describe('addAssertion', () => {
   });
 
   it('supports transfering flags from the custom assertion to nested expect', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> [not] to be sorted', function (expect, subject) {
         expect(subject, 'to be an array');
@@ -56,7 +56,7 @@ describe('addAssertion', () => {
 
   describe('when overriding an assertion', () => {
     it('uses the most specific version', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<string> to foo', function (expect, subject) {
           expect.errorMode = 'bubble';
@@ -78,7 +78,7 @@ describe('addAssertion', () => {
 
     describe('with the same specificity', () => {
       it('uses the most recently added version', () => {
-        var clonedExpect = expect
+        const clonedExpect = expect
           .clone()
           .addAssertion('<any> to foo', function (expect, subject) {
             expect.errorMode = 'bubble';
@@ -112,7 +112,7 @@ describe('addAssertion', () => {
   });
 
   it('does not break when declaring multiple patterns that do not have the same set of flags defined', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion(
         [
@@ -277,7 +277,7 @@ describe('addAssertion', () => {
 
     describe('alternations', () => {
       it('can be empty', () => {
-        var clonedExpect = expect
+        const clonedExpect = expect
           .clone()
           .addAssertion('<any> to foo (|bar)', function (expect, subject) {
             expect(subject, 'to equal', 'foo');
@@ -330,7 +330,7 @@ describe('addAssertion', () => {
     }
 
     it('allows specifying assertions with overlapping patterns for different types', () => {
-      var clonedExpect = expect.clone();
+      const clonedExpect = expect.clone();
       clonedExpect
         .addType({
           name: 'box',
@@ -371,7 +371,7 @@ describe('addAssertion', () => {
     });
 
     it('allows you to control the inspection depth', () => {
-      var clonedExpect = expect.clone().addType({
+      const clonedExpect = expect.clone().addType({
         name: 'box',
         base: 'object',
         identify(obj) {
@@ -394,8 +394,8 @@ describe('addAssertion', () => {
   });
 
   describe('error modes', () => {
-    var errorMode = 'default';
-    var clonedExpect;
+    let errorMode = 'default';
+    let clonedExpect;
 
     describe('for synchronous custom assertions', () => {
       beforeEach(() => {
@@ -491,7 +491,7 @@ describe('addAssertion', () => {
       });
 
       it('avoids repeating large subjects', () => {
-        var clonedExpect = expect
+        const clonedExpect = expect
           .clone()
           .addAssertion('<any> to foobarbaz', function (expect, subject) {
             expect.errorMode = 'nested';
@@ -736,7 +736,7 @@ describe('addAssertion', () => {
 
     describe('when the error mode of the assertion changes after the assertion has failed', () => {
       it('serializes the error with the error mode that was in effect at the time of its creation', () => {
-        var clonedExpect = expect
+        const clonedExpect = expect
           .clone()
           .addAssertion('<any> to be equal to foo', function (expect, subject) {
             expect.errorMode = 'nested';
@@ -764,7 +764,7 @@ describe('addAssertion', () => {
   });
 
   it('nested expects throws if the assertion does not exists', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to be foo', function theCustomAssertion(
         expect,
@@ -832,7 +832,7 @@ describe('addAssertion', () => {
   });
 
   it('makes expect.it available inside a custom assertion', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
     clonedExpect.addAssertion('<any> to foo', function (expect, subject) {
       expect.it('to equal', 'foo')(subject);
     });
diff --git a/test/api/addStyle.spec.js b/test/api/addStyle.spec.js
index 7804b88d..c429ab5e 100644
--- a/test/api/addStyle.spec.js
+++ b/test/api/addStyle.spec.js
@@ -1,6 +1,6 @@
 /* global expect */
 describe('addStyle', () => {
-  var clonedExpect;
+  let clonedExpect;
   beforeEach(() => {
     clonedExpect = expect.clone();
   });
diff --git a/test/api/addType.spec.js b/test/api/addType.spec.js
index fef923f5..04183b00 100644
--- a/test/api/addType.spec.js
+++ b/test/api/addType.spec.js
@@ -1,6 +1,6 @@
 /* global expect */
 describe('addType', () => {
-  var clonedExpect;
+  let clonedExpect;
   beforeEach(() => {
     clonedExpect = expect.clone();
   });
diff --git a/test/api/child.spec.js b/test/api/child.spec.js
index 6c8a2ed6..34944489 100644
--- a/test/api/child.spec.js
+++ b/test/api/child.spec.js
@@ -1,7 +1,7 @@
 /* global expect */
 describe('#child', () => {
-  var parentExpect;
-  var childExpect;
+  let parentExpect;
+  let childExpect;
   beforeEach(() => {
     parentExpect = expect.clone();
     childExpect = parentExpect.child();
diff --git a/test/api/clone.spec.js b/test/api/clone.spec.js
index 20e2dd1a..be8aff1a 100644
--- a/test/api/clone.spec.js
+++ b/test/api/clone.spec.js
@@ -1,6 +1,6 @@
 /* global expect */
 describe('clone', () => {
-  var clonedExpect;
+  let clonedExpect;
   beforeEach(() => {
     clonedExpect = expect.clone();
     clonedExpect.addAssertion(
diff --git a/test/api/equal.spec.js b/test/api/equal.spec.js
index 61dd4560..93685e6f 100644
--- a/test/api/equal.spec.js
+++ b/test/api/equal.spec.js
@@ -2,8 +2,8 @@
 if (Object.defineProperty) {
   describe('equal', () => {
     function Field(val, options) {
-      var value = val;
-      var propertyDescription = {
+      let value = val;
+      const propertyDescription = {
         enumerable: true,
       };
       if (options.match(/getter/)) {
diff --git a/test/api/expect.spec.js b/test/api/expect.spec.js
index c4b43e3d..eaf2385d 100644
--- a/test/api/expect.spec.js
+++ b/test/api/expect.spec.js
@@ -1,7 +1,7 @@
 /* global expect */
 describe('expect', function () {
   it('should forward flags to assertion strings that are processed by the next assertion', function () {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addAssertion(
       '<number> [not] to have an absolute value of <number>',
@@ -21,7 +21,7 @@ describe('expect', function () {
   });
 
   it('should forward flags to assertion strings that are processed by the next next assertion', function () {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addAssertion(
       '<number> [not] to have a floored absolute value of <number>',
diff --git a/test/api/exportAssertion.spec.js b/test/api/exportAssertion.spec.js
index 680ada74..58f9d50e 100644
--- a/test/api/exportAssertion.spec.js
+++ b/test/api/exportAssertion.spec.js
@@ -1,7 +1,7 @@
 /* global expect */
 describe('exportAssertion', () => {
-  var parentExpect;
-  var childExpect;
+  let parentExpect;
+  let childExpect;
   beforeEach(() => {
     parentExpect = expect.clone();
     childExpect = parentExpect.child();
diff --git a/test/api/exportStyle.spec.js b/test/api/exportStyle.spec.js
index af034d0d..1ee1dda0 100644
--- a/test/api/exportStyle.spec.js
+++ b/test/api/exportStyle.spec.js
@@ -1,7 +1,7 @@
 /* global expect */
 describe('styleType', () => {
-  var parentExpect;
-  var childExpect;
+  let parentExpect;
+  let childExpect;
   beforeEach(() => {
     parentExpect = expect.clone();
     childExpect = parentExpect.child();
diff --git a/test/api/exportType.spec.js b/test/api/exportType.spec.js
index 42d296a9..205f8fe5 100644
--- a/test/api/exportType.spec.js
+++ b/test/api/exportType.spec.js
@@ -1,7 +1,7 @@
 /* global expect */
 describe('exportType', () => {
-  var parentExpect;
-  var childExpect;
+  let parentExpect;
+  let childExpect;
   beforeEach(() => {
     parentExpect = expect.clone();
     childExpect = parentExpect.child();
diff --git a/test/api/fail.spec.js b/test/api/fail.spec.js
index db2f50e7..eb354323 100644
--- a/test/api/fail.spec.js
+++ b/test/api/fail.spec.js
@@ -11,7 +11,7 @@ describe('fail assertion', () => {
   });
 
   it('sets the error message', () => {
-    var wasCaught = false;
+    let wasCaught = false;
     try {
       expect.fail('fail with error message');
     } catch (e) {
@@ -42,7 +42,7 @@ describe('fail assertion', () => {
 
     expect(
       function () {
-        var output = expect.output.clone().text('zero');
+        const output = expect.output.clone().text('zero');
         expect.fail('{0} was expected to be {1}', 0, output);
       },
       'to throw exception',
@@ -134,7 +134,7 @@ describe('fail assertion', () => {
 
   describe('with a diff function', () => {
     it('should generate the diff', () => {
-      var clonedExpect = expect.clone();
+      const clonedExpect = expect.clone();
       clonedExpect.addAssertion('<any> to foo', function (expect, subject) {
         expect.fail({
           diff(output, diff, inspect, equal) {
diff --git a/test/api/hook.js b/test/api/hook.js
index 007742b4..de5cbb69 100644
--- a/test/api/hook.js
+++ b/test/api/hook.js
@@ -1,8 +1,8 @@
 /* global expect */
 describe('hook', () => {
   it('should hook into the expect function itself', () => {
-    var clonedExpect = expect.clone();
-    var called = false;
+    const clonedExpect = expect.clone();
+    let called = false;
     clonedExpect.hook(function (next) {
       return function (context, args) {
         called = true;
@@ -16,10 +16,10 @@ describe('hook', () => {
 
   describe('with expect.clone', () => {
     it('should not affect clones made before hooking in', () => {
-      var clonedExpect = expect.clone();
-      var clonedClonedExpect = clonedExpect.clone();
+      const clonedExpect = expect.clone();
+      const clonedClonedExpect = clonedExpect.clone();
 
-      var called = false;
+      let called = false;
       clonedExpect.hook(function (next) {
         return function (context, args) {
           called = true;
@@ -31,15 +31,15 @@ describe('hook', () => {
     });
 
     it('should affect clones made after hooking in', () => {
-      var clonedExpect = expect.clone();
-      var called = false;
+      const clonedExpect = expect.clone();
+      let called = false;
       clonedExpect.hook(function (next) {
         return function (context, args) {
           called = true;
           return next(context, args);
         };
       });
-      var clonedClonedExpect = clonedExpect.clone();
+      const clonedClonedExpect = clonedExpect.clone();
       clonedClonedExpect(123, 'to equal', 123);
       expect(called, 'to be true');
     });
@@ -47,10 +47,10 @@ describe('hook', () => {
 
   describe('with expect.child', () => {
     it('should not affect child instances made before installing the hook', () => {
-      var parentExpect = expect.clone();
-      var childExpect = parentExpect.child();
+      const parentExpect = expect.clone();
+      const childExpect = parentExpect.child();
 
-      var called = false;
+      let called = false;
       parentExpect.hook(function (next) {
         return function (context, args) {
           called = true;
@@ -63,9 +63,9 @@ describe('hook', () => {
     });
 
     it('should not affect child instances made after installing the hook', () => {
-      var parentExpect = expect.clone();
+      const parentExpect = expect.clone();
 
-      var called = false;
+      let called = false;
       parentExpect.hook(function (next) {
         return function (context, args) {
           called = true;
@@ -73,7 +73,7 @@ describe('hook', () => {
         };
       });
 
-      var childExpect = parentExpect.clone();
+      const childExpect = parentExpect.clone();
 
       childExpect(123, 'to equal', 123);
       expect(called, 'to be true');
@@ -81,7 +81,7 @@ describe('hook', () => {
   });
 
   it('should allow rewriting the assertion string', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
     clonedExpect.hook(function (next) {
       return function (context, args) {
         args[1] = 'to equal';
@@ -92,7 +92,7 @@ describe('hook', () => {
   });
 
   it('should allow suppressing the return value of the "next" expect', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
     clonedExpect.hook(function (next) {
       return function (context, args) {
         try {
@@ -106,9 +106,9 @@ describe('hook', () => {
   });
 
   it('should allow installing multiple hooks', () => {
-    var firstCalled = false;
-    var secondCalled = false;
-    var clonedExpect = expect.clone();
+    let firstCalled = false;
+    let secondCalled = false;
+    const clonedExpect = expect.clone();
     clonedExpect.hook(function (next) {
       return function (context, args) {
         firstCalled = true;
diff --git a/test/api/inspect.spec.js b/test/api/inspect.spec.js
index ab462df7..5e3daca5 100644
--- a/test/api/inspect.spec.js
+++ b/test/api/inspect.spec.js
@@ -1,8 +1,8 @@
 /* global expect */
 describe('inspect', () => {
   function Field(val, options) {
-    var value = val;
-    var propertyDescription = {
+    let value = val;
+    const propertyDescription = {
       enumerable: true,
     };
     if (options.match(/getter/)) {
@@ -19,7 +19,7 @@ describe('inspect', () => {
     Object.defineProperty(this, 'value', propertyDescription);
   }
 
-  var circular = {};
+  const circular = {};
   circular.self = circular;
 
   if (Object.defineProperty) {
@@ -43,8 +43,8 @@ describe('inspect', () => {
   }
 
   it('should render strings with control chars and backslashes correctly', () => {
-    var stringWithControlCharsAndStuff = '\\';
-    for (var i = 0; i < 32; i += 1) {
+    let stringWithControlCharsAndStuff = '\\';
+    for (let i = 0; i < 32; i += 1) {
       stringWithControlCharsAndStuff += String.fromCharCode(i);
     }
 
@@ -84,19 +84,19 @@ describe('inspect', () => {
       expect(-Infinity, 'to inspect as', '-Infinity');
     });
     it('sparse array', () => {
-      var sparse = [];
+      const sparse = [];
       sparse[1] = 'foo';
       expect(sparse, 'to inspect as', "[ , 'foo' ]");
     });
     it('sparse array with explicit undefined', () => {
-      var sparse = [];
+      const sparse = [];
       sparse[1] = undefined;
       expect(sparse, 'to inspect as', '[ , undefined ]');
     });
   });
 
   describe('block items as inspected correctly in', () => {
-    var clonedExpect = expect.clone().addType({
+    const clonedExpect = expect.clone().addType({
       name: 'multiline',
       base: 'string',
       identify(value) {
@@ -131,7 +131,7 @@ describe('inspect', () => {
   });
 
   it('indents correctly', () => {
-    var data = [
+    const data = [
       {
         guid: 'db550c87-1680-462a-bacc-655cecdd8907',
         isActive: false,
@@ -277,7 +277,7 @@ describe('inspect', () => {
         ']'
     );
 
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
     clonedExpect.output.preferredWidth = 200;
     expect(
       clonedExpect.inspect(data, 5).toString(),
@@ -328,7 +328,7 @@ describe('inspect', () => {
   });
 
   it('should inspect an arguments object differently from an array', () => {
-    var args;
+    let args;
     (function () {
       args = arguments;
     })('a', 123);
@@ -337,6 +337,7 @@ describe('inspect', () => {
 
   it('should output the body of a function', () => {
     expect(
+      /* eslint-disable no-var */
       function () {
         var foo = 'bar';
         var quux = 'baz';
@@ -345,6 +346,7 @@ describe('inspect', () => {
         }
         return quux;
       },
+      /* eslint-enable no-var */
       'to inspect as',
       'function () {\n' +
         "  var foo = 'bar';\n" +
@@ -408,7 +410,7 @@ describe('inspect', () => {
     });
   }
 
-  /* eslint-disable no-multi-str */
+  /* eslint-disable no-multi-str, no-var */
   function multilineStringLiteral() {
     var foo = 'bar';
     var quux = 'baz\
@@ -416,7 +418,7 @@ describe('inspect', () => {
     foo = foo + quux;
     return foo;
   }
-  /* eslint-enable no-multi-str */
+  /* eslint-enable no-multi-str, no-var */
 
   it('should bail out of removing the indentation of functions that use multiline string literals', () => {
     expect(
@@ -435,7 +437,9 @@ describe('inspect', () => {
   it('should bail out of removing the indentation of one-liner functions', () => {
     expect(
       // prettier-ignore
+      /* eslint-disable no-var */
       function() { var foo = 123;return foo; },
+      /* eslint-enable no-var */
       'to inspect as',
       'function () { var foo = 123;return foo; }'
     );
@@ -450,8 +454,8 @@ describe('inspect', () => {
   });
 
   it('should not inspect a recurring object as [Circular]', () => {
-    var a = { foo: 'bar' };
-    var b = { c: a, d: a };
+    const a = { foo: 'bar' };
+    const b = { c: a, d: a };
     expect(b, 'to inspect as', "{ c: { foo: 'bar' }, d: { foo: 'bar' } }");
   });
 });
diff --git a/test/api/installTheme.spec.js b/test/api/installTheme.spec.js
index 246e0f4d..7e11ace2 100644
--- a/test/api/installTheme.spec.js
+++ b/test/api/installTheme.spec.js
@@ -1,6 +1,6 @@
 /* global expect */
 describe('installTheme', () => {
-  var clonedExpect;
+  let clonedExpect;
   beforeEach(() => {
     clonedExpect = expect.clone();
   });
diff --git a/test/api/it.spec.js b/test/api/it.spec.js
index 3a11e2d0..2016a317 100644
--- a/test/api/it.spec.js
+++ b/test/api/it.spec.js
@@ -1,7 +1,7 @@
 /* global expect */
 describe('expect.it', () => {
   it('returns an expectation function that when applied runs the assertion on the given subject', () => {
-    var expectation = expect.it('to be greater than', 14);
+    const expectation = expect.it('to be greater than', 14);
     expectation(20);
     expect(
       function () {
@@ -13,7 +13,7 @@ describe('expect.it', () => {
   });
 
   it('is inspected as it is written', () => {
-    var expectation = expect
+    const expectation = expect
       .it('to be a number')
       .and('to be less than', 14)
       .and('to be negative')
@@ -31,7 +31,7 @@ describe('expect.it', () => {
   });
 
   it('does not catch errors that are not thrown by unexpected', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> explode', function (expect, subject) {
         throw new Error('Explosion');
@@ -42,7 +42,7 @@ describe('expect.it', () => {
 
   describe('with chained and', () => {
     it('all assertions has to be satisfied', () => {
-      var expectation = expect
+      const expectation = expect
         .it('to be a number')
         .and('to be less than', 14)
         .and('to be negative');
@@ -58,8 +58,8 @@ describe('expect.it', () => {
     });
 
     it('returns a new function', () => {
-      var expectation = expect.it('to be a number');
-      var compositeExpectation = expectation.and('to be less than', 14);
+      const expectation = expect.it('to be a number');
+      const compositeExpectation = expectation.and('to be less than', 14);
       expect(compositeExpectation, 'not to be', expectation);
 
       expectation(20);
@@ -74,7 +74,7 @@ describe('expect.it', () => {
     });
 
     it('outputs one failing assertion correctly', () => {
-      var expectation = expect
+      const expectation = expect
         .it('to be a number')
         .and('to be less than', 14)
         .and('to be negative');
@@ -92,7 +92,7 @@ describe('expect.it', () => {
 
   describe('with chained or', () => {
     it('succeeds if any expectations succeeds', () => {
-      var expectation = expect
+      const expectation = expect
         .it('to be a number')
         .or('to be a string')
         .or('to be an array');
@@ -102,7 +102,7 @@ describe('expect.it', () => {
     });
 
     it('fails if all the expectations fails', () => {
-      var expectation = expect
+      const expectation = expect
         .it('to be a number')
         .and('to be greater than', 6)
         .or('to be a string')
@@ -125,7 +125,7 @@ describe('expect.it', () => {
     });
 
     it('if there are no and-clauses it writes the failure output more compactly', () => {
-      var expectation = expect
+      const expectation = expect
         .it('to be a number')
         .or('to be a string')
         .or('to be an array');
@@ -141,8 +141,8 @@ describe('expect.it', () => {
     });
 
     it('returns a new function', () => {
-      var expectation = expect.it('to be a number');
-      var compositeExpectation = expectation.or('to be a string');
+      const expectation = expect.it('to be a number');
+      const compositeExpectation = expectation.or('to be a string');
       expect(compositeExpectation, 'not to be', expectation);
 
       expectation(20);
@@ -158,7 +158,7 @@ describe('expect.it', () => {
   });
 
   describe('with async assertions', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to be a number after a short delay', function (
         expect,
@@ -315,7 +315,7 @@ describe('expect.it', () => {
 
   describe('with forwarding of flags', () => {
     describe('directly', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<object> [not] to have a foo property of bar', function (
           expect,
@@ -369,7 +369,7 @@ describe('expect.it', () => {
     });
 
     describe('through an <assertion> being shifted to', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<object> [not] to have a foo property of bar', function (
           expect,
diff --git a/test/api/outputFormat.spec.js b/test/api/outputFormat.spec.js
index 26ed5dc8..57f6a6ab 100644
--- a/test/api/outputFormat.spec.js
+++ b/test/api/outputFormat.spec.js
@@ -4,7 +4,7 @@ describe('outputFormat', () => {
     it('decides the output that will be used for serializing errors', () => {
       expect(
         function () {
-          var clonedExpect = expect.clone().outputFormat('html');
+          const clonedExpect = expect.clone().outputFormat('html');
           clonedExpect(42, 'to equal', 24);
         },
         'to throw',
@@ -18,7 +18,7 @@ describe('outputFormat', () => {
 
       expect(
         function () {
-          var clonedExpect = expect.clone().outputFormat('ansi');
+          const clonedExpect = expect.clone().outputFormat('ansi');
           clonedExpect(42, 'to equal', 24);
         },
         'to throw',
diff --git a/test/api/promise.spec.js b/test/api/promise.spec.js
index 2e4f2e87..3a15e93a 100644
--- a/test/api/promise.spec.js
+++ b/test/api/promise.spec.js
@@ -1,7 +1,7 @@
 /* global expect */
 describe('expect.promise', () => {
   it('should forward non-unexpected errors', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to foo', function (expect, subject) {
         return expect.withError(
@@ -32,7 +32,7 @@ describe('expect.promise', () => {
   });
 
   it('should return the fulfilled promise even if it is oathbreakable', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to foo', function (expect, subject) {
         return expect.promise(function () {
@@ -44,7 +44,7 @@ describe('expect.promise', () => {
   });
 
   it('should preserve the resolved value when an assertion contains a non-oathbreakable promise', function (done) {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to foo', function (expect, subject) {
         return expect.promise(function (resolve, reject) {
@@ -61,7 +61,7 @@ describe('expect.promise', () => {
   });
 
   it('should return a promise fulfilled with the return value when an assertion returns a non-promise value', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to foo', function (expect, subject) {
         expect(subject, 'to equal', 'foo');
@@ -214,7 +214,7 @@ describe('expect.promise', () => {
 
     describe('with a nested asynchronous assertion', () => {
       it('should mount the and method on a promise returned from a nested assertion', () => {
-        var clonedExpect = expect
+        const clonedExpect = expect
           .clone()
           .addAssertion('<any> to foo', function (expect, subject) {
             return expect(subject, 'to bar').and('to equal', 'foo');
@@ -235,7 +235,7 @@ describe('expect.promise', () => {
   });
 
   it('should throw an exception if the argument was not a function', () => {
-    var expectedError = new TypeError(
+    const expectedError = new TypeError(
       'expect.promise(...) requires a function argument to be supplied.\n' +
         'See http://unexpected.js.org/api/promise/ for more details.'
     );
@@ -268,7 +268,7 @@ describe('expect.promise', () => {
     }
   } catch (err) {}
   describe('#inspect', () => {
-    var originalDefaultFormat = expect.output.constructor.defaultFormat;
+    const originalDefaultFormat = expect.output.constructor.defaultFormat;
     beforeEach(() => {
       expect.output.constructor.defaultFormat = 'text';
     });
@@ -301,7 +301,7 @@ describe('expect.promise', () => {
     });
 
     it('should inspect a pending promise', () => {
-      var asyncPromise = expect(
+      const asyncPromise = expect(
         'foo',
         'when delayed a little bit',
         'to equal',
@@ -316,7 +316,7 @@ describe('expect.promise', () => {
     });
 
     it('should inspect a rejected promise without a reason', () => {
-      var promise = expect.promise(function (resolve, reject) {
+      const promise = expect.promise(function (resolve, reject) {
         reject();
       });
 
@@ -326,7 +326,7 @@ describe('expect.promise', () => {
     });
 
     it('should inspect a rejected promise with a reason', () => {
-      var promise = expect.promise(function (resolve, reject) {
+      const promise = expect.promise(function (resolve, reject) {
         setTimeout(function () {
           reject(new Error('argh'));
         }, 0);
@@ -374,7 +374,7 @@ describe('expect.promise', () => {
 
     it('should provide a run function that preserves the return value of the supplied function', () => {
       return expect.promise(function (run) {
-        var runner = run(function () {
+        const runner = run(function () {
           return 123;
         });
         expect(runner(), 'to equal', 123);
diff --git a/test/api/shift.spec.js b/test/api/shift.spec.js
index 3e97e5ab..387ccf15 100644
--- a/test/api/shift.spec.js
+++ b/test/api/shift.spec.js
@@ -2,7 +2,7 @@
 describe('expect.shift', () => {
   describe('when preserving the subject by passing no arguments', () => {
     it('should succeed', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<string> blabla <assertion>', function (
           expect,
@@ -14,7 +14,7 @@ describe('expect.shift', () => {
     });
 
     it('should fail with a diff', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<string> blabla <assertion>', function (
           expect,
@@ -36,15 +36,15 @@ describe('expect.shift', () => {
   });
 
   it('should support calling shift multiple times', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion(
         '<number> up to [and including] <number> <assertion>',
         function (expect, subject, value) {
           expect.errorMode = 'nested';
-          var numbers = [];
+          const numbers = [];
           for (
-            var i = subject;
+            let i = subject;
             i < (expect.flags['and including'] ? value + 1 : value);
             i += 1
           ) {
@@ -72,7 +72,7 @@ describe('expect.shift', () => {
 
   describe('when substituting a different subject by passing a single argument', () => {
     it('should succeed', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<string> when appended with bar <assertion>', function (
           expect,
@@ -84,7 +84,7 @@ describe('expect.shift', () => {
     });
 
     it('should fail with a diff', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<string> when appended with bar <assertion>', function (
           expect,
@@ -106,7 +106,7 @@ describe('expect.shift', () => {
   });
 
   it('should identify the assertions even when the next assertion fails before shifting', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<string> when appended with bar <assertion>', function (
         expect,
@@ -133,7 +133,7 @@ describe('expect.shift', () => {
   });
 
   it('supports the legacy 3 argument version', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<string> when prepended with foo <assertion>', function (
         expect,
@@ -150,7 +150,7 @@ describe('expect.shift', () => {
 
   describe('with the legacy 2 argument version', () => {
     it('inspects multiple arguments correctly', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion(
           '<string> when surrounded by <string> <string> <assertion>',
@@ -177,7 +177,7 @@ describe('expect.shift', () => {
 
   describe('with an expect.it function as the next argument', () => {
     it('should succeed', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<string> when prepended with foo <assertion>', function (
           expect,
@@ -194,7 +194,7 @@ describe('expect.shift', () => {
   });
 
   it('should fail when the next argument is a non-expect.it function', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<string> when prepended with foo <assertion>', function (
         expect,
@@ -231,7 +231,7 @@ describe('expect.shift', () => {
 
   describe('in legacy mode where the assertion index is passed as the second parameter', () => {
     it('should get the assertion string from that index', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion(
           '<string> when prepended with <string> <assertion>',
@@ -259,7 +259,7 @@ describe('expect.shift', () => {
     });
 
     it('should render the correct error message when there is several non-string parameters following the assertion index', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion(
           '<string> when prepended with foo <string> <number+>',
@@ -279,7 +279,7 @@ describe('expect.shift', () => {
     });
 
     it('should render the correct error message when the assertion being shifted to is not a string', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<string> when prepended with foo <number+>', function (
           expect,
@@ -302,7 +302,7 @@ describe('expect.shift', () => {
     });
 
     it('should render the correct error message when there are no parameters following the assertion index', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<string> when prepended with foo', function (
           expect,
@@ -324,7 +324,7 @@ describe('expect.shift', () => {
 
   describe('when a non-Unexpected promise is passed to shift', () => {
     it('should allow a subsequent .and()', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<any> promisified', function (expect, subject) {
           return expect.shift(new Promise(subject));
@@ -337,7 +337,7 @@ describe('expect.shift', () => {
     });
 
     it('should allow a subsequent .and() within a nested context', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<any> promisified', function (expect, subject) {
           return expect.shift(new Promise(subject));
@@ -360,7 +360,7 @@ describe('expect.shift', () => {
   });
 
   it('fails when the given assertion does not accept the shifted subject type', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<number> when stringified <assertion>', function (
         expect,
@@ -387,7 +387,7 @@ describe('expect.shift', () => {
 
   describe('when you shift to an assertion in the parent expect', () => {
     it('fails when the given assertion does not accept the shifted subject type', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .child()
         .exportAssertion('<number> when stringified <assertion>', function (
diff --git a/test/api/use.spec.js b/test/api/use.spec.js
index 10396001..8c7a5439 100644
--- a/test/api/use.spec.js
+++ b/test/api/use.spec.js
@@ -1,12 +1,12 @@
 /* global expect */
 describe('use', () => {
-  var clonedExpect;
+  let clonedExpect;
   beforeEach(() => {
     clonedExpect = expect.clone();
   });
 
   it('calls the given plugin with the clonedExpect instance as the parameter', function (done) {
-    var plugin = {
+    const plugin = {
       name: 'test',
       installInto(expectInstance) {
         clonedExpect(expectInstance, 'to be', clonedExpect);
@@ -42,8 +42,8 @@ describe('use', () => {
   });
 
   it('allows the installation of a plugin given as an anonymous function', () => {
-    var callCount = 0;
-    var plugin = function () {
+    let callCount = 0;
+    const plugin = function () {
       callCount += 1;
     };
     clonedExpect.use(plugin);
@@ -53,8 +53,8 @@ describe('use', () => {
   });
 
   it('allows the installation of a plugin given as a named function', () => {
-    var callCount = 0;
-    var plugin = function myPlugin() {
+    let callCount = 0;
+    const plugin = function myPlugin() {
       callCount += 1;
     };
     clonedExpect.use(plugin);
@@ -75,11 +75,11 @@ describe('use', () => {
   });
 
   it('does not fail if all plugin dependencies has been fulfilled', function (done) {
-    var pluginA = {
+    const pluginA = {
       name: 'PluginA',
       installInto(clonedExpect) {},
     };
-    var pluginB = {
+    const pluginB = {
       name: 'PluginB',
       dependencies: ['PluginA'],
       installInto(clonedExpect) {
@@ -91,11 +91,11 @@ describe('use', () => {
   });
 
   it('dependencies can be fulfilled across clones', function (done) {
-    var pluginA = {
+    const pluginA = {
       name: 'PluginA',
       installInto(clonedExpect) {},
     };
-    var pluginB = {
+    const pluginB = {
       name: 'PluginB',
       dependencies: ['PluginA'],
       installInto(clonedExpect) {
@@ -107,8 +107,8 @@ describe('use', () => {
   });
 
   it('installing a plugin more than once is a no-op', () => {
-    var callCount = 0;
-    var plugin = {
+    let callCount = 0;
+    const plugin = {
       name: 'plugin',
       installInto() {
         callCount += 1;
@@ -121,16 +121,16 @@ describe('use', () => {
   });
 
   it('installing two different plugins that are identically named and have the same version (but not ===) will only install the first one', () => {
-    var callCount1 = 0;
-    var plugin1 = {
+    let callCount1 = 0;
+    const plugin1 = {
       name: 'plugin',
       version: '1.2.3',
       installInto() {
         callCount1 += 1;
       },
     };
-    var callCount2 = 0;
-    var plugin2 = {
+    let callCount2 = 0;
+    const plugin2 = {
       name: 'plugin',
       version: '1.2.3',
       installInto() {
diff --git a/test/assertionParser.spec.js b/test/assertionParser.spec.js
index ecfadc80..41b898be 100644
--- a/test/assertionParser.spec.js
+++ b/test/assertionParser.spec.js
@@ -1,9 +1,9 @@
 /* global unexpected */
 describe('parseAssertion', () => {
-  var expect = unexpected.clone();
+  const expect = unexpected.clone();
 
   it('converts an assertion string to an object representation', () => {
-    var assertion = expect.parseAssertion(
+    const assertion = expect.parseAssertion(
       '<string|function> [not] to be <string> <string*|object>'
     );
     expect(assertion, 'to satisfy', [
@@ -43,7 +43,7 @@ describe('parseAssertion', () => {
   });
 
   it('accepts assertions without alternations', () => {
-    var assertion = expect.parseAssertion(
+    const assertion = expect.parseAssertion(
       '<any> [not] to [exhaustively] satisfy [assertion] <any*>'
     );
     expect(assertion, 'to satisfy', [
@@ -56,7 +56,7 @@ describe('parseAssertion', () => {
   });
 
   it('accepts assertions with alternations on the subject', () => {
-    var assertion = expect.parseAssertion(
+    const assertion = expect.parseAssertion(
       '<string|array-like> [not] to be empty <any*>'
     );
     expect(assertion, 'to satisfy', [
@@ -110,7 +110,7 @@ describe('parseAssertion', () => {
   });
 
   it('accepts assertions with no arguments', () => {
-    var assertion = expect.parseAssertion('<any> [not] to be truthy');
+    const assertion = expect.parseAssertion('<any> [not] to be truthy');
     expect(assertion, 'to satisfy', [
       {
         subject: { type: { name: 'any' }, minimum: 1, maximum: 1 },
@@ -186,7 +186,7 @@ describe('parseAssertion', () => {
   });
 
   it('handles types with upper case characters', () => {
-    var assertion = expect.parseAssertion('<number|NaN> [not] to be NaN');
+    const assertion = expect.parseAssertion('<number|NaN> [not] to be NaN');
     expect(assertion, 'to satisfy', [
       {
         subject: { type: { name: 'number' }, minimum: 1, maximum: 1 },
@@ -203,7 +203,7 @@ describe('parseAssertion', () => {
 
   describe('with an assertion that has <assertion>', () => {
     it('should accept it as the last argument', () => {
-      var assertion = expect.parseAssertion(
+      const assertion = expect.parseAssertion(
         '<Buffer> when decoded as <string> <assertion>'
       );
       expect(assertion, 'to satisfy', [
diff --git a/test/assertions/to-be-a.spec.js b/test/assertions/to-be-a.spec.js
index 0e07e02a..85c85c63 100644
--- a/test/assertions/to-be-a.spec.js
+++ b/test/assertions/to-be-a.spec.js
@@ -1,6 +1,6 @@
 /* global expect */
 describe('to be a/an assertion', () => {
-  var circular = {};
+  const circular = {};
   circular.self = circular;
 
   it('asserts typeof with support for array type and instanceof', () => {
@@ -83,7 +83,7 @@ describe('to be a/an assertion', () => {
   it('formats Error instances correctly when an assertion fails', () => {
     expect(
       function () {
-        var error = new Error('error message');
+        const error = new Error('error message');
         error.data = 'extra';
         expect(error, 'to be a number');
       },
diff --git a/test/assertions/to-be-canonical.spec.js b/test/assertions/to-be-canonical.spec.js
index 0e32c08a..1cdfd8c4 100644
--- a/test/assertions/to-be-canonical.spec.js
+++ b/test/assertions/to-be-canonical.spec.js
@@ -12,7 +12,7 @@ describe('to be a canonical object assertion', () => {
   });
 
   it('works with a circular object', () => {
-    var obj = { a: 123, b: {} };
+    const obj = { a: 123, b: {} };
     obj.b.a = obj;
     expect(obj, 'to be canonical');
   });
diff --git a/test/assertions/to-be-rejected-with-error-satisfying.spec.js b/test/assertions/to-be-rejected-with-error-satisfying.spec.js
index 07f35bd7..4c584f33 100644
--- a/test/assertions/to-be-rejected-with-error-satisfying.spec.js
+++ b/test/assertions/to-be-rejected-with-error-satisfying.spec.js
@@ -77,7 +77,7 @@ describe('to be rejected with error satisfying assertion', () => {
   describe('with the "exhaustively" flag', () => {
     it("errors if the rejection reason doesn't have all the same properties as the value", () => {
       return expect(function () {
-        var error = new Error('foobar');
+        const error = new Error('foobar');
         error.data = { foo: 'bar' };
         return expect(
           expect.promise.reject(error),
@@ -90,7 +90,7 @@ describe('to be rejected with error satisfying assertion', () => {
     it('errors with the correct error', () => {
       return expect(
         function () {
-          var error = new Error('foobar');
+          const error = new Error('foobar');
           error.data = { foo: 'bar' };
           return expect(
             expect.promise.reject(error),
@@ -115,7 +115,7 @@ describe('to be rejected with error satisfying assertion', () => {
   describe('without the "exhaustively" flag', () => {
     it("does not error if the rejection reason doesn't have all the same properties as the value", () => {
       return expect(function () {
-        var error = new Error('foobar');
+        const error = new Error('foobar');
         error.data = { foo: 'bar' };
         return expect(
           expect.promise.reject(error),
@@ -185,7 +185,7 @@ describe('to be rejected with error satisfying assertion', () => {
           return expect(
             function () {
               return expect.promise(function () {
-                var error = new Error('foobar');
+                const error = new Error('foobar');
                 error.data = { foo: 'bar' };
                 throw error;
               });
@@ -201,6 +201,7 @@ describe('to be rejected with error satisfying assertion', () => {
           // prettier-ignore
           function () {
             return expect(
+              /* eslint-disable no-var */
               function() {
                 return expect.promise(function () {
                   var error = new Error('foobar');
@@ -208,6 +209,7 @@ describe('to be rejected with error satisfying assertion', () => {
                   throw error;
                 });
               },
+              /* eslint-enable no-var */
               'to be rejected with error exhaustively satisfying',
               new Error('foobar')
             );
@@ -241,7 +243,7 @@ describe('to be rejected with error satisfying assertion', () => {
           return expect(
             function () {
               return expect.promise(function () {
-                var error = new Error('foobar');
+                const error = new Error('foobar');
                 error.data = { foo: 'bar' };
                 throw error;
               });
diff --git a/test/assertions/to-be.spec.js b/test/assertions/to-be.spec.js
index 1b0d00fd..f7eb399c 100644
--- a/test/assertions/to-be.spec.js
+++ b/test/assertions/to-be.spec.js
@@ -1,7 +1,7 @@
 /* global expect */
 describe('to be assertion', () => {
   it('assert === equality', () => {
-    var obj = {};
+    const obj = {};
     expect(obj, 'to be', obj);
     expect(obj, 'not to be', {});
     expect(1, 'to be', 1);
@@ -40,14 +40,14 @@ describe('to be assertion', () => {
 
   if (typeof Buffer !== 'undefined') {
     it('asserts === equality for Buffers', () => {
-      var buffer = Buffer.from([0x45, 0x59]);
+      const buffer = Buffer.from([0x45, 0x59]);
       expect(buffer, 'to be', buffer);
     });
   }
 
   if (typeof Uint8Array !== 'undefined') {
     it('asserts === equality for Uint8Array', () => {
-      var uint8Array = new Uint8Array([0x45, 0x59]);
+      const uint8Array = new Uint8Array([0x45, 0x59]);
       expect(uint8Array, 'to be', uint8Array);
     });
   }
diff --git a/test/assertions/to-begin-with.spec.js b/test/assertions/to-begin-with.spec.js
index eba392af..5639005c 100644
--- a/test/assertions/to-begin-with.spec.js
+++ b/test/assertions/to-begin-with.spec.js
@@ -1,6 +1,6 @@
 /* global expectWithUnexpectedMagicPen */
 describe('to begin with assertion', () => {
-  var expect = expectWithUnexpectedMagicPen;
+  const expect = expectWithUnexpectedMagicPen;
 
   it('should throw an error when the expected prefix is the empty string', () => {
     expect(
diff --git a/test/assertions/to-contain.spec.js b/test/assertions/to-contain.spec.js
index 25cf179b..7464b9ed 100644
--- a/test/assertions/to-contain.spec.js
+++ b/test/assertions/to-contain.spec.js
@@ -1,6 +1,6 @@
 /* global expectWithUnexpectedMagicPen */
 describe('to contain assertion', () => {
-  var expect = expectWithUnexpectedMagicPen;
+  const expect = expectWithUnexpectedMagicPen;
 
   it('should throw an error when one of the arguments is the empty string', () => {
     expect(
diff --git a/test/assertions/to-end-with.spec.js b/test/assertions/to-end-with.spec.js
index 34637c3f..dcf04c2f 100644
--- a/test/assertions/to-end-with.spec.js
+++ b/test/assertions/to-end-with.spec.js
@@ -1,6 +1,6 @@
 /* global expectWithUnexpectedMagicPen */
 describe('to end with assertion', () => {
-  var expect = expectWithUnexpectedMagicPen;
+  const expect = expectWithUnexpectedMagicPen;
 
   it('should throw an error when the expected suffix is the empty string', () => {
     expect(
diff --git a/test/assertions/to-equal.spec.js b/test/assertions/to-equal.spec.js
index c212bf44..6cf7aa39 100644
--- a/test/assertions/to-equal.spec.js
+++ b/test/assertions/to-equal.spec.js
@@ -1,6 +1,6 @@
 /* global expectWithUnexpectedMagicPen */
 describe('to equal assertion', () => {
-  var expect = expectWithUnexpectedMagicPen;
+  const expect = expectWithUnexpectedMagicPen;
 
   function toArguments() {
     return arguments;
@@ -12,7 +12,7 @@ describe('to equal assertion', () => {
     expect({ foo: 1 }, 'not to equal', { foo: '1' });
     expect(1, 'to equal', 1);
     expect(null, 'not to equal', '1');
-    var now = new Date();
+    const now = new Date();
     expect(now, 'to equal', now);
     expect(now, 'to equal', new Date(now.getTime()));
     expect({ now }, 'to equal', { now });
@@ -28,6 +28,7 @@ describe('to equal assertion', () => {
     expect(/foo/i, 'not to equal', /foo/);
     expect(/foo/gm, 'to equal', /foo/gm);
     expect(/foo/m, 'not to equal', /foo/i);
+    // eslint-disable-next-line prefer-regex-literals
     expect(/foo/m, 'to equal', new RegExp('foo', 'm'));
     expect([], 'not to equal', 0);
     expect(new Error('foo'), 'to equal', new Error('foo'));
@@ -60,12 +61,12 @@ describe('to equal assertion', () => {
 
   it('array should not equal sparse array', () => {
     expect(function () {
-      var sparse = [];
+      const sparse = [];
       sparse[1] = 2;
       expect(sparse, 'to equal', [1, 2]);
     }, 'to throw');
     expect(function () {
-      var sparse = [];
+      const sparse = [];
       sparse[1] = 2;
       expect([1, 2], 'to equal', sparse);
     }, 'to throw');
@@ -115,8 +116,8 @@ describe('to equal assertion', () => {
   });
 
   it('fails gracefully when producing a diff based on circular structures', () => {
-    var foo = { a: 'foo' };
-    var bar = { a: 'bar' };
+    const foo = { a: 'foo' };
+    const bar = { a: 'bar' };
     foo.b = foo;
     bar.b = bar;
     expect(
@@ -795,8 +796,8 @@ describe('to equal assertion', () => {
     });
 
     it('considers Error instances with the same message and stack to be equal', () => {
-      var errors = [];
-      for (var i = 0; i < 2; i += 1) {
+      const errors = [];
+      for (let i = 0; i < 2; i += 1) {
         errors.push(new Error('foo'));
       }
       expect(errors[0], 'to equal', errors[1]);
diff --git a/test/assertions/to-have-a-value-satisfying.spec.js b/test/assertions/to-have-a-value-satisfying.spec.js
index faba993b..b3b42a80 100644
--- a/test/assertions/to-have-a-value-satisfying.spec.js
+++ b/test/assertions/to-have-a-value-satisfying.spec.js
@@ -157,7 +157,7 @@ describe('to have a value satisfying assertion', () => {
   });
 
   describe('delegating to an async assertion', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to be a number after a short delay', function (
         expect,
@@ -210,7 +210,7 @@ describe('to have a value satisfying assertion', () => {
   });
 
   describe('with a subtype that overrides valueForKey()', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       name: 'oneFooObject',
diff --git a/test/assertions/to-have-an-item-satisfying.spec.js b/test/assertions/to-have-an-item-satisfying.spec.js
index 70b86f58..567b13e5 100644
--- a/test/assertions/to-have-an-item-satisfying.spec.js
+++ b/test/assertions/to-have-an-item-satisfying.spec.js
@@ -169,7 +169,7 @@ describe('to have an item satisfying assertion', () => {
   });
 
   describe('delegating to an async assertion', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to be a number after a short delay', function (
         expect,
diff --git a/test/assertions/to-have-items-satisfying.spec.js b/test/assertions/to-have-items-satisfying.spec.js
index 639afffa..093be9a6 100644
--- a/test/assertions/to-have-items-satisfying.spec.js
+++ b/test/assertions/to-have-items-satisfying.spec.js
@@ -254,7 +254,7 @@ describe('to have items satisfying assertion', () => {
   });
 
   describe('delegating to an async assertion', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to be a number after a short delay', function (
         expect,
diff --git a/test/assertions/to-have-keys-satisfying.spec.js b/test/assertions/to-have-keys-satisfying.spec.js
index b1a4a52f..34b0e731 100644
--- a/test/assertions/to-have-keys-satisfying.spec.js
+++ b/test/assertions/to-have-keys-satisfying.spec.js
@@ -194,7 +194,7 @@ describe('to have keys satisfying assertion', () => {
   });
 
   describe('delegating to an async assertion', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion(
         '<any> to be a sequence of as after a short delay',
diff --git a/test/assertions/to-have-keys.spec.js b/test/assertions/to-have-keys.spec.js
index 7a28f806..87117f79 100644
--- a/test/assertions/to-have-keys.spec.js
+++ b/test/assertions/to-have-keys.spec.js
@@ -53,7 +53,7 @@ describe('to have keys assertion', () => {
   });
 
   describe('with a subtype that overrides valueForKey()', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       name: 'upperFooObject',
diff --git a/test/assertions/to-have-length.spec.js b/test/assertions/to-have-length.spec.js
index 50487b89..c196d8ce 100644
--- a/test/assertions/to-have-length.spec.js
+++ b/test/assertions/to-have-length.spec.js
@@ -17,7 +17,7 @@ describe('to have length assertion', () => {
   });
 
   it('assert sparse array length', () => {
-    var sparse = [];
+    const sparse = [];
     sparse[1] = 'foo';
     expect(function () {
       expect(sparse, 'to have length', 2);
diff --git a/test/assertions/to-have-message.spec.js b/test/assertions/to-have-message.spec.js
index ea91e416..6e8ac63b 100644
--- a/test/assertions/to-have-message.spec.js
+++ b/test/assertions/to-have-message.spec.js
@@ -1,9 +1,9 @@
 /* global expectWithUnexpectedMagicPen */
 describe('to have message/diff assertion', () => {
-  var expect = expectWithUnexpectedMagicPen;
+  const expect = expectWithUnexpectedMagicPen;
 
   describe('with an Unexpected error', () => {
-    var err;
+    let err;
     beforeEach(() => {
       try {
         expect(1, 'to equal', 2);
@@ -23,7 +23,7 @@ describe('to have message/diff assertion', () => {
         },
         'to throw',
         expect.it(function (err) {
-          var message = err
+          const message = err
             .getErrorMessage({ format: 'text' })
             .toString('text');
           expect(
@@ -127,7 +127,7 @@ describe('to have message/diff assertion', () => {
 
     describe('when comparing against a magicpen instance', () => {
       it('should succeed', () => {
-        var expectedDiff = expect
+        const expectedDiff = expect
           .createOutput('ansi')
           .text('abc', ['bgRed', 'black'])
           .nl()
@@ -143,7 +143,7 @@ describe('to have message/diff assertion', () => {
       });
 
       it('should fail with a diff', () => {
-        var expectedDiff = expect
+        const expectedDiff = expect
           .createOutput('ansi')
           .red('-')
           .text('abc')
@@ -315,7 +315,7 @@ describe('to have message/diff assertion', () => {
   });
 
   describe('with a non-Unexpected error', () => {
-    var err = new Error('Bummer!');
+    const err = new Error('Bummer!');
     it('should succeed', () => {
       expect(err, 'to have message', 'Bummer!');
     });
diff --git a/test/assertions/to-have-properties.spec.js b/test/assertions/to-have-properties.spec.js
index 17aac571..1713e38b 100644
--- a/test/assertions/to-have-properties.spec.js
+++ b/test/assertions/to-have-properties.spec.js
@@ -8,7 +8,7 @@ describe('to have properties assertion', () => {
     expect({ a: 'foo', b: 'bar' }, 'to have own properties', ['a', 'b']);
     expect(
       function () {
-        var obj = Object.create({ a: 'foo', b: 'bar' });
+        const obj = Object.create({ a: 'foo', b: 'bar' });
         expect(obj, 'to have properties', ['a', 'b']); // should not fail
         expect(obj, 'to have own properties', ['a', 'b']); // should fail
       },
@@ -33,7 +33,7 @@ describe('to have properties assertion', () => {
   });
 
   it('asserts absence of a list of own properties', () => {
-    var obj = Object.create({ a: 'foo', b: 'bar' });
+    const obj = Object.create({ a: 'foo', b: 'bar' });
     expect(obj, 'to have properties', ['a', 'b']);
     expect(obj, 'not to have own properties', ['a', 'b']);
     expect(
@@ -95,7 +95,7 @@ describe('to have properties assertion', () => {
     });
     expect(
       function () {
-        var obj = Object.create({ a: 'foo', b: 'bar' });
+        const obj = Object.create({ a: 'foo', b: 'bar' });
         expect(obj, 'to have properties', { a: 'foo', b: 'bar' }); // should not fail
         expect(obj, 'to have own properties', { a: 'foo', b: 'bar' }); // should fail
       },
@@ -129,7 +129,7 @@ describe('to have properties assertion', () => {
   });
 
   it('asserts absence and values of an object of own properties', () => {
-    var obj = Object.create({ a: 'foo', b: 'bar' });
+    const obj = Object.create({ a: 'foo', b: 'bar' });
     expect(obj, 'to have properties', { a: 'foo', b: 'bar' });
     expect(obj, 'not to have own properties', ['a', 'b']);
     expect(
@@ -216,7 +216,7 @@ describe('to have properties assertion', () => {
   });
 
   it('works with function objects as well', () => {
-    var subject = function () {};
+    const subject = function () {};
     subject.foo = 'foo';
     subject.bar = 'bar';
     subject.baz = 'baz';
@@ -393,7 +393,10 @@ describe('to have properties assertion', () => {
     });
   });
 
-  if (typeof Symbol === 'function') {
+  if (
+    typeof Symbol === 'function' &&
+    Symbol('foo').toString() === 'Symbol(foo)'
+  ) {
     describe('with symbols', function () {
       it('should pass if the object has the given symbol(s)', () => {
         const symbol = Symbol('foo');
diff --git a/test/assertions/to-have-property.spec.js b/test/assertions/to-have-property.spec.js
index 268a7079..fb674690 100644
--- a/test/assertions/to-have-property.spec.js
+++ b/test/assertions/to-have-property.spec.js
@@ -13,7 +13,7 @@ describe('to have property assertion', () => {
   });
 
   describe('property descriptor', () => {
-    var subject = { a: 'b' };
+    const subject = { a: 'b' };
     Object.defineProperty(subject, 'enumFalse', {
       enumerable: false,
       value: 't',
@@ -244,7 +244,7 @@ describe('to have property assertion', () => {
   });
 
   describe('with a subtype that overrides valueForKey()', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       name: 'upperCaseObject',
@@ -269,7 +269,10 @@ describe('to have property assertion', () => {
     });
   });
 
-  if (typeof Symbol === 'function') {
+  if (
+    typeof Symbol === 'function' &&
+    Symbol('foo').toString() === 'Symbol(foo)'
+  ) {
     describe('with symbols', function () {
       describe('to have property', function () {
         it('should pass when the object contains the symbol', function () {
diff --git a/test/assertions/to-have-values-satisfying.spec.js b/test/assertions/to-have-values-satisfying.spec.js
index 3fff5e9c..d180701e 100644
--- a/test/assertions/to-have-values-satisfying.spec.js
+++ b/test/assertions/to-have-values-satisfying.spec.js
@@ -230,7 +230,7 @@ describe('to have values satisfying assertion', () => {
   });
 
   describe('delegating to an async assertion', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to be a number after a short delay', function (
         expect,
diff --git a/test/assertions/to-satisfy.spec.js b/test/assertions/to-satisfy.spec.js
index 106b2a55..b393619e 100644
--- a/test/assertions/to-satisfy.spec.js
+++ b/test/assertions/to-satisfy.spec.js
@@ -5,7 +5,7 @@ describe('to satisfy assertion', () => {
   }
 
   it('passes when an object is tested against itself, even in the presence of circular references', () => {
-    var circular = {};
+    const circular = {};
     circular.loop = circular;
     expect(circular, 'to satisfy', circular);
   });
@@ -130,7 +130,7 @@ describe('to satisfy assertion', () => {
     });
 
     it('should render missing custom items nicely', () => {
-      var clonedExpect = expect.clone();
+      const clonedExpect = expect.clone();
 
       clonedExpect.addStyle('xuuqProperty', function (key, inspectedValue) {
         this.text('<')
@@ -465,7 +465,7 @@ describe('to satisfy assertion', () => {
         Object.defineProperty(this, 'b', { enumerable: false, value: b });
       }
 
-      var clonedExpect = expect.clone().addType({
+      const clonedExpect = expect.clone().addType({
         name: 'MyThing',
         base: 'object',
         identify(obj) {
@@ -525,7 +525,7 @@ describe('to satisfy assertion', () => {
   });
 
   it('ignores blacklisted properties in the diff', () => {
-    var error = new Error('foo');
+    const error = new Error('foo');
     error.description = 'qux';
     expect(
       function () {
@@ -623,10 +623,10 @@ describe('to satisfy assertion', () => {
   });
 
   it('forwards normal errors found in promise aggregate errors to the top level', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to foo', function (expect, subject) {
-        var promises = [
+        const promises = [
           clonedExpect.promise(function () {
             clonedExpect('foo', 'to equal', 'bar');
           }),
@@ -1128,7 +1128,7 @@ describe('to satisfy assertion', () => {
     });
 
     it('should only consider functions that are identified as functions by the type system', () => {
-      var clonedExpect = expect.clone().addType({
+      const clonedExpect = expect.clone().addType({
         name: 'functionStartingWithF',
         identify(obj) {
           return (
@@ -1162,7 +1162,7 @@ describe('to satisfy assertion', () => {
     });
 
     it('should support satisfying against an Error instance when the subject has additional properties', () => {
-      var err = new Error('foo');
+      const err = new Error('foo');
       err.bar = 123;
       expect(err, 'to satisfy', new Error('foo'));
     });
@@ -1188,7 +1188,7 @@ describe('to satisfy assertion', () => {
 
       describe('should fail with a diff', () => {
         it('when satisfying against an object', () => {
-          var err = new Error('foo');
+          const err = new Error('foo');
           err.bar = 123;
           expect(
             function () {
@@ -1206,7 +1206,7 @@ describe('to satisfy assertion', () => {
         });
 
         it('when satisfying against another Error instance', () => {
-          var error = new Error('foobar');
+          const error = new Error('foobar');
           error.data = { foo: 'bar' };
           expect(
             function () {
@@ -1416,7 +1416,7 @@ describe('to satisfy assertion', () => {
 
   describe('on object with getters', () => {
     it('should satisfy on the value returned by the getter', () => {
-      var subject = { nextLevel: {} };
+      const subject = { nextLevel: {} };
       Object.defineProperty(subject.nextLevel, 'getMe', {
         get() {
           return 'got me';
@@ -1887,7 +1887,7 @@ describe('to satisfy assertion', () => {
   });
 
   it('indents removed objects correctly', () => {
-    var str = 'abcdefghijklmnopqrstuvwxyz';
+    const str = 'abcdefghijklmnopqrstuvwxyz';
     expect(
       function () {
         expect(
@@ -1922,7 +1922,7 @@ describe('to satisfy assertion', () => {
   });
 
   it('indents unchanged objects correctly', () => {
-    var str = 'abcdefghijklmnopqrstuvwxyz';
+    const str = 'abcdefghijklmnopqrstuvwxyz';
     expect(
       function () {
         expect(
@@ -1972,7 +1972,7 @@ describe('to satisfy assertion', () => {
       this.propertyName = `prop${Math.floor(1000 * Math.random())}`;
       this[this.propertyName] = value;
     }
-    var clonedExpect;
+    let clonedExpect;
 
     beforeEach(() => {
       clonedExpect = expect.clone().addType({
@@ -2281,7 +2281,7 @@ describe('to satisfy assertion', () => {
   });
 
   describe('when delegating to async assertions', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to be a number after a short delay', function (
         expect,
@@ -2376,7 +2376,7 @@ describe('to satisfy assertion', () => {
   describe('with an array with non-numerical properties', () => {
     describe('satisfied exhaustively against an object', () => {
       it('should succeed', () => {
-        var subject = [123];
+        const subject = [123];
         subject.foobar = 456;
         expect(subject, 'to exhaustively satisfy', {
           0: 123,
@@ -2385,7 +2385,7 @@ describe('to satisfy assertion', () => {
       });
 
       it('should fail with a diff', () => {
-        var subject = [123];
+        const subject = [123];
         subject.foobar = 456;
         expect(
           function () {
@@ -2407,21 +2407,21 @@ describe('to satisfy assertion', () => {
 
     describe('satisfied exhaustively against another array', () => {
       it('should succeed', () => {
-        var subject = [123];
+        const subject = [123];
         subject.foobar = 456;
 
-        var expected = [123];
+        const expected = [123];
         expected.foobar = 456;
         expect(subject, 'to exhaustively satisfy', expected);
       });
 
       it('should fail with a diff', () => {
-        var subject = [2, 3, 1];
+        const subject = [2, 3, 1];
         subject.foo = 123;
         subject.bar = 456;
         subject.quux = {};
 
-        var expected = [1, 2, 3];
+        const expected = [1, 2, 3];
         expected.bar = 456;
         expected.baz = 789;
         expected.quux = false;
@@ -2491,7 +2491,7 @@ describe('to satisfy assertion', () => {
     });
 
     describe('with a non-enumerable property', () => {
-      var bar = {};
+      const bar = {};
       Object.defineProperty(bar, 'nonEnumerable', {
         value: 'theValue',
         enumerable: false,
diff --git a/test/assertions/to-throw-a.spec.js b/test/assertions/to-throw-a.spec.js
index 2598d5a0..f6f0eed0 100644
--- a/test/assertions/to-throw-a.spec.js
+++ b/test/assertions/to-throw-a.spec.js
@@ -13,7 +13,7 @@ describe('to throw a/an assertion', () => {
       },
       'to throw',
       expect.it(function (err) {
-        var message = err.getErrorMessage({ format: 'text' }).toString();
+        const message = err.getErrorMessage({ format: 'text' }).toString();
 
         expect(
           message,
diff --git a/test/assertions/to-throw.spec.js b/test/assertions/to-throw.spec.js
index 00d705cf..6b4eb2be 100644
--- a/test/assertions/to-throw.spec.js
+++ b/test/assertions/to-throw.spec.js
@@ -9,7 +9,7 @@ describe('to throw assertion', () => {
       },
       'to throw',
       expect.it(function (err) {
-        var message = err.getErrorMessage({ format: 'text' }).toString();
+        const message = err.getErrorMessage({ format: 'text' }).toString();
 
         expect(
           message,
diff --git a/test/assertions/when-passed-as-parameter-to.spec.js b/test/assertions/when-passed-as-parameter-to.spec.js
index e400ab2e..87e372fa 100644
--- a/test/assertions/when-passed-as-parameter-to.spec.js
+++ b/test/assertions/when-passed-as-parameter-to.spec.js
@@ -15,7 +15,7 @@ describe('when passed as parameters to assertion', () => {
   });
 
   it('works with an array-like object', () => {
-    var args;
+    let args;
     (function () {
       args = arguments;
     })(3, 4);
diff --git a/test/common.js b/test/common.js
index b9a89969..c9535165 100644
--- a/test/common.js
+++ b/test/common.js
@@ -1,6 +1,6 @@
 /* global unexpected:true, expect:true, expectWithUnexpectedMagicPen:true, weknowhow, jasmine */
 /* eslint no-unused-vars: "off" */
-var unexpected =
+const unexpected =
   typeof window === 'undefined' || !window.weknowhow
     ? require('../lib/').clone()
     : window.weknowhow.expect.clone();
@@ -43,9 +43,9 @@ unexpected
     });
   });
 
-var expect = unexpected.clone();
+const expect = unexpected.clone();
 
-var expectWithUnexpectedMagicPen = unexpected
+const expectWithUnexpectedMagicPen = unexpected
   .clone()
   .use(
     typeof weknowhow === 'undefined'
diff --git a/test/createStandardErrorMessage.spec.js b/test/createStandardErrorMessage.spec.js
index 87829a63..34b37da9 100644
--- a/test/createStandardErrorMessage.spec.js
+++ b/test/createStandardErrorMessage.spec.js
@@ -1,12 +1,12 @@
 /* global unexpected */
 
-var expect = unexpected.clone();
+const expect = unexpected.clone();
 
 describe('createStandardErrorMessage', () => {
   // Regression test for a bug where the compactSubject of a MagicPen instance from
   // the prototype chain was picked up, causing the inner subject to be rendered as 'array'
   it('should not pick up the subject compaction code from a MagicPen instance in the prototype chain', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> shifted <assertion>', function (expect, subject) {
         expect.errorMode = 'nested';
diff --git a/test/external.spec.js b/test/external.spec.js
index 3d280b79..285be7db 100644
--- a/test/external.spec.js
+++ b/test/external.spec.js
@@ -1,15 +1,15 @@
 /* global unexpected */
 
-var expect = unexpected.clone();
+const expect = unexpected.clone();
 
 if (typeof process === 'object') {
   describe('invoked in a test via an external test runner', () => {
-    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 extend = require('../lib/utils').extend;
+    const findNodeModules = require('find-node-modules');
+    const pathModule = require('path');
+    const childProcess = require('child_process');
+    const basePath = pathModule.join(findNodeModules()[0], '..');
+    const externaltestsDir = pathModule.join(__dirname, '..', 'externaltests');
+    const extend = require('../lib/utils').extend;
     describe('executed through mocha', () => {
       expect.addAssertion(
         '<array|string> executed through mocha <object?>',
@@ -20,14 +20,16 @@ if (typeof process === 'object') {
           return expect.promise(function (run) {
             childProcess.execFile(
               pathModule.resolve(basePath, 'node_modules', '.bin', 'mocha'),
-              ['--opts', pathModule.resolve(__dirname, 'mocha.opts')].concat(
-                subject.map(function (fileName) {
+              [
+                '--config',
+                pathModule.resolve(basePath, '.mocharc.json'),
+                ...subject.map(function (fileName) {
                   return pathModule.resolve(
                     externaltestsDir,
                     `${fileName}.spec.js`
                   );
-                })
-              ),
+                }),
+              ],
               {
                 cwd: basePath,
                 env: extend({}, process.env, env || {}),
@@ -113,7 +115,9 @@ if (typeof process === 'object') {
             'to contain',
             'Error: should fail: You have created a promise that was not returned from the it block'
           );
-          expect(err, 'to satisfy', { code: 1 });
+          expect(err, 'to satisfy', {
+            code: expect.it('to be greater than', 0),
+          });
         });
       });
 
diff --git a/test/mocha.opts b/test/mocha.opts
deleted file mode 100644
index 22a15e32..00000000
--- a/test/mocha.opts
+++ /dev/null
@@ -1,6 +0,0 @@
---reporter spec
---recursive
---check-leaks
---timeout 20000
---require ./test/common
---require ./test/promisePolyfill
diff --git a/test/preferredWidth.spec.js b/test/preferredWidth.spec.js
index 2940d62b..8187932e 100644
--- a/test/preferredWidth.spec.js
+++ b/test/preferredWidth.spec.js
@@ -1,14 +1,14 @@
 /* global unexpected */
 
 describe('expect.output.preferredWidth', () => {
-  var expect = unexpected.clone();
+  let expect = unexpected.clone();
   beforeEach(() => {
     expect = expect.clone();
     expect.output.preferredWidth = 9999;
   });
 
   describe('and a clone', () => {
-    var clonedExpect;
+    let clonedExpect;
     beforeEach(() => {
       clonedExpect = expect.clone();
     });
@@ -39,7 +39,7 @@ describe('expect.output.preferredWidth', () => {
   });
 
   describe('and a child', () => {
-    var childExpect;
+    let childExpect;
     beforeEach(() => {
       childExpect = expect.child();
     });
diff --git a/test/styles/colorByIndex.spec.js b/test/styles/colorByIndex.spec.js
index b528625b..0f83b264 100644
--- a/test/styles/colorByIndex.spec.js
+++ b/test/styles/colorByIndex.spec.js
@@ -1,6 +1,6 @@
 /* global expectWithUnexpectedMagicPen */
 describe('colorByIndex', () => {
-  var expect = expectWithUnexpectedMagicPen;
+  const expect = expectWithUnexpectedMagicPen;
 
   describe('in a mode that has a palette', () => {
     it('should output colored text', () => {
@@ -14,7 +14,7 @@ describe('colorByIndex', () => {
 
   describe('in a mode without a palette', () => {
     it('should output uncolored text', () => {
-      var output = expect.createOutput('text').colorByIndex('foo', 0);
+      const output = expect.createOutput('text').colorByIndex('foo', 0);
       expect(output, 'to equal', expect.createOutput('text').text('foo'));
       expect(output.output, 'to satisfy', {
         0: {
diff --git a/test/styles/merge.spec.js b/test/styles/merge.spec.js
index a8de43a8..068aaaed 100644
--- a/test/styles/merge.spec.js
+++ b/test/styles/merge.spec.js
@@ -1,9 +1,9 @@
 /* global expect */
 describe('merge', () => {
   it('should overlay a pen on top of another', () => {
-    var pen = expect.createOutput('text');
+    const pen = expect.createOutput('text');
     pen.text('abc').nl().text('def');
-    var anotherPen = pen.clone().text(' h').nl().text('i');
+    const anotherPen = pen.clone().text(' h').nl().text('i');
     expect(
       pen.clone().merge([pen, anotherPen]).toString(),
       'to equal',
@@ -12,9 +12,9 @@ describe('merge', () => {
   });
 
   it('should result in a wider pen when merging a wide pen on top of a slim one', () => {
-    var pen = expect.createOutput('text');
+    const pen = expect.createOutput('text');
     pen.text('a').nl().text('b');
-    var anotherPen = pen.clone().text('c').nl().text('  d');
+    const anotherPen = pen.clone().text('c').nl().text('  d');
     expect(
       pen.clone().merge([pen, anotherPen]).toString(),
       'to equal',
diff --git a/test/styles/removedHighlight.spec.js b/test/styles/removedHighlight.spec.js
index 2966b938..9454157b 100644
--- a/test/styles/removedHighlight.spec.js
+++ b/test/styles/removedHighlight.spec.js
@@ -2,11 +2,11 @@
 describe('removedHighlight', () => {
   const expect = expectWithUnexpectedMagicPen;
 
-  var text = 'foo\nbar';
+  const text = 'foo\nbar';
 
   describe('in text mode', () => {
     it('escapes the newlines', () => {
-      var pen = expect.createOutput('text').removedHighlight(text);
+      const pen = expect.createOutput('text').removedHighlight(text);
       expect(pen.toString(), 'to equal', 'foo\\n\n^^^^\nbar\n^^^');
 
       expect(
diff --git a/test/styles/stringDiff.spec.js b/test/styles/stringDiff.spec.js
index b9bf5225..2ca555f4 100644
--- a/test/styles/stringDiff.spec.js
+++ b/test/styles/stringDiff.spec.js
@@ -1,13 +1,13 @@
 /* global expectWithUnexpectedMagicPen */
 describe('stringDiff', () => {
-  var expect = expectWithUnexpectedMagicPen;
+  const expect = expectWithUnexpectedMagicPen;
 
-  var actual = 'abc\ndef\nghi\njkl\nmno';
-  var expected = 'ghi\njkl\nmno\npqr\nstu\nvwx';
+  const actual = 'abc\ndef\nghi\njkl\nmno';
+  const expected = 'ghi\njkl\nmno\npqr\nstu\nvwx';
 
   describe('in text mode', () => {
     it('outputs leading + and - in text mode', () => {
-      var pen = expect.createOutput('text').stringDiff(actual, expected);
+      const pen = expect.createOutput('text').stringDiff(actual, expected);
       expect(
         pen.toString(),
         'to equal',
diff --git a/test/support/jasmineHtmlMessages.js b/test/support/jasmineHtmlMessages.js
index f024e45e..1f5fd0ed 100644
--- a/test/support/jasmineHtmlMessages.js
+++ b/test/support/jasmineHtmlMessages.js
@@ -1,12 +1,12 @@
 /* global jasmineRequire */
 (function () {
   if (typeof jasmineRequire === 'object') {
-    var originalBuildExpectationResult = jasmineRequire.buildExpectationResult();
+    const originalBuildExpectationResult = jasmineRequire.buildExpectationResult();
     jasmineRequire.buildExpectationResult = function () {
       return function (options) {
-        var result = originalBuildExpectationResult.apply(this, arguments);
+        const result = originalBuildExpectationResult.apply(this, arguments);
         if (options.error && options.error.htmlMessage) {
-          var errorElement = document.createElement('div');
+          const errorElement = document.createElement('div');
           errorElement.innerHTML = options.error.htmlMessage;
           result.stack = result.stack.substring(result.message.length);
           result.message = errorElement;
diff --git a/test/support/jasmineSetup.js b/test/support/jasmineSetup.js
index 311c9d45..e1f3ab81 100644
--- a/test/support/jasmineSetup.js
+++ b/test/support/jasmineSetup.js
@@ -11,21 +11,21 @@ function jasmineSuccess() {
   }
 }
 
-var shouldApplyPatch =
+const shouldApplyPatch =
   typeof jasmine !== 'undefined' &&
   typeof jasmine.version === 'string' &&
   jasmine.version.match(/^[23]\./);
 
 if (typeof it === 'function' && shouldApplyPatch) {
-  var originalIt = it;
+  const originalIt = it;
   // eslint-disable-next-line no-global-assign
   it = function (title, fn) {
     if (!fn) {
       return originalIt(title);
     }
-    var async = fn.length > 0;
-    var wrapper = function (done) {
-      var result;
+    const async = fn.length > 0;
+    const wrapper = function (done) {
+      let result;
       try {
         if (async) {
           fn.call(this, function (err) {
@@ -42,7 +42,7 @@ if (typeof it === 'function' && shouldApplyPatch) {
           result = fn.call(this);
         }
 
-        var isPromise =
+        const isPromise =
           result &&
           typeof result === 'object' &&
           typeof result.then === 'function';
diff --git a/test/types/Buffer-type.spec.js b/test/types/Buffer-type.spec.js
index ec66f6d2..f8e54480 100644
--- a/test/types/Buffer-type.spec.js
+++ b/test/types/Buffer-type.spec.js
@@ -2,7 +2,7 @@
 if (typeof Buffer === 'function') {
   describe('Buffer type', () => {
     it('should consider an instance equal to itself', () => {
-      var a = Buffer.from([1, 2]);
+      const a = Buffer.from([1, 2]);
       expect(a, 'to equal', a);
     });
   });
diff --git a/test/types/Promise-type.spec.js b/test/types/Promise-type.spec.js
index 964dfd5a..3eabacfb 100644
--- a/test/types/Promise-type.spec.js
+++ b/test/types/Promise-type.spec.js
@@ -1,7 +1,7 @@
 /* global expect */
 describe('Promise type', () => {
   it('should inspect a pending promise', () => {
-    var promise = new Promise(function (resolve, reject) {
+    const promise = new Promise(function (resolve, reject) {
       setTimeout(resolve, 0);
     });
     expect(promise, 'to inspect as', 'Promise');
@@ -9,7 +9,7 @@ describe('Promise type', () => {
   });
 
   it('should inspect a fulfilled promise without a value', () => {
-    var promise = new Promise(function (resolve, reject) {
+    const promise = new Promise(function (resolve, reject) {
       resolve();
     });
 
@@ -19,7 +19,7 @@ describe('Promise type', () => {
   });
 
   it('should inspect a fulfilled promise with a value', () => {
-    var promise = new Promise(function (resolve, reject) {
+    const promise = new Promise(function (resolve, reject) {
       resolve(123);
     });
 
@@ -29,7 +29,7 @@ describe('Promise type', () => {
   });
 
   it('should inspect a rejected promise without a value', () => {
-    var promise = new Promise(function (resolve, reject) {
+    const promise = new Promise(function (resolve, reject) {
       // eslint-disable-next-line prefer-promise-reject-errors
       reject();
     });
@@ -40,7 +40,7 @@ describe('Promise type', () => {
   });
 
   it('should inspect a rejected promise with a value', () => {
-    var promise = new Promise(function (resolve, reject) {
+    const promise = new Promise(function (resolve, reject) {
       setTimeout(function () {
         reject(new Error('argh'));
       }, 0);
@@ -53,7 +53,7 @@ describe('Promise type', () => {
 
   describe('with a Bluebird promise (that supports synchronous inspection)', () => {
     it('should inspect a pending promise', () => {
-      var promise = expect.promise(function (run) {
+      const promise = expect.promise(function (run) {
         setTimeout(
           run(function () {}),
           0
@@ -64,7 +64,7 @@ describe('Promise type', () => {
     });
 
     it('should inspect a fulfilled promise without a value', () => {
-      var promise = expect.promise(function () {});
+      const promise = expect.promise(function () {});
 
       return promise.then(function () {
         expect(promise, 'to inspect as', 'Promise (fulfilled)');
@@ -72,7 +72,7 @@ describe('Promise type', () => {
     });
 
     it('should inspect a fulfilled promise without a value method', () => {
-      var promise = expect.promise(function () {});
+      const promise = expect.promise(function () {});
       promise.value = null;
       return promise.then(function () {
         expect(promise, 'to inspect as', 'Promise (fulfilled)');
@@ -80,7 +80,7 @@ describe('Promise type', () => {
     });
 
     it('should inspect a fulfilled promise with a value', () => {
-      var promise = expect.promise(function (resolve, reject) {
+      const promise = expect.promise(function (resolve, reject) {
         resolve(123);
       });
 
@@ -90,7 +90,7 @@ describe('Promise type', () => {
     });
 
     it('should inspect a rejected promise without a value', () => {
-      var promise = expect.promise(function (resolve, reject) {
+      const promise = expect.promise(function (resolve, reject) {
         reject();
       });
 
@@ -100,7 +100,7 @@ describe('Promise type', () => {
     });
 
     it('should inspect a rejected promise with a value', () => {
-      var promise = expect.promise(function (resolve, reject) {
+      const promise = expect.promise(function (resolve, reject) {
         setTimeout(function () {
           reject(new Error('argh'));
         }, 0);
diff --git a/test/types/Symbol-type.spec.js b/test/types/Symbol-type.spec.js
index 7de4a517..08cd0f57 100644
--- a/test/types/Symbol-type.spec.js
+++ b/test/types/Symbol-type.spec.js
@@ -5,16 +5,16 @@ if (
   Symbol('foo').toString() === 'Symbol(foo)'
 ) {
   describe('Symbol type', () => {
-    var symbolA = Symbol('a');
-    var anotherSymbolA = Symbol('a');
-    var symbolB = Symbol('b');
+    const symbolA = Symbol('a');
+    const anotherSymbolA = Symbol('a');
+    const symbolB = Symbol('b');
 
     it('inspects correctly', () => {
       expect(symbolA, 'to inspect as', "Symbol('a')");
     });
 
     it('inspects correctly when used as a key in an object', () => {
-      var obj = {};
+      const obj = {};
       obj[symbolA] = 123;
       expect(obj, 'to inspect as', "{ [Symbol('a')]: 123 }");
     });
@@ -39,10 +39,10 @@ if (
       });
 
       it('should include Symbol properties in the "to equal" diff of objects', () => {
-        var a = { foo: 123 };
+        const a = { foo: 123 };
         a[symbolA] = 'foo';
         a[symbolB] = 123;
-        var b = { foo: 456 };
+        const b = { foo: 456 };
         b[symbolA] = 'bar';
         b[symbolB] = 123;
         expect(
@@ -89,10 +89,10 @@ if (
       });
 
       it('should include the Symbol properties in the diff', () => {
-        var a = { foo: 123 };
+        const a = { foo: 123 };
         a[symbolA] = 'foo';
         a[symbolB] = 123;
-        var b = { foo: 456 };
+        const b = { foo: 456 };
         b[symbolA] = 'bar';
         b[symbolB] = 123;
         expect(
diff --git a/test/types/any.spec.js b/test/types/any.spec.js
index eb234e02..5134e551 100644
--- a/test/types/any.spec.js
+++ b/test/types/any.spec.js
@@ -1,11 +1,11 @@
 /* global unexpected */
-var expect = unexpected.clone();
+const expect = unexpected.clone();
 
 describe('any type', () => {
-  var anyType = expect.getType('any');
+  const anyType = expect.getType('any');
   describe('when invoked with 3 arguments', () => {
     it('should inspect a value', () => {
-      var output = expect.createOutput('text');
+      const output = expect.createOutput('text');
       anyType.inspect(123, 1, output);
       expect(output.toString(), 'to equal', '123');
     });
diff --git a/test/types/array-like-type.spec.js b/test/types/array-like-type.spec.js
index 216e2215..8ce345d5 100644
--- a/test/types/array-like-type.spec.js
+++ b/test/types/array-like-type.spec.js
@@ -1,18 +1,18 @@
 /* global expect */
 describe('array-like type', () => {
   describe('equal()', () => {
-    var simpleArrayLikeType = {
+    const simpleArrayLikeType = {
       name: 'simpleArrayLike',
       base: 'array-like',
       identify: Array.isArray,
       numericalPropertiesOnly: false,
     };
-    var clonedExpect = expect.clone().addType(simpleArrayLikeType);
+    const clonedExpect = expect.clone().addType(simpleArrayLikeType);
 
     it('should treat properties with a value of undefined as equivalent to missing properties', () => {
-      var a = [];
+      const a = [];
       a.ignoreMe = undefined;
-      var b = [];
+      const b = [];
 
       clonedExpect(a, 'to equal', b);
       clonedExpect(b, 'to equal', a);
@@ -21,9 +21,9 @@ describe('array-like type', () => {
     });
 
     it('should error when a LHS key is undefined on the RHS', () => {
-      var a = ['a'];
+      const a = ['a'];
       a.foobar = true;
-      var b = ['a'];
+      const b = ['a'];
 
       expect(
         function () {
@@ -40,9 +40,9 @@ describe('array-like type', () => {
     });
 
     it('should error when a LHS key is explicitly undefined on the RHS', () => {
-      var a = ['a'];
+      const a = ['a'];
       a.foobar = true;
-      var b = ['a'];
+      const b = ['a'];
       b.foobar = undefined;
 
       expect(
@@ -60,9 +60,9 @@ describe('array-like type', () => {
     });
 
     it('should error when a LHS key is undefined on the RHS in "to satisfy"', () => {
-      var a = ['a'];
+      const a = ['a'];
       a.foobar = true;
-      var b = ['a'];
+      const b = ['a'];
       b.foobar = undefined;
 
       expect(
@@ -79,12 +79,15 @@ describe('array-like type', () => {
       );
     });
 
-    if (typeof Symbol === 'function') {
+    if (
+      typeof Symbol === 'function' &&
+      Symbol('foo').toString() === 'Symbol(foo)'
+    ) {
       it('should error when a LHS key is a Symbol but undefined on the RHS', () => {
-        var a = ['a'];
-        var s = Symbol('foo');
+        const a = ['a'];
+        const s = Symbol('foo');
         a[s] = true;
-        var b = ['a'];
+        const b = ['a'];
 
         expect(
           function () {
@@ -104,7 +107,7 @@ describe('array-like type', () => {
         'should correctly fetch keys in the absence of symbol support',
         function () {
           // stash away then clobber object symbol support
-          var getOwnPropertySymbols = Object.getOwnPropertySymbols;
+          const getOwnPropertySymbols = Object.getOwnPropertySymbols;
           delete Object.getOwnPropertySymbols;
           // grab a fresh copy of Unexpected with object symbol support disabled
           if (typeof jest !== 'undefined') {
@@ -113,17 +116,17 @@ describe('array-like type', () => {
           } else {
             delete require.cache[require.resolve('../../lib/')];
           }
-          var localExpect = require('../../lib/')
+          const localExpect = require('../../lib/')
             .clone()
             .addType(simpleArrayLikeType);
           // restore object symbol support for the rest of the suite
           Object.getOwnPropertySymbols = getOwnPropertySymbols;
 
-          var a = ['a'];
+          const a = ['a'];
           a.foobar = true;
-          var s = Symbol('foo');
+          const s = Symbol('foo');
           a[s] = true; // should be ignored
-          var b = ['a'];
+          const b = ['a'];
           b.foobar = undefined;
 
           localExpect(
@@ -144,7 +147,7 @@ describe('array-like type', () => {
   });
 
   describe('with a subtype that disables indentation', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       base: 'array-like',
@@ -206,7 +209,7 @@ describe('array-like type', () => {
   });
 
   describe('with a subtype that renders an empty prefix and an empty suffix', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       base: 'array-like',
@@ -267,7 +270,7 @@ describe('array-like type', () => {
   });
 
   describe('with a subtype that forces forceMultipleLines mode', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       base: 'array-like',
@@ -291,33 +294,33 @@ describe('array-like type', () => {
 
   describe('when both types have numericalPropertiesOnly set', () => {
     it('should only compare numerical properties for equality', () => {
-      var a = toArguments(1, 2);
-      var b = toArguments(1, 2);
+      const a = toArguments(1, 2);
+      const b = toArguments(1, 2);
       b.foo = 123;
       expect(a, 'to equal', b);
     });
 
     it('should fail when a numerical property has different values', () => {
-      var a = toArguments(1, 3);
-      var b = toArguments(1, 2);
+      const a = toArguments(1, 3);
+      const b = toArguments(1, 2);
       expect(a, 'not to equal', b);
     });
   });
 
   describe('with a custom subtype that comes with its own getKeys', () => {
     it('should process the elements in both inspection and diff in "to equal"', () => {
-      var a = ['a'];
-      var b = ['a'];
+      const a = ['a'];
+      const b = ['a'];
       b.foobar = true;
 
-      var clonedExpect = expect.clone().addType({
+      const clonedExpect = expect.clone().addType({
         name: 'foo',
         base: 'array-like',
         identify: Array.isArray,
         numericalPropertiesOnly: false,
         getKeys(obj) {
           // use array-like getKeys() method in non-numerical mode
-          var keys = this.baseType.getKeys.call(this, obj);
+          const keys = this.baseType.getKeys.call(this, obj);
           if (obj === a) {
             keys.push('foobar');
           }
@@ -340,18 +343,18 @@ describe('array-like type', () => {
     });
 
     it('should process the elements in both inspection and diff in "to satisfy"', () => {
-      var a = ['a'];
-      var b = ['a'];
+      const a = ['a'];
+      const b = ['a'];
       b.foobar = true;
 
-      var clonedExpect = expect.clone().addType({
+      const clonedExpect = expect.clone().addType({
         name: 'foo',
         base: 'array-like',
         identify: Array.isArray,
         numericalPropertiesOnly: false,
         getKeys(obj) {
           // use array-like getKeys in non-numerical mode
-          var keys = this.baseType.getKeys.call(this, obj);
+          const keys = this.baseType.getKeys.call(this, obj);
           if (obj === a) {
             keys.push('foobar');
           }
@@ -374,7 +377,7 @@ describe('array-like type', () => {
     });
 
     it('should honour the precise list of keys returned by getKeys in "to satisfy"', () => {
-      var clonedExpect = expect.clone();
+      const clonedExpect = expect.clone();
 
       clonedExpect.addType({
         name: 'foo',
@@ -384,8 +387,8 @@ describe('array-like type', () => {
         },
         numericalPropertiesOnly: false,
         getKeys: function (obj) {
-          var keys = this.baseType.getKeys(obj);
-          var fooIndex = keys.indexOf('_isFoo');
+          let keys = this.baseType.getKeys(obj);
+          const fooIndex = keys.indexOf('_isFoo');
           if (fooIndex > -1) {
             keys = keys.splice(fooIndex, 1);
           }
@@ -394,13 +397,13 @@ describe('array-like type', () => {
         },
       });
 
-      var foo1 = ['hey', 'there'];
+      const foo1 = ['hey', 'there'];
       foo1._isFoo = true;
       Object.defineProperty(foo1, 'bar', {
         value: 123,
         enumerable: false,
       });
-      var foo2 = ['hey', 'there'];
+      const foo2 = ['hey', 'there'];
       foo2._isFoo = true;
       Object.defineProperty(foo2, 'bar', {
         value: 456,
@@ -425,7 +428,7 @@ describe('array-like type', () => {
 
   describe('with a custom subtype that comes with its own hasKey', () => {
     it('should honour the presence of a key within inspection', () => {
-      var clonedExpect = expect.clone().addType({
+      const clonedExpect = expect.clone().addType({
         name: 'allExceptFoo',
         base: 'array-like',
         identify: Array.isArray,
@@ -438,7 +441,7 @@ describe('array-like type', () => {
         },
       });
 
-      var arr = ['a'];
+      const arr = ['a'];
       arr.fooAndBar = true;
 
       clonedExpect(arr, 'to inspect as', "[ 'a', fooAndBar: undefined ]");
@@ -447,7 +450,7 @@ describe('array-like type', () => {
 
   describe('with a subtype that overrides property()', () => {
     it('should render correctly in both inspection and diff in "to equal"', () => {
-      var clonedExpect = expect.clone();
+      const clonedExpect = expect.clone();
 
       clonedExpect.addStyle('xuuqProperty', function (key, inspectedValue) {
         this.text('<')
@@ -517,12 +520,12 @@ describe('array-like type', () => {
 
   describe('with a custom subtype that comes with its own valueForKeys', () => {
     it('should process the elements in both inspection and diff in "to equal"', () => {
-      var clonedExpect = expect.clone().addType({
+      const clonedExpect = expect.clone().addType({
         name: 'firstElemUpper',
         base: 'array-like',
         identify: Array.isArray,
         valueForKey: function (arr, key) {
-          var value = arr[key];
+          const value = arr[key];
           if (key === 0) {
             return value.toUpperCase();
           }
diff --git a/test/types/array-type.spec.js b/test/types/array-type.spec.js
index c968effd..0524f83b 100644
--- a/test/types/array-type.spec.js
+++ b/test/types/array-type.spec.js
@@ -1,24 +1,24 @@
 /* global expect */
 describe('array type', () => {
   it('should find an array instance identical to itself', () => {
-    var arr = [1, 2, 3];
+    const arr = [1, 2, 3];
     expect(arr, 'to equal', arr);
   });
 
   it('should inspect non-numerical properties at the end', () => {
-    var arr = [1, 2, 3];
+    const arr = [1, 2, 3];
     arr.foo = 'bar';
     arr.push(4);
     expect(arr, 'to inspect as', "[ 1, 2, 3, 4, foo: 'bar' ]");
   });
 
   it('should diff non-numerical properties', () => {
-    var arr1 = [1, 2, 3];
+    const arr1 = [1, 2, 3];
     arr1.foo = 123;
     arr1.bar = 456;
     arr1.quux = {};
 
-    var arr2 = [1, 2, 3];
+    const arr2 = [1, 2, 3];
     arr2.bar = 456;
     arr2.baz = 789;
     arr2.quux = false;
diff --git a/test/types/error-type.spec.js b/test/types/error-type.spec.js
index e8fc1ef4..5810c093 100644
--- a/test/types/error-type.spec.js
+++ b/test/types/error-type.spec.js
@@ -13,19 +13,19 @@ describe('Error type', () => {
   });
 
   it('should inspect correctly when the message is set and there are other properties', () => {
-    var err = new Error('foo');
+    const err = new Error('foo');
     err.bar = 123;
     expect(err, 'to inspect as', "Error({ message: 'foo', bar: 123 })");
   });
 
   it('should inspect correctly when the message is not set and there are other properties', () => {
-    var err = new Error();
+    const err = new Error();
     err.bar = 123;
     expect(err, 'to inspect as', "Error({ message: '', bar: 123 })");
   });
 
   it('should diff instances with unwrapped values that do not produce a diff', () => {
-    var clonedExpect = expect.clone().addType({
+    const clonedExpect = expect.clone().addType({
       name: 'numericalError',
       base: 'Error',
       identify(obj) {
@@ -47,7 +47,7 @@ describe('Error type', () => {
     );
   });
 
-  var isIE =
+  const isIE =
     typeof navigator !== 'undefined' &&
     navigator.userAgent.indexOf('Trident') !== -1;
 
@@ -65,8 +65,8 @@ describe('Error type', () => {
     }
 
     function MyError(message) {
-      var instance = new Error(message);
-      var proto = Object.getPrototypeOf(this);
+      const instance = new Error(message);
+      const proto = Object.getPrototypeOf(this);
       if (Object.setPrototypeOf) {
         Object.setPrototypeOf(instance, proto);
       } else {
@@ -114,7 +114,7 @@ describe('Error type', () => {
     });
 
     describe('when the custom error has a "name" property', () => {
-      var myError = new MyError('foo');
+      const myError = new MyError('foo');
       myError.name = 'SomethingElse';
 
       it('should use the "name" property when inspecting instances', () => {
@@ -136,7 +136,7 @@ describe('Error type', () => {
       it('should use the "name" property when diffing', () => {
         expect(
           function () {
-            var otherMyError = new MyError('bar');
+            const otherMyError = new MyError('bar');
             otherMyError.name = 'SomethingElse';
             expect(myError, 'to equal', otherMyError);
           },
@@ -156,8 +156,8 @@ describe('Error type', () => {
 
   describe('when comparing Error objects with differing enumerable keys', () => {
     it('should not break', () => {
-      var e1 = new Error('foo');
-      var e2 = new Error();
+      const e1 = new Error('foo');
+      const e2 = new Error();
       e2.message = 'foo';
 
       expect(() => {
diff --git a/test/types/function-type.spec.js b/test/types/function-type.spec.js
index 11a585d2..cd001b0e 100644
--- a/test/types/function-type.spec.js
+++ b/test/types/function-type.spec.js
@@ -9,12 +9,12 @@ describe('function type', () => {
   });
 
   it('should inspect a function with a custom toString correctly', () => {
-    var fn = function foo() {};
+    const fn = function foo() {};
     fn.toString = 'breakage';
     expect(fn, 'to inspect as', 'function foo() {}');
   });
 
-  var isIE =
+  const isIE =
     typeof navigator !== 'undefined' &&
     navigator.userAgent.indexOf('Trident') !== -1;
 
@@ -45,18 +45,18 @@ describe('function type', () => {
   });
 
   it('should inspect a one-line function correctly', () => {
-    /* eslint-disable no-unused-vars */
+    /* eslint-disable no-unused-vars, no-var */
     expect(
       // prettier-ignore
       function() { var a = 123;console.log(a); },
       'to inspect as',
       'function () { var a = 123;console.log(a); }'
     );
-    /* eslint-enable no-unused-vars */
+    /* eslint-enable no-unused-vars, no-var */
   });
 
   it('should inspect a short one-line function with leading and trailing newline correctly', () => {
-    /* eslint-disable no-unused-vars */
+    /* eslint-disable no-unused-vars, no-var */
     expect(
       // prettier-ignore
       function() {
@@ -64,11 +64,11 @@ describe('function type', () => {
       'to inspect as',
       'function () { var a = 123;console.log(a); }'
     );
-    /* eslint-enable no-unused-vars */
+    /* eslint-enable no-unused-vars, no-var */
   });
 
   it('should inspect a long one-line function with leading and trailing newline correctly', () => {
-    /* eslint-disable no-unused-vars */
+    /* eslint-disable no-unused-vars, no-var */
     expect(
       // prettier-ignore
       function() {
@@ -79,15 +79,15 @@ describe('function type', () => {
         '  var a = 123 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;console.log(a);\n' +
         '}'
     );
-    /* eslint-enable no-unused-vars */
+    /* eslint-enable no-unused-vars, no-var */
   });
 
-  /* eslint-disable no-unused-vars */
+  /* eslint-disable no-unused-vars, no-var */
   function twoLinesWithComment() {
     var a = 123;
     console.log(a); // foo
   }
-  /* eslint-enable no-unused-vars */
+  /* eslint-enable no-unused-vars, no-var */
 
   it('should inspect a short two-line function with leading and trailing newline correctly and a C++-style comment correctly', () => {
     /* eslint-disable no-unused-vars */
diff --git a/test/types/object-type.spec.js b/test/types/object-type.spec.js
index 12624958..4d5cb505 100644
--- a/test/types/object-type.spec.js
+++ b/test/types/object-type.spec.js
@@ -2,7 +2,7 @@
 describe('object type', () => {
   describe('#diff', () => {
     it('should show identical multiline values correctly in diffs', () => {
-      var clonedExpect = expect.clone().addType({
+      const clonedExpect = expect.clone().addType({
         name: 'numberNine',
         identify(obj) {
           return obj === 9;
@@ -54,7 +54,7 @@ describe('object type', () => {
     });
 
     describe('with a subtype that overrides valueForKey()', () => {
-      var clonedExpect = expect.clone();
+      const clonedExpect = expect.clone();
 
       clonedExpect.addType({
         name: 'undefinerObject',
@@ -85,7 +85,7 @@ describe('object type', () => {
   });
 
   describe('#getKeys', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       name: 'fooObject',
@@ -111,7 +111,7 @@ describe('object type', () => {
   });
 
   describe('#similar', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       name: 'ignoreUnderscoresObject',
@@ -167,7 +167,7 @@ describe('object type', () => {
   });
 
   describe('with a subtype that disables indentation', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       base: 'object',
@@ -233,7 +233,7 @@ describe('object type', () => {
   });
 
   describe('with a subtype that renders an empty prefix and an empty suffix', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       base: 'object',
@@ -298,7 +298,7 @@ describe('object type', () => {
   });
 
   describe('with a subtype that forces forceMultipleLines mode', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       base: 'object',
@@ -322,7 +322,7 @@ describe('object type', () => {
 
   describe('with a subtype that overrides property()', () => {
     it('should render correctly in both inspection and diff', () => {
-      var clonedExpect = expect.clone();
+      const clonedExpect = expect.clone();
 
       clonedExpect.addStyle('xuuqProperty', function (key, inspectedValue) {
         this.text('<')
@@ -365,7 +365,7 @@ describe('object type', () => {
   });
 
   describe('with a subtype that overrides valueForKey()', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       name: 'nineObject',
@@ -429,11 +429,11 @@ describe('object type', () => {
     (Object.setPrototypeOf ? it : it.skip)(
       'should process keys from the prototype chain in "to exhaustively satisfy"',
       function () {
-        var fooObject = {
+        const fooObject = {
           foo: 'bAr',
           oof: 'should not appear',
         };
-        var chainedObject = { nine: 9, baz: undefined };
+        const chainedObject = { nine: 9, baz: undefined };
         Object.setPrototypeOf(chainedObject, fooObject);
 
         expect(
@@ -466,7 +466,7 @@ describe('object type', () => {
       this.contentObject = contentObject;
     }
 
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     clonedExpect.addType({
       name: 'NestedObject',
diff --git a/test/types/string-type.spec.js b/test/types/string-type.spec.js
index d9ee5fd2..0763ffab 100644
--- a/test/types/string-type.spec.js
+++ b/test/types/string-type.spec.js
@@ -1,7 +1,7 @@
 /* global expect */
 describe('string type', () => {
   it('should suppress a diff when the actual value has a length greater than 64 KB', () => {
-    var longString = new Array(65538).join('A');
+    const longString = new Array(65538).join('A');
     expect(
       function () {
         expect(longString, 'to equal', 'foo');
@@ -12,7 +12,7 @@ describe('string type', () => {
   });
 
   it('should suppress a diff when the expected value has a length greater than 64 KB', () => {
-    var longString = new Array(65538).join('A');
+    const longString = new Array(65538).join('A');
     expect(
       function () {
         expect('foo', 'to equal', longString);
diff --git a/test/unexpected.spec.js b/test/unexpected.spec.js
index 1710c3f4..5e45584a 100644
--- a/test/unexpected.spec.js
+++ b/test/unexpected.spec.js
@@ -8,7 +8,7 @@ it.skipIf = function (condition) {
 };
 
 describe('unexpected', () => {
-  var expect = unexpected.clone();
+  const expect = unexpected.clone();
 
   it('should freeze the top-level unexpected instance', () => {
     const topLevelExpect =
@@ -89,7 +89,7 @@ describe('unexpected', () => {
 
     describe('in a nested expect', () => {
       it('fails when given no parameters', () => {
-        var clonedExpect = expect
+        const clonedExpect = expect
           .clone()
           .addAssertion('<any> to foo', function (expect) {
             expect();
@@ -104,7 +104,7 @@ describe('unexpected', () => {
       });
 
       it('fails when the second parameter is not a string', () => {
-        var clonedExpect = expect
+        const clonedExpect = expect
           .clone()
           .addAssertion('<any> to foo', function (expect) {
             expect({}, {});
@@ -131,7 +131,7 @@ describe('unexpected', () => {
   });
 
   it('shows a specific error message when the assertion exists, but not for the given type signature', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<string> [not] to foo <array>', function (expect) {
         expect();
@@ -151,7 +151,7 @@ describe('unexpected', () => {
 
   describe('expect', () => {
     it('should catch non-Unexpected error caught from a nested assertion', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<any> to foo', function (expect, subject) {
           return expect(subject, 'to bar');
@@ -870,7 +870,7 @@ describe('unexpected', () => {
           this.lastName = lastName;
         }
 
-        var clonedExpect = expect.clone().addType({
+        const clonedExpect = expect.clone().addType({
           name: 'Person',
           identify(value) {
             return value instanceof Person;
@@ -910,7 +910,7 @@ describe('unexpected', () => {
         it('elem was sparse', () => {
           expect(
             function () {
-              var sparse = [];
+              const sparse = [];
               sparse[1] = 2;
               sparse[2] = 3;
               expect(sparse, 'to equal', [1, 2, 3]);
@@ -928,7 +928,7 @@ describe('unexpected', () => {
         it('elem should be sparse', () => {
           expect(
             function () {
-              var sparse = [];
+              const sparse = [];
               sparse[1] = 2;
               sparse[2] = 3;
               expect([1, 2, 3], 'to equal', sparse);
@@ -949,7 +949,7 @@ describe('unexpected', () => {
 
   describe('with an assertion that has a non-standard name', () => {
     it('should render the error message sanely in an annotation block inside a satisfy diff', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<any> foobar', function (expect, subject) {
           expect(subject, 'to equal', 'foobar');
@@ -984,7 +984,7 @@ describe('unexpected', () => {
 
     describe('#appendItems', () => {
       it('should inspect multiple items', () => {
-        var magicPen = expect.output.clone();
+        const magicPen = expect.output.clone();
         magicPen.addStyle('appendInspected', function (arg) {
           this.text(arg);
         });
@@ -992,7 +992,7 @@ describe('unexpected', () => {
       });
 
       it('should default to a separator of the empty string', () => {
-        var magicPen = expect.output.clone();
+        const magicPen = expect.output.clone();
         magicPen.addStyle('appendInspected', function (arg) {
           this.text(arg);
         });
@@ -1003,7 +1003,7 @@ describe('unexpected', () => {
 
   describe('with the next assertion as a continuation', () => {
     describe('with multiple compound assertions', () => {
-      var clonedExpect = expect
+      const clonedExpect = expect
         .clone()
         .addAssertion('<number> [when] incremented <assertion?>', function (
           expect,
@@ -1212,7 +1212,7 @@ describe('unexpected', () => {
   });
 
   it('should render the error message correctly when an non-existent assertion is used later in the argument list', () => {
-    var clonedExpect = expect
+    const clonedExpect = expect
       .clone()
       .addAssertion('<any> to foo <assertion>', function (expect, subject) {
         expect(subject, 'to equal', 'foo');
@@ -1252,7 +1252,7 @@ describe('unexpected', () => {
   });
 
   describe('wrappedExpect via an assertion', () => {
-    var clonedExpect = expect.clone();
+    const clonedExpect = expect.clone();
 
     // This is roughly babel's transpilation of
     // expect.addAssertion('<string> when suffixed with foo <assertion?>', function (expect, subject, ...rest) {
@@ -1262,9 +1262,9 @@ describe('unexpected', () => {
     clonedExpect.addAssertion(
       '<string> when suffixed with foo <assertion?>',
       function (expect, subject) {
-        var _len = arguments.length;
-        var rest = Array(_len > 2 ? _len - 2 : 0);
-        for (var _key = 2; _key < _len; _key++) {
+        const _len = arguments.length;
+        const rest = Array(_len > 2 ? _len - 2 : 0);
+        for (let _key = 2; _key < _len; _key++) {
           rest[_key - 2] = arguments[_key];
         }
         return expect.apply(undefined, [`${subject}foo`].concat(rest));
@@ -1328,12 +1328,12 @@ describe('unexpected', () => {
       clonedExpect.addAssertion(
         '<string> to equal foo and when suffixed with bar <assertion?>',
         function (expect, subject) {
-          var _len = arguments.length;
-          var rest = Array(_len > 2 ? _len - 2 : 0);
-          for (var _key = 2; _key < _len; _key++) {
+          const _len = arguments.length;
+          const rest = Array(_len > 2 ? _len - 2 : 0);
+          for (let _key = 2; _key < _len; _key++) {
             rest[_key - 2] = arguments[_key];
           }
-          var result = `${subject}bar`;
+          const result = `${subject}bar`;
           return expect
             .apply(undefined, [result].concat(rest))
             .and('to equal', 'foobar')
diff --git a/test/utils.spec.js b/test/utils.spec.js
index a8fc2528..f3b4331c 100644
--- a/test/utils.spec.js
+++ b/test/utils.spec.js
@@ -1,10 +1,10 @@
 /* global expect */
 describe('utils', () => {
   if (typeof process === 'object') {
-    var utils = require('../lib/utils');
+    const utils = require('../lib/utils');
     describe('#objectIs', () => {
       describe('without Object.is available', () => {
-        var objectIs = Object.is;
+        const objectIs = Object.is;
         beforeEach(() => {
           Object.is = undefined;
         });
@@ -13,7 +13,7 @@ describe('utils', () => {
           Object.is = objectIs;
         });
 
-        var utilsWithoutObjectIsAvailable;
+        let utilsWithoutObjectIsAvailable;
         beforeEach(() => {
           // Avoid require's cache:
           delete require.cache[require.resolve('../lib/utils.js')];
@@ -70,7 +70,7 @@ describe('utils', () => {
       });
 
       describe('with Function.prototype.toString mocked out', () => {
-        var orig;
+        let orig;
         beforeEach(() => {
           orig = Function.prototype.toString;
           // eslint-disable-next-line no-extend-native