hamjest 3.7.3 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.eslintrc +15 -11
  2. package/dist/hamjest.js +6542 -23401
  3. package/dist/hamjest.min.js +1 -1
  4. package/gulpfile.js +0 -2
  5. package/index.js +95 -1
  6. package/lib/Description.js +32 -22
  7. package/lib/assertThat.js +4 -4
  8. package/lib/matchers/AllOf.js +8 -5
  9. package/lib/matchers/AnyOf.js +8 -8
  10. package/lib/matchers/DateComparisonMatcher.js +25 -24
  11. package/lib/matchers/Every.js +17 -11
  12. package/lib/matchers/FeatureMatcher.js +2 -2
  13. package/lib/matchers/Is.js +6 -5
  14. package/lib/matchers/IsAnything.js +2 -2
  15. package/lib/matchers/IsArray.js +4 -3
  16. package/lib/matchers/IsArrayContaining.js +8 -6
  17. package/lib/matchers/IsArrayContainingInAnyOrder.js +11 -8
  18. package/lib/matchers/IsArrayOrderedBy.js +5 -4
  19. package/lib/matchers/IsArrayWithItem.js +11 -8
  20. package/lib/matchers/IsArrayWithItems.js +6 -4
  21. package/lib/matchers/IsBoolean.js +4 -3
  22. package/lib/matchers/IsCloseTo.js +2 -2
  23. package/lib/matchers/IsDate.js +4 -3
  24. package/lib/matchers/IsDefined.js +4 -3
  25. package/lib/matchers/IsEqual.js +4 -3
  26. package/lib/matchers/IsFulfilled.js +2 -2
  27. package/lib/matchers/IsFunction.js +4 -3
  28. package/lib/matchers/IsFunctionThrowing.js +2 -2
  29. package/lib/matchers/IsInstanceOf.js +4 -3
  30. package/lib/matchers/IsNot.js +6 -5
  31. package/lib/matchers/IsNumber.js +4 -3
  32. package/lib/matchers/IsObject.js +4 -3
  33. package/lib/matchers/IsObjectWithProperties.js +19 -12
  34. package/lib/matchers/IsPromise.js +4 -3
  35. package/lib/matchers/IsRegExp.js +5 -6
  36. package/lib/matchers/IsRejected.js +2 -2
  37. package/lib/matchers/IsSame.js +2 -2
  38. package/lib/matchers/IsString.js +4 -3
  39. package/lib/matchers/IsStringMatching.js +2 -2
  40. package/lib/matchers/Matcher.js +10 -7
  41. package/lib/matchers/NumberComparisonMatcher.js +17 -16
  42. package/lib/matchers/SubstringMatcher.js +42 -39
  43. package/lib/matchers/failsToMatch.js +2 -2
  44. package/lib/matchers/falsy.js +2 -2
  45. package/lib/matchers/hasDescription.js +6 -5
  46. package/lib/matchers/hasExactlyOneItem.js +11 -8
  47. package/lib/matchers/hasSize.js +7 -4
  48. package/lib/matchers/inRange.js +11 -8
  49. package/lib/matchers/isEmpty.js +2 -2
  50. package/lib/matchers/matches.js +2 -2
  51. package/lib/matchers/promiseAgnostic.js +35 -15
  52. package/lib/matchers/returns.js +2 -2
  53. package/lib/matchers/truthy.js +2 -2
  54. package/lib/promiseThat.js +7 -9
  55. package/package.json +4 -5
  56. package/test/node/assertThatSpec.js +1 -3
  57. package/test/node/deferMatcher.js +2 -4
  58. package/test/node/esm/.eslintrc +5 -0
  59. package/test/node/esm/package.json +3 -0
  60. package/test/node/esm/providesNamedImports.js +3 -0
  61. package/test/node/matchers/AllOfSpec.js +1 -1
  62. package/test/node/matchers/AnyOfSpec.js +1 -1
  63. package/test/node/matchers/IsFulfilledSpec.js +29 -30
  64. package/test/node/matchers/IsPromiseSpec.js +3 -4
  65. package/test/node/matchers/IsRejectedSpec.js +21 -22
  66. package/test/node/promiseThatSpec.js +49 -86
  67. package/lib/hamjest.js +0 -106
  68. package/tags +0 -2855
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _create = require('lodash/create');
4
+ const _every = require('lodash/every');
5
+ const _filter = require('lodash/filter');
4
6
  const IsString = require('./IsString');
5
7
  const assertThat = require('../assertThat');
6
8
  const is = require('./Is').is;
@@ -9,7 +11,7 @@ const string = require('./IsString').string;
9
11
  function SubstringMatcher(substring, relation, matchesString) {
10
12
  assertThat(substring, is(string()));
11
13
 
12
- return _.create(new IsString(), {
14
+ return _create(new IsString(), {
13
15
  matchesSafely(actual) {
14
16
  return matchesString.call(this, actual);
15
17
  },
@@ -30,42 +32,43 @@ function SubstringMatcher(substring, relation, matchesString) {
30
32
  });
31
33
  }
32
34
 
33
- _.extend(SubstringMatcher, {
34
- containsString(substring) {
35
- return new SubstringMatcher(substring, 'containing', (actualString) => {
36
- return actualString.indexOf(substring) !== -1;
37
- });
38
- },
39
- containsStrings(...substrings) {
40
- substrings.map((s) => assertThat(s, is(string())));
41
- return _.create(new IsString(), {
42
- matchesSafely(actual) {
43
- return _.every(substrings, (s) => actual.indexOf(s) !== -1);
44
- },
45
- describeTo(description) {
46
- description
47
- .append('a string containing ')
48
- .appendList('', ', ', '', substrings);
49
- },
50
- describeMismatchSafely(actual, description) {
51
- const notFound = _.filter(substrings, (s) => actual.indexOf(s) === -1);
52
- description
53
- .appendList('', ', ', '', notFound)
54
- .append(' could not be found in ')
55
- .appendValue(actual);
56
- },
57
- });
58
- },
59
- startsWith(prefix) {
60
- return new SubstringMatcher(prefix, 'starting with', (actualString) => {
61
- return actualString.indexOf(prefix) === 0;
62
- });
63
- },
64
- endsWith(suffix) {
65
- return new SubstringMatcher(suffix, 'ending with', (actualString) => {
66
- return actualString.indexOf(suffix, actualString.length - suffix.length) !== -1;
67
- });
68
- }
69
- });
35
+ SubstringMatcher.containsString = function (substring) {
36
+ return new SubstringMatcher(substring, 'containing', (actualString) => {
37
+ return actualString.indexOf(substring) !== -1;
38
+ });
39
+ };
40
+
41
+ SubstringMatcher.containsStrings = function (...substrings) {
42
+ substrings.map((s) => assertThat(s, is(string())));
43
+ return _create(new IsString(), {
44
+ matchesSafely(actual) {
45
+ return _every(substrings, (s) => actual.indexOf(s) !== -1);
46
+ },
47
+ describeTo(description) {
48
+ description
49
+ .append('a string containing ')
50
+ .appendList('', ', ', '', substrings);
51
+ },
52
+ describeMismatchSafely(actual, description) {
53
+ const notFound = _filter(substrings, (s) => actual.indexOf(s) === -1);
54
+ description
55
+ .appendList('', ', ', '', notFound)
56
+ .append(' could not be found in ')
57
+ .appendValue(actual);
58
+ },
59
+ });
60
+ };
61
+
62
+ SubstringMatcher.startsWith = function (prefix) {
63
+ return new SubstringMatcher(prefix, 'starting with', (actualString) => {
64
+ return actualString.indexOf(prefix) === 0;
65
+ });
66
+ };
67
+
68
+ SubstringMatcher.endsWith = function (suffix) {
69
+ return new SubstringMatcher(suffix, 'ending with', (actualString) => {
70
+ return actualString.indexOf(suffix, actualString.length - suffix.length) !== -1;
71
+ });
72
+ };
70
73
 
71
74
  module.exports = SubstringMatcher;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _create = require('lodash/create');
4
4
  const Description = require('./../Description');
5
5
  const TypeSafeMatcher = require('./TypeSafeMatcher');
6
6
  const anything = require('./IsAnything').anything;
@@ -9,7 +9,7 @@ const isMatcher = require('./Matcher').isMatcher;
9
9
 
10
10
  function failsToMatch(target, descriptionMatcher) {
11
11
  descriptionMatcher = descriptionMatcher ? asMatcher(descriptionMatcher) : anything();
12
- return _.create(new TypeSafeMatcher(), {
12
+ return _create(new TypeSafeMatcher(), {
13
13
  isExpectedType: function (actual) {
14
14
  return isMatcher(actual);
15
15
  },
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _create = require('lodash/create');
4
4
  const Matcher = require('./Matcher');
5
5
 
6
6
  function falsy() {
7
- return _.create(new Matcher(), {
7
+ return _create(new Matcher(), {
8
8
  matches: function (actualValue) {
9
9
  return !actualValue;
10
10
  },
@@ -1,13 +1,14 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _create = require('lodash/create');
4
4
  const Description = require('./../Description');
5
5
  const TypeSafeMatcher = require('./TypeSafeMatcher');
6
- const acceptingMatcher = require('../utils/acceptingMatcher');
6
+ const asMatcher = require('../utils/asMatcher');
7
7
  const isMatcher = require('./Matcher').isMatcher;
8
8
 
9
- module.exports = acceptingMatcher((descriptionMatcher) => {
10
- return _.create(new TypeSafeMatcher(), {
9
+ module.exports = function (valueOrMatcher) {
10
+ const descriptionMatcher = asMatcher(valueOrMatcher);
11
+ return _create(new TypeSafeMatcher(), {
11
12
  isExpectedType: function (actual) {
12
13
  return isMatcher(actual);
13
14
  },
@@ -29,4 +30,4 @@ module.exports = acceptingMatcher((descriptionMatcher) => {
29
30
  descriptionMatcher.describeMismatch(actualDescription, description);
30
31
  }
31
32
  });
32
- });
33
+ };
@@ -1,18 +1,21 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _create = require('lodash/create');
4
+ const _filter = require('lodash/filter');
5
+ const _map = require('lodash/map');
4
6
  const IsArray = require('./IsArray');
5
- const acceptingMatcher = require('../utils/acceptingMatcher');
6
7
  const promiseAgnostic = require('./promiseAgnostic');
8
+ const asMatcher = require('../utils/asMatcher');
7
9
 
8
- module.exports = acceptingMatcher((matcher) => {
9
- return _.create(new IsArray(), {
10
+ module.exports = function (valueOrMatcher) {
11
+ const matcher = asMatcher(valueOrMatcher);
12
+ return _create(new IsArray(), {
10
13
  matchesSafely: function (actual) {
11
- const results = _.map(actual, (value) => {
14
+ const results = _map(actual, (value) => {
12
15
  return matcher.matches(value);
13
16
  });
14
17
 
15
- return promiseAgnostic.matchesAggregate(results, (results) => _.filter(results).length === 1);
18
+ return promiseAgnostic.matchesAggregate(results, (results) => _filter(results).length === 1);
16
19
  },
17
20
  describeTo: function (description) {
18
21
  description
@@ -24,7 +27,7 @@ module.exports = acceptingMatcher((matcher) => {
24
27
  description.append('was empty');
25
28
  return;
26
29
  }
27
- const results = _.map(actual, (value) => {
30
+ const results = _map(actual, (value) => {
28
31
  return matcher.matches(value);
29
32
  });
30
33
 
@@ -67,4 +70,4 @@ module.exports = acceptingMatcher((matcher) => {
67
70
  }));
68
71
  }
69
72
  });
70
- });
73
+ };
@@ -1,14 +1,17 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _create = require('lodash/create');
4
+ const _isObject = require('lodash/isObject');
5
+ const _isString = require('lodash/isString');
6
+ const _size = require('lodash/size');
4
7
  const TypeSafeMatcher = require('./TypeSafeMatcher');
5
8
  const FeatureMatcher = require('./FeatureMatcher');
6
9
 
7
10
  module.exports = function (valueOrMatcher) {
8
- const innerMatcher = new FeatureMatcher(valueOrMatcher, 'a collection or string with size', 'size', (item) => _.size(item));
9
- return _.create(new TypeSafeMatcher(), {
11
+ const innerMatcher = new FeatureMatcher(valueOrMatcher, 'a collection or string with size', 'size', (item) => _size(item));
12
+ return _create(new TypeSafeMatcher(), {
10
13
  isExpectedType: function (actual) {
11
- return _.isString(actual) || _.isObject(actual);
14
+ return _isString(actual) || _isObject(actual);
12
15
  },
13
16
  matchesSafely: innerMatcher.matches,
14
17
  describeTo: innerMatcher.describeTo,
@@ -1,21 +1,24 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _create = require('lodash/create');
4
+ const _inRange = require('lodash/inRange');
5
+ const _isUndefined = require('lodash/isUndefined');
6
+ const assertThat = require('../assertThat');
7
+ const is = require('../matchers/Is').is;
8
+ const isNumber = require('../matchers/IsNumber').number;
4
9
 
5
10
  module.exports = function (start, end) {
6
- const __ = require('../..');
7
-
8
- if (_.isUndefined(end)) {
11
+ if (_isUndefined(end)) {
9
12
  end = start;
10
13
  start = 0;
11
14
  }
12
15
 
13
- __.assertThat('Start', start, __.is(__.number()));
14
- __.assertThat('End', end, __.is(__.number()));
16
+ assertThat('Start', start, is(isNumber()));
17
+ assertThat('End', end, is(isNumber()));
15
18
 
16
- return _.create(__.number(), {
19
+ return _create(isNumber(), {
17
20
  matchesSafely: function (actual) {
18
- return _.inRange(actual, start, end);
21
+ return _inRange(actual, start, end);
19
22
  },
20
23
  describeTo: function (description) {
21
24
  description
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _extend = require('lodash/extend');
4
4
  const hasSize = require('./hasSize');
5
5
 
6
6
  module.exports = function () {
7
- return _.extend(hasSize(0), {
7
+ return _extend(hasSize(0), {
8
8
  describeTo: function (description) {
9
9
  description.append('an empty collection or string');
10
10
  }
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _create = require('lodash/create');
4
4
  const Description = require('./../Description');
5
5
  const TypeSafeMatcher = require('./TypeSafeMatcher');
6
6
  const isMatcher = require('./Matcher').isMatcher;
7
7
 
8
8
  function matches(target) {
9
- return _.create(new TypeSafeMatcher(), {
9
+ return _create(new TypeSafeMatcher(), {
10
10
  isExpectedType: function (actual) {
11
11
  return isMatcher(actual);
12
12
  },
@@ -1,41 +1,61 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
4
- const Bluebird = require('bluebird');
3
+ const _forEach = require('lodash/forEach');
4
+ const _identity = require('lodash/identity');
5
+ const _isArray = require('lodash/isArray');
6
+ const _isFunction = require('lodash/isFunction');
7
+ const _reduce = require('lodash/reduce');
8
+ const _some = require('lodash/some');
5
9
 
6
10
  function resolve(promises) {
7
- if (_.isArray(promises)) {
8
- return Bluebird.all(promises);
11
+ if (_isArray(promises)) {
12
+ return Promise.all(promises);
9
13
  } else {
10
- return Bluebird.props(promises);
14
+ return Promise.resolve(promises)
15
+ .then((object) =>
16
+ Promise.all(
17
+ Object.entries(object).map(([key, value]) =>
18
+ Promise.resolve(value).then((value) => [key, value])
19
+ )
20
+ )
21
+ )
22
+ .then((items) => {
23
+ const results = {};
24
+
25
+ for (const [key, value] of items) {
26
+ results[key] = value;
27
+ }
28
+
29
+ return results;
30
+ });
11
31
  }
12
32
  }
13
33
 
14
34
  const promiseAgnostic = {
15
35
  matches: function (result, handler) {
16
36
  if (isPromise(result)) {
17
- return Bluebird.resolve(result).then(handler);
37
+ return Promise.resolve(result).then(handler);
18
38
  } else {
19
39
  return handler(result);
20
40
  }
21
41
  },
22
42
  matchesAggregate: function (results, handler) {
23
- if (_.some(results, isPromise)) {
43
+ if (_some(results, isPromise)) {
24
44
  return resolve(results).then(handler);
25
45
  } else {
26
46
  return handler(results);
27
47
  }
28
48
  },
29
49
  describeMismatchAggregate: function (results, handler, suffixFn) {
30
- if (_.some(results, isPromise)) {
50
+ if (_some(results, isPromise)) {
31
51
  return resolve(results).then((results) => {
32
- return _.reduce(results, (chain, result, key) => {
52
+ return _reduce(results, (chain, result, key) => {
33
53
  return chain.then(() => handler(result, key));
34
- }, Bluebird.resolve());
54
+ }, Promise.resolve());
35
55
  })
36
- .then(suffixFn || _.identity);
56
+ .then(suffixFn || _identity);
37
57
  } else {
38
- _.forEach(results, (result, key) => {
58
+ _forEach(results, (result, key) => {
39
59
  return handler(result, key);
40
60
  });
41
61
  if (suffixFn) {
@@ -45,9 +65,9 @@ const promiseAgnostic = {
45
65
  },
46
66
  describeMismatch: function (result, handler, suffixFn) {
47
67
  if (isPromise(result)) {
48
- return Bluebird.resolve(result)
68
+ return Promise.resolve(result)
49
69
  .then(handler)
50
- .then(suffixFn || _.identity);
70
+ .then(suffixFn || _identity);
51
71
  } else {
52
72
  handler(result);
53
73
  if (suffixFn) {
@@ -58,7 +78,7 @@ const promiseAgnostic = {
58
78
  };
59
79
 
60
80
  function isPromise(value) {
61
- return value && _.isFunction(value.then);
81
+ return value && _isFunction(value.then);
62
82
  }
63
83
 
64
84
  module.exports = promiseAgnostic;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _create = require('lodash/create');
4
4
  const anything = require('./IsAnything').anything;
5
5
  const asMatcher = require('../utils/asMatcher');
6
6
  const func = require('./IsFunction').func;
@@ -8,7 +8,7 @@ const getType = require('../utils/getType');
8
8
 
9
9
  module.exports = function returns(resultValueOrMatcher) {
10
10
  const resultMatcher = resultValueOrMatcher ? asMatcher(resultValueOrMatcher) : anything();
11
- return _.create(func(), {
11
+ return _create(func(), {
12
12
  matchesSafely: function (actual) {
13
13
  try {
14
14
  const result = actual();
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _create = require('lodash/create');
4
4
  const Matcher = require('./Matcher');
5
5
 
6
6
  function truthy() {
7
- return _.create(new Matcher(), {
7
+ return _create(new Matcher(), {
8
8
  matches: function (actualValue) {
9
9
  return !!actualValue;
10
10
  },
@@ -1,9 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const _ = require('lodash');
3
+ const _isFunction = require('lodash/isFunction');
4
4
  const AssertionError = require('assertion-error');
5
- const Bluebird = require('bluebird');
6
-
7
5
  const Description = require('./Description');
8
6
 
9
7
  function promiseThat(reason, actual, matcher) {
@@ -13,24 +11,24 @@ function promiseThat(reason, actual, matcher) {
13
11
  reason = '';
14
12
  }
15
13
 
16
- return Bluebird.try(() => matcher.matches(actual)).then((result) => {
14
+ return Promise.resolve().then(() => matcher.matches(actual)).then((result) => {
17
15
  if (!result) {
18
16
  const description = new Description();
19
17
  description.append(reason)
20
18
  .append('\nExpected: ')
21
19
  .appendDescriptionOf(matcher)
22
20
  .append('\n but: ');
23
- return Bluebird.try(() => matcher.describeMismatch(actual, description))
21
+ return Promise.resolve().then(() => matcher.describeMismatch(actual, description))
24
22
  .then(() => {
25
- if (!_.isFunction(matcher.getExpectedForDiff) ||
26
- !_.isFunction(matcher.formatActualForDiff)) {
23
+ if (!_isFunction(matcher.getExpectedForDiff) ||
24
+ !_isFunction(matcher.formatActualForDiff)) {
27
25
  return {};
28
26
  }
29
27
 
30
- return Bluebird.all([
28
+ return Promise.all([
31
29
  matcher.getExpectedForDiff(),
32
30
  matcher.formatActualForDiff(actual)
33
- ]).spread((expected, actual) => {
31
+ ]).then(([expected, actual]) => {
34
32
  return {
35
33
  showDiff: true,
36
34
  expected: expected,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hamjest",
3
- "version": "3.7.3",
3
+ "version": "4.0.1",
4
4
  "main": "index.js",
5
5
  "description": "A library of composable matchers for defining meaningful and readable assertions in JavaScript.",
6
6
  "homepage": "https://github.com/rluba/hamjest",
@@ -43,7 +43,6 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "assertion-error": "^1.1.0",
46
- "bluebird": "^3.3.4",
47
46
  "lodash": "^4.17.15"
48
47
  },
49
48
  "devDependencies": {
@@ -59,15 +58,15 @@
59
58
  "eslint-config-leanbyte": "^2.0.0",
60
59
  "gulp": "^4.0.2",
61
60
  "gulp-eslint": "^6.0.0",
62
- "gulp-mocha": "^7.0.2",
61
+ "gulp-mocha": "^8.0.0",
63
62
  "gulp-rename": "^2.0.0",
64
63
  "gulp-typescript": "^6.0.0-alpha.1",
65
64
  "gulp-uglify": "^3.0.2",
66
- "karma": "^5.0.4",
65
+ "karma": "^6.4.1",
67
66
  "karma-chrome-launcher": "^3.0.0",
68
67
  "karma-firefox-launcher": "^1.1.0",
69
68
  "karma-mocha": "^2.0.1",
70
- "mocha": "^7.1.2",
69
+ "mocha": "^10.2.0",
71
70
  "typescript": "^3.8.3",
72
71
  "vinyl-buffer": "^1.0.1",
73
72
  "vinyl-source-stream": "^2.0.0"
@@ -1,9 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const assert = require('assert');
4
-
5
4
  const AssertionError = require('assertion-error');
6
- const Bluebird = require('bluebird');
7
5
 
8
6
  const __ = require('../..');
9
7
  const TestMatcher = require('./TestMatcher');
@@ -93,7 +91,7 @@ describe('assertThat', () => {
93
91
  let thrown;
94
92
 
95
93
  try {
96
- __.assertThat('a value', new TestMatcher(() => Bluebird.resolve(true)));
94
+ __.assertThat('a value', new TestMatcher(() => Promise.resolve(true)));
97
95
  } catch (e) {
98
96
  thrown = e;
99
97
  }
@@ -1,11 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const Bluebird = require('bluebird');
4
-
5
3
  function deferMatcher(matcher) {
6
4
  return {
7
5
  matches: function (actual) {
8
- return Bluebird.try(() => matcher.matches(actual));
6
+ return Promise.resolve().then(() => matcher.matches(actual));
9
7
  },
10
8
  describeTo: function (description) {
11
9
  description.append('deferred: ');
@@ -13,7 +11,7 @@ function deferMatcher(matcher) {
13
11
  },
14
12
  describeMismatch: function (actual, description) {
15
13
  description.append('deferred: ');
16
- return Bluebird.try(() => matcher.describeMismatch(actual, description));
14
+ return Promise.resolve().then(() => matcher.describeMismatch(actual, description));
17
15
  }
18
16
  };
19
17
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "parserOptions": {
3
+ "sourceType": "module"
4
+ }
5
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,3 @@
1
+ import {assertThat, equalTo} from '../../../index.js';
2
+
3
+ assertThat('If this test fails, ESM named-imports (might) fail.', 0, equalTo(0));
@@ -3,7 +3,7 @@
3
3
  const _ = require('lodash');
4
4
  const assert = require('assert');
5
5
 
6
- const __ = require('../../../lib/hamjest');
6
+ const __ = require('../../..');
7
7
  const deferMatcher = require('../deferMatcher');
8
8
 
9
9
  describe('AllOf', () => {
@@ -2,7 +2,7 @@
2
2
 
3
3
  const assert = require('assert');
4
4
 
5
- const __ = require('../../../lib/hamjest');
5
+ const __ = require('../../..');
6
6
 
7
7
  describe('AnyOf', () => {
8
8