Skip to content

Commit 19c4f35

Browse files
futpibnovemberborn
andauthoredJun 14, 2020
Experimentally implement t.like() assertion
Co-authored-by: Mark Wubben <mark@novemberborn.net>
1 parent 952a017 commit 19c4f35

27 files changed

+930
-218
lines changed
 

‎docs/03-assertions.md

+49
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,55 @@ Assert that `value` is deeply equal to `expected`. See [Concordance](https://git
207207

208208
Assert that `value` is not deeply equal to `expected`. The inverse of `.deepEqual()`.
209209

210+
### `.like(value, selector, message?)`
211+
212+
Assert that `value` is like `selector`. This is a variant of `.deepEqual()`, however `selector` does not need to have the same enumerable properties as `value` does.
213+
214+
Instead AVA derives a *comparable* object from `value`, based on the deeply-nested properties of `selector`. This object is then compared to `selector` using `.deepEqual()`.
215+
216+
Any values in `selector` that are not regular objects should be deeply equal to the corresponding values in `value`.
217+
218+
This is an experimental assertion for the time being. You need to enable it:
219+
220+
**`package.json`**:
221+
222+
```json
223+
{
224+
"ava": {
225+
"nonSemVerExperiments": {
226+
"likeAssertion": true
227+
}
228+
}
229+
}
230+
```
231+
232+
**`ava.config.js`**:
233+
234+
```js
235+
export default {
236+
nonSemVerExperiments: {
237+
likeAssertion: true
238+
}
239+
}
240+
```
241+
242+
In the following example, the `map` property of `value` must be deeply equal to that of `selector`. However `nested.qux` is ignored, because it's not in `selector`.
243+
244+
```js
245+
t.like({
246+
map: new Map([['foo', 'bar']]),
247+
nested: {
248+
baz: 'thud',
249+
qux: 'quux'
250+
}
251+
}, {
252+
map: new Map([['foo', 'bar']]),
253+
nested: {
254+
baz: 'thud',
255+
}
256+
})
257+
```
258+
210259
### `.throws(fn, expectation?, message?)`
211260

212261
Assert that an error is thrown. `fn` must be a function which should throw. The thrown value *must* be an error. It is returned so you can run more assertions against it.

‎index.d.ts

+11
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ export interface Assertions {
4545
/** Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
4646
deepEqual: DeepEqualAssertion;
4747

48+
/** Assert that `actual` is like `expected`. */
49+
like: LikeAssertion;
50+
4851
/** Fail the test. */
4952
fail: FailAssertion;
5053

@@ -125,6 +128,14 @@ export interface DeepEqualAssertion {
125128
skip(actual: any, expected: any, message?: string): void;
126129
}
127130

131+
export interface LikeAssertion {
132+
/** Assert that `value` is like `selector`. */
133+
(value: any, selector: object, message?: string): void;
134+
135+
/** Skip this assertion. */
136+
skip(value: any, selector: any, message?: string): void;
137+
}
138+
128139
export interface FailAssertion {
129140
/** Fail the test. */
130141
(message?: string): void;

‎lib/assert.js

+58-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const concordance = require('concordance');
33
const isError = require('is-error');
44
const isPromise = require('is-promise');
55
const concordanceOptions = require('./concordance-options').default;
6+
const {CIRCULAR_SELECTOR, isLikeSelector, selectComparable} = require('./like-selector');
67
const snapshotManager = require('./snapshot-manager');
78

89
function formatDescriptorDiff(actualDescriptor, expectedDescriptor, options) {
@@ -241,7 +242,8 @@ class Assertions {
241242
fail = notImplemented,
242243
skip = notImplemented,
243244
compareWithSnapshot = notImplemented,
244-
powerAssert
245+
powerAssert,
246+
experiments = {}
245247
} = {}) {
246248
const withSkip = assertionFn => {
247249
assertionFn.skip = skip;
@@ -386,6 +388,61 @@ class Assertions {
386388
}
387389
});
388390

391+
this.like = withSkip((actual, selector, message) => {
392+
if (!experiments.likeAssertion) {
393+
fail(new AssertionError({
394+
assertion: 'like',
395+
improperUsage: true,
396+
message: 'You must enable the `likeAssertion` experiment in order to use `t.like()`'
397+
}));
398+
return;
399+
}
400+
401+
if (!checkMessage('like', message)) {
402+
return;
403+
}
404+
405+
if (!isLikeSelector(selector)) {
406+
fail(new AssertionError({
407+
assertion: 'like',
408+
improperUsage: true,
409+
message: '`t.like()` selector must be a non-empty object',
410+
values: [formatWithLabel('Called with:', selector)]
411+
}));
412+
return;
413+
}
414+
415+
let comparable;
416+
try {
417+
comparable = selectComparable(actual, selector);
418+
} catch (error) {
419+
if (error === CIRCULAR_SELECTOR) {
420+
fail(new AssertionError({
421+
assertion: 'like',
422+
improperUsage: true,
423+
message: '`t.like()` selector must not contain circular references',
424+
values: [formatWithLabel('Called with:', selector)]
425+
}));
426+
return;
427+
}
428+
429+
throw error;
430+
}
431+
432+
const result = concordance.compare(comparable, selector, concordanceOptions);
433+
if (result.pass) {
434+
pass();
435+
} else {
436+
const actualDescriptor = result.actual || concordance.describe(comparable, concordanceOptions);
437+
const expectedDescriptor = result.expected || concordance.describe(selector, concordanceOptions);
438+
fail(new AssertionError({
439+
assertion: 'like',
440+
message,
441+
values: [formatDescriptorDiff(actualDescriptor, expectedDescriptor)]
442+
}));
443+
}
444+
});
445+
389446
this.throws = withSkip((...args) => {
390447
// Since arrow functions do not support 'arguments', we are using rest
391448
// operator, so we can determine the total number of arguments passed

‎lib/like-selector.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
'use strict';
2+
function isLikeSelector(selector) {
3+
return selector !== null &&
4+
typeof selector === 'object' &&
5+
Reflect.getPrototypeOf(selector) === Object.prototype &&
6+
Reflect.ownKeys(selector).length > 0;
7+
}
8+
9+
exports.isLikeSelector = isLikeSelector;
10+
11+
const CIRCULAR_SELECTOR = new Error('Encountered a circular selector');
12+
exports.CIRCULAR_SELECTOR = CIRCULAR_SELECTOR;
13+
14+
function selectComparable(lhs, selector, circular = new Set()) {
15+
if (circular.has(selector)) {
16+
throw CIRCULAR_SELECTOR;
17+
}
18+
19+
circular.add(selector);
20+
21+
if (lhs === null || typeof lhs !== 'object') {
22+
return lhs;
23+
}
24+
25+
const comparable = {};
26+
for (const [key, rhs] of Object.entries(selector)) {
27+
if (isLikeSelector(rhs)) {
28+
comparable[key] = selectComparable(Reflect.get(lhs, key), rhs, circular);
29+
} else {
30+
comparable[key] = Reflect.get(lhs, key);
31+
}
32+
}
33+
34+
return comparable;
35+
}
36+
37+
exports.selectComparable = selectComparable;

‎lib/load-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const pkgConf = require('pkg-conf');
77

88
const NO_SUCH_FILE = Symbol('no ava.config.js file');
99
const MISSING_DEFAULT_EXPORT = Symbol('missing default export');
10-
const EXPERIMENTS = new Set(['reverseTeardowns']);
10+
const EXPERIMENTS = new Set(['likeAssertion', 'reverseTeardowns']);
1111

1212
// *Very* rudimentary support for loading ava.config.js files containing an `export default` statement.
1313
const evaluateJsConfig = configFile => {

‎lib/test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ class ExecutionContext extends assert.Assertions {
3939
compareWithSnapshot: options => {
4040
return test.compareWithSnapshot(options);
4141
},
42-
powerAssert: test.powerAssert
42+
powerAssert: test.powerAssert,
43+
experiments: test.experiments
4344
});
4445
testMap.set(this, test);
4546

‎test-d/like.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import test from '..';
2+
3+
test('like', t => {
4+
t.like({
5+
map: new Map([['foo', 'bar']]),
6+
nested: {
7+
baz: 'thud',
8+
qux: 'quux'
9+
}
10+
}, {
11+
map: new Map([['foo', 'bar']]),
12+
nested: {
13+
baz: 'thud'
14+
}
15+
});
16+
});
17+

‎test-tap/assert.js

+207
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ const assertions = new class extends assert.Assertions {
3131
lastFailure = error;
3232
},
3333
skip: () => {},
34+
experiments: {
35+
likeAssertion: true
36+
},
3437
...overwrites
3538
});
3639
}
@@ -783,6 +786,210 @@ test('.notDeepEqual()', t => {
783786
t.end();
784787
});
785788

789+
test('.like()', t => {
790+
fails(t, () => {
791+
assertions.like({a: false}, {a: 0});
792+
});
793+
794+
passes(t, () => {
795+
assertions.like({
796+
a: 'a',
797+
b: 'b'
798+
}, {
799+
b: 'b',
800+
a: 'a'
801+
});
802+
});
803+
804+
passes(t, () => {
805+
const {like} = assertions;
806+
like({a: 'a', b: 'b'}, {b: 'b', a: 'a'});
807+
});
808+
809+
passes(t, () => {
810+
assertions.like({
811+
a: 'a',
812+
b: 'b',
813+
c: {
814+
d: 'd',
815+
x: 'x'
816+
},
817+
x: 'x'
818+
}, {
819+
c: {
820+
d: 'd'
821+
},
822+
b: 'b',
823+
a: 'a'
824+
});
825+
});
826+
827+
fails(t, () => {
828+
assertions.like([1, 2, 3], [1, 2, 3, 4]);
829+
});
830+
831+
fails(t, () => {
832+
assertions.like({
833+
a: [1, 2, 3]
834+
}, {
835+
a: [1, 2, 3, 4]
836+
});
837+
});
838+
839+
passes(t, () => {
840+
assertions.like({
841+
a: [1, 2, 3],
842+
x: 'x'
843+
}, {
844+
a: [1, 2, 3]
845+
});
846+
});
847+
848+
passes(t, () => {
849+
const actual = {
850+
a: 'a',
851+
extra: 'irrelevant'
852+
};
853+
actual.circular = actual;
854+
855+
const likePattern = {
856+
a: 'a'
857+
};
858+
859+
assertions.like(actual, likePattern);
860+
});
861+
862+
fails(t, () => {
863+
const fnA = a => a;
864+
const fnB = a => a;
865+
assertions.like(fnA, fnB);
866+
});
867+
868+
fails(t, () => {
869+
const fnA = a => a;
870+
const fnB = a => a;
871+
assertions.like({
872+
fn: fnA
873+
}, {
874+
fn: fnB
875+
});
876+
});
877+
878+
fails(t, () => {
879+
function Foo(a) {
880+
this.a = a;
881+
}
882+
883+
function Bar(a) {
884+
this.a = a;
885+
}
886+
887+
const x = new Foo(1);
888+
const y = new Bar(1);
889+
890+
assertions.like(x, y);
891+
});
892+
893+
passes(t, () => {
894+
assertions.like({a: 'a'}, {a: 'a'});
895+
});
896+
897+
passes(t, () => {
898+
assertions.like({a: 'a', b: 'b'}, {a: 'a'});
899+
});
900+
901+
passes(t, () => {
902+
assertions.like({ab: ['a', 'b']}, {ab: ['a', 'b']});
903+
});
904+
905+
passes(t, () => {
906+
assertions.like({ab: ['a', 'b'], c: 'c'}, {ab: ['a', 'b']});
907+
});
908+
909+
fails(t, () => {
910+
assertions.like({a: 'a'}, {a: 'b'});
911+
});
912+
913+
fails(t, () => {
914+
assertions.like({a: 'a', b: 'b'}, {a: 'b'});
915+
});
916+
917+
fails(t, () => {
918+
assertions.like({ab: ['a', 'b']}, {ab: ['a', 'a']});
919+
});
920+
921+
fails(t, () => {
922+
assertions.like({ab: ['a', 'b'], c: 'c'}, {ab: ['a', 'a']});
923+
});
924+
925+
fails(t, () => {
926+
assertions.like([['a', 'b'], 'c'], [['a', 'b'], 'd']);
927+
});
928+
929+
fails(t, () => {
930+
const circular = ['a', 'b'];
931+
circular.push(circular);
932+
assertions.like([circular, 'c'], [circular, 'd']);
933+
});
934+
935+
fails(t, () => {
936+
const circular = ['a', 'b'];
937+
circular.push(circular);
938+
assertions.like({xc: [circular, 'c']}, {xc: [circular, 'd']});
939+
});
940+
941+
failsWith(t, () => {
942+
assertions.like({a: 'a'}, {});
943+
}, {
944+
assertion: 'like',
945+
message: '`t.like()` selector must be a non-empty object',
946+
values: [{label: 'Called with:', formatted: '{}'}]
947+
});
948+
949+
failsWith(t, () => {
950+
assertions.like('foo', 'bar');
951+
}, {
952+
assertion: 'like',
953+
message: '`t.like()` selector must be a non-empty object',
954+
values: [{label: 'Called with:', formatted: '\'bar\''}]
955+
});
956+
957+
failsWith(t, () => {
958+
const likePattern = {
959+
a: 'a'
960+
};
961+
likePattern.circular = likePattern;
962+
963+
assertions.like({}, likePattern);
964+
}, {
965+
assertion: 'like',
966+
message: '`t.like()` selector must not contain circular references',
967+
values: [{label: 'Called with:', formatted: '{\n a: \'a\',\n circular: [Circular],\n}'}]
968+
});
969+
970+
failsWith(t, () => {
971+
assertions.like({}, {}, null);
972+
}, {
973+
assertion: 'like',
974+
improperUsage: true,
975+
message: 'The assertion message must be a string',
976+
values: [{
977+
label: 'Called with:',
978+
formatted: /null/
979+
}]
980+
});
981+
982+
failsWith(t, () => {
983+
assertions.like({a: 'foo', b: 'irrelevant'}, {a: 'bar'});
984+
}, {
985+
assertion: 'like',
986+
message: '',
987+
values: [{label: 'Difference:', formatted: /{\n-\s*a: 'foo',\n\+\s*a: 'bar',\n\s*}/}]
988+
});
989+
990+
t.end();
991+
});
992+
786993
test('.throws()', gather(t => {
787994
// Fails because function doesn't throw.
788995
failsWith(t, () => {

‎test-tap/fixture/report/regular/nested-objects.js

+26
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,29 @@ test('format with max depth 4', t => {
2727
};
2828
t.deepEqual(exp, act);
2929
});
30+
31+
test('format like with max depth 4', t => {
32+
const pattern = {
33+
a: {
34+
b: {
35+
foo: 'qux'
36+
}
37+
}
38+
};
39+
const actual = {
40+
a: {
41+
b: {
42+
foo: 'bar',
43+
extra: 'irrelevant'
44+
}
45+
},
46+
c: {
47+
d: {
48+
e: {
49+
foo: 'bar'
50+
}
51+
}
52+
}
53+
};
54+
t.like(actual, pattern);
55+
});

‎test-tap/helper/report.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ exports.assert = (t, logFile, buffer) => {
5252
// Log the entire actual and expected values, so they can be diffed
5353
// manually. TAP's diff output is really confusing in this situation.
5454
console.dir({actual, expected});
55-
t.fail('Output did not match expectation');
55+
t.fail(`Output did not match expectation: ${logFile}`);
5656
}
5757
};
5858

@@ -88,7 +88,7 @@ const run = (type, reporter, {match = [], filter} = {}) => {
8888
serial: type === 'failFast' || type === 'failFast2',
8989
require: [],
9090
cacheEnabled: true,
91-
experiments: {},
91+
experiments: {likeAssertion: true},
9292
match,
9393
providers,
9494
projectDir,

‎test-tap/reporters/mini.regular.v10.log

+49-21
Original file line numberDiff line numberDiff line change
@@ -7,155 +7,159 @@
77

88
1 test failed---tty-stream-chunk-separator
99
---tty-stream-chunk-separator
10+
* nested-objects › format like with max depth 4
11+
12+
2 tests failed---tty-stream-chunk-separator
13+
---tty-stream-chunk-separator
1014
* output-in-hook › passing test
1115

1216
1 passed
13-
1 test failed---tty-stream-chunk-separator
17+
2 tests failed---tty-stream-chunk-separator
1418
---tty-stream-chunk-separator
1519
* output-in-hook › failing test
1620

1721
1 passed
18-
2 tests failed---tty-stream-chunk-separator
22+
3 tests failed---tty-stream-chunk-separator
1923
---tty-stream-chunk-separator
2024
* test › passes
2125

2226
2 passed
23-
2 tests failed
27+
3 tests failed
2428
1 skipped
2529
1 todo---tty-stream-chunk-separator
2630
---tty-stream-chunk-separator
2731
* test › fails
2832

2933
2 passed
30-
3 tests failed
34+
4 tests failed
3135
1 skipped
3236
1 todo---tty-stream-chunk-separator
3337
---tty-stream-chunk-separator
3438
* test › known failure
3539

3640
2 passed
3741
1 known failure
38-
3 tests failed
42+
4 tests failed
3943
1 skipped
4044
1 todo---tty-stream-chunk-separator
4145
---tty-stream-chunk-separator
4246
* test › no longer failing
4347

4448
2 passed
4549
1 known failure
46-
4 tests failed
50+
5 tests failed
4751
1 skipped
4852
1 todo---tty-stream-chunk-separator
4953
---tty-stream-chunk-separator
5054
* test › logs
5155

5256
2 passed
5357
1 known failure
54-
5 tests failed
58+
6 tests failed
5559
1 skipped
5660
1 todo---tty-stream-chunk-separator
5761
---tty-stream-chunk-separator
5862
* test › formatted
5963

6064
2 passed
6165
1 known failure
62-
6 tests failed
66+
7 tests failed
6367
1 skipped
6468
1 todo---tty-stream-chunk-separator
6569
---tty-stream-chunk-separator
6670
* test › power-assert
6771

6872
2 passed
6973
1 known failure
70-
7 tests failed
74+
8 tests failed
7175
1 skipped
7276
1 todo---tty-stream-chunk-separator
7377
---tty-stream-chunk-separator
7478
* test › bad throws
7579

7680
2 passed
7781
1 known failure
78-
8 tests failed
82+
9 tests failed
7983
1 skipped
8084
1 todo---tty-stream-chunk-separator
8185
---tty-stream-chunk-separator
8286
* test › bad notThrows
8387

8488
2 passed
8589
1 known failure
86-
9 tests failed
90+
10 tests failed
8791
1 skipped
8892
1 todo---tty-stream-chunk-separator
8993
---tty-stream-chunk-separator
9094
* test › implementation throws non-error
9195

9296
2 passed
9397
1 known failure
94-
10 tests failed
98+
11 tests failed
9599
1 skipped
96100
1 todo---tty-stream-chunk-separator
97101
---tty-stream-chunk-separator
98102
* traces-in-t-throws › throws
99103

100104
2 passed
101105
1 known failure
102-
11 tests failed
106+
12 tests failed
103107
1 skipped
104108
1 todo---tty-stream-chunk-separator
105109
---tty-stream-chunk-separator
106110
* traces-in-t-throws › notThrows
107111

108112
2 passed
109113
1 known failure
110-
12 tests failed
114+
13 tests failed
111115
1 skipped
112116
1 todo---tty-stream-chunk-separator
113117
---tty-stream-chunk-separator
114118
* traces-in-t-throws › notThrowsAsync
115119

116120
2 passed
117121
1 known failure
118-
13 tests failed
122+
14 tests failed
119123
1 skipped
120124
1 todo---tty-stream-chunk-separator
121125
---tty-stream-chunk-separator
122126
* traces-in-t-throws › throwsAsync
123127

124128
2 passed
125129
1 known failure
126-
14 tests failed
130+
15 tests failed
127131
1 skipped
128132
1 todo---tty-stream-chunk-separator
129133
---tty-stream-chunk-separator
130134
* traces-in-t-throws › throwsAsync different error
131135

132136
2 passed
133137
1 known failure
134-
15 tests failed
138+
16 tests failed
135139
1 skipped
136140
1 todo---tty-stream-chunk-separator
137141
---tty-stream-chunk-separator
138142
* uncaught-exception › passes
139143

140144
3 passed
141145
1 known failure
142-
15 tests failed
146+
16 tests failed
143147
1 skipped
144148
1 todo---tty-stream-chunk-separator
145149
---tty-stream-chunk-separator
146150
* unhandled-rejection › passes
147151

148152
4 passed
149153
1 known failure
150-
15 tests failed
154+
16 tests failed
151155
1 skipped
152156
1 todo---tty-stream-chunk-separator
153157
---tty-stream-chunk-separator
154158
* unhandled-rejection › unhandled non-error rejection
155159

156160
5 passed
157161
1 known failure
158-
15 tests failed
162+
16 tests failed
159163
1 skipped
160164
1 todo---tty-stream-chunk-separator
161165
---tty-stream-chunk-separator
@@ -193,6 +197,30 @@
193197

194198

195199

200+
nested-objects › format like with max depth 4
201+
202+
nested-objects.js:54
203+
204+
53: };
205+
 54: t.like(actual, pattern);
206+
55: });
207+
208+
Difference:
209+
210+
{
211+
a: {
212+
b: {
213+
- foo: 'bar',
214+
+ foo: 'qux',
215+
},
216+
},
217+
}
218+
219+
› t (test-tap/fixture/report/regular/nested-objects.js:54:4)
220+
› process._tickCallback (internal/process/next_tick.js:68:7)
221+
222+
223+
196224
output-in-hook › failing test
197225

198226
output-in-hook.js:34
@@ -518,7 +546,7 @@
518546

519547
─
520548

521-
15 tests failed
549+
16 tests failed
522550
1 known failure
523551
1 test skipped
524552
1 test todo

‎test-tap/reporters/mini.regular.v12.log

+48-21
Original file line numberDiff line numberDiff line change
@@ -7,155 +7,159 @@
77

88
1 test failed---tty-stream-chunk-separator
99
---tty-stream-chunk-separator
10+
* nested-objects › format like with max depth 4
11+
12+
2 tests failed---tty-stream-chunk-separator
13+
---tty-stream-chunk-separator
1014
* output-in-hook › passing test
1115

1216
1 passed
13-
1 test failed---tty-stream-chunk-separator
17+
2 tests failed---tty-stream-chunk-separator
1418
---tty-stream-chunk-separator
1519
* output-in-hook › failing test
1620

1721
1 passed
18-
2 tests failed---tty-stream-chunk-separator
22+
3 tests failed---tty-stream-chunk-separator
1923
---tty-stream-chunk-separator
2024
* test › passes
2125

2226
2 passed
23-
2 tests failed
27+
3 tests failed
2428
1 skipped
2529
1 todo---tty-stream-chunk-separator
2630
---tty-stream-chunk-separator
2731
* test › fails
2832

2933
2 passed
30-
3 tests failed
34+
4 tests failed
3135
1 skipped
3236
1 todo---tty-stream-chunk-separator
3337
---tty-stream-chunk-separator
3438
* test › known failure
3539

3640
2 passed
3741
1 known failure
38-
3 tests failed
42+
4 tests failed
3943
1 skipped
4044
1 todo---tty-stream-chunk-separator
4145
---tty-stream-chunk-separator
4246
* test › no longer failing
4347

4448
2 passed
4549
1 known failure
46-
4 tests failed
50+
5 tests failed
4751
1 skipped
4852
1 todo---tty-stream-chunk-separator
4953
---tty-stream-chunk-separator
5054
* test › logs
5155

5256
2 passed
5357
1 known failure
54-
5 tests failed
58+
6 tests failed
5559
1 skipped
5660
1 todo---tty-stream-chunk-separator
5761
---tty-stream-chunk-separator
5862
* test › formatted
5963

6064
2 passed
6165
1 known failure
62-
6 tests failed
66+
7 tests failed
6367
1 skipped
6468
1 todo---tty-stream-chunk-separator
6569
---tty-stream-chunk-separator
6670
* test › power-assert
6771

6872
2 passed
6973
1 known failure
70-
7 tests failed
74+
8 tests failed
7175
1 skipped
7276
1 todo---tty-stream-chunk-separator
7377
---tty-stream-chunk-separator
7478
* test › bad throws
7579

7680
2 passed
7781
1 known failure
78-
8 tests failed
82+
9 tests failed
7983
1 skipped
8084
1 todo---tty-stream-chunk-separator
8185
---tty-stream-chunk-separator
8286
* test › bad notThrows
8387

8488
2 passed
8589
1 known failure
86-
9 tests failed
90+
10 tests failed
8791
1 skipped
8892
1 todo---tty-stream-chunk-separator
8993
---tty-stream-chunk-separator
9094
* test › implementation throws non-error
9195

9296
2 passed
9397
1 known failure
94-
10 tests failed
98+
11 tests failed
9599
1 skipped
96100
1 todo---tty-stream-chunk-separator
97101
---tty-stream-chunk-separator
98102
* traces-in-t-throws › throws
99103

100104
2 passed
101105
1 known failure
102-
11 tests failed
106+
12 tests failed
103107
1 skipped
104108
1 todo---tty-stream-chunk-separator
105109
---tty-stream-chunk-separator
106110
* traces-in-t-throws › notThrows
107111

108112
2 passed
109113
1 known failure
110-
12 tests failed
114+
13 tests failed
111115
1 skipped
112116
1 todo---tty-stream-chunk-separator
113117
---tty-stream-chunk-separator
114118
* traces-in-t-throws › notThrowsAsync
115119

116120
2 passed
117121
1 known failure
118-
13 tests failed
122+
14 tests failed
119123
1 skipped
120124
1 todo---tty-stream-chunk-separator
121125
---tty-stream-chunk-separator
122126
* traces-in-t-throws › throwsAsync
123127

124128
2 passed
125129
1 known failure
126-
14 tests failed
130+
15 tests failed
127131
1 skipped
128132
1 todo---tty-stream-chunk-separator
129133
---tty-stream-chunk-separator
130134
* traces-in-t-throws › throwsAsync different error
131135

132136
2 passed
133137
1 known failure
134-
15 tests failed
138+
16 tests failed
135139
1 skipped
136140
1 todo---tty-stream-chunk-separator
137141
---tty-stream-chunk-separator
138142
* uncaught-exception › passes
139143

140144
3 passed
141145
1 known failure
142-
15 tests failed
146+
16 tests failed
143147
1 skipped
144148
1 todo---tty-stream-chunk-separator
145149
---tty-stream-chunk-separator
146150
* unhandled-rejection › passes
147151

148152
4 passed
149153
1 known failure
150-
15 tests failed
154+
16 tests failed
151155
1 skipped
152156
1 todo---tty-stream-chunk-separator
153157
---tty-stream-chunk-separator
154158
* unhandled-rejection › unhandled non-error rejection
155159

156160
5 passed
157161
1 known failure
158-
15 tests failed
162+
16 tests failed
159163
1 skipped
160164
1 todo---tty-stream-chunk-separator
161165
---tty-stream-chunk-separator
@@ -192,6 +196,29 @@
192196

193197

194198

199+
nested-objects › format like with max depth 4
200+
201+
nested-objects.js:54
202+
203+
53: };
204+
 54: t.like(actual, pattern);
205+
55: });
206+
207+
Difference:
208+
209+
{
210+
a: {
211+
b: {
212+
- foo: 'bar',
213+
+ foo: 'qux',
214+
},
215+
},
216+
}
217+
218+
› test-tap/fixture/report/regular/nested-objects.js:54:4
219+
220+
221+
195222
output-in-hook › failing test
196223

197224
output-in-hook.js:34
@@ -502,7 +529,7 @@
502529

503530
─
504531

505-
15 tests failed
532+
16 tests failed
506533
1 known failure
507534
1 test skipped
508535
1 test todo

‎test-tap/reporters/mini.regular.v13.log

+48-21
Original file line numberDiff line numberDiff line change
@@ -7,155 +7,159 @@
77

88
1 test failed---tty-stream-chunk-separator
99
---tty-stream-chunk-separator
10+
* nested-objects › format like with max depth 4
11+
12+
2 tests failed---tty-stream-chunk-separator
13+
---tty-stream-chunk-separator
1014
* output-in-hook › passing test
1115

1216
1 passed
13-
1 test failed---tty-stream-chunk-separator
17+
2 tests failed---tty-stream-chunk-separator
1418
---tty-stream-chunk-separator
1519
* output-in-hook › failing test
1620

1721
1 passed
18-
2 tests failed---tty-stream-chunk-separator
22+
3 tests failed---tty-stream-chunk-separator
1923
---tty-stream-chunk-separator
2024
* test › passes
2125

2226
2 passed
23-
2 tests failed
27+
3 tests failed
2428
1 skipped
2529
1 todo---tty-stream-chunk-separator
2630
---tty-stream-chunk-separator
2731
* test › fails
2832

2933
2 passed
30-
3 tests failed
34+
4 tests failed
3135
1 skipped
3236
1 todo---tty-stream-chunk-separator
3337
---tty-stream-chunk-separator
3438
* test › known failure
3539

3640
2 passed
3741
1 known failure
38-
3 tests failed
42+
4 tests failed
3943
1 skipped
4044
1 todo---tty-stream-chunk-separator
4145
---tty-stream-chunk-separator
4246
* test › no longer failing
4347

4448
2 passed
4549
1 known failure
46-
4 tests failed
50+
5 tests failed
4751
1 skipped
4852
1 todo---tty-stream-chunk-separator
4953
---tty-stream-chunk-separator
5054
* test › logs
5155

5256
2 passed
5357
1 known failure
54-
5 tests failed
58+
6 tests failed
5559
1 skipped
5660
1 todo---tty-stream-chunk-separator
5761
---tty-stream-chunk-separator
5862
* test › formatted
5963

6064
2 passed
6165
1 known failure
62-
6 tests failed
66+
7 tests failed
6367
1 skipped
6468
1 todo---tty-stream-chunk-separator
6569
---tty-stream-chunk-separator
6670
* test › power-assert
6771

6872
2 passed
6973
1 known failure
70-
7 tests failed
74+
8 tests failed
7175
1 skipped
7276
1 todo---tty-stream-chunk-separator
7377
---tty-stream-chunk-separator
7478
* test › bad throws
7579

7680
2 passed
7781
1 known failure
78-
8 tests failed
82+
9 tests failed
7983
1 skipped
8084
1 todo---tty-stream-chunk-separator
8185
---tty-stream-chunk-separator
8286
* test › bad notThrows
8387

8488
2 passed
8589
1 known failure
86-
9 tests failed
90+
10 tests failed
8791
1 skipped
8892
1 todo---tty-stream-chunk-separator
8993
---tty-stream-chunk-separator
9094
* test › implementation throws non-error
9195

9296
2 passed
9397
1 known failure
94-
10 tests failed
98+
11 tests failed
9599
1 skipped
96100
1 todo---tty-stream-chunk-separator
97101
---tty-stream-chunk-separator
98102
* traces-in-t-throws › throws
99103

100104
2 passed
101105
1 known failure
102-
11 tests failed
106+
12 tests failed
103107
1 skipped
104108
1 todo---tty-stream-chunk-separator
105109
---tty-stream-chunk-separator
106110
* traces-in-t-throws › notThrows
107111

108112
2 passed
109113
1 known failure
110-
12 tests failed
114+
13 tests failed
111115
1 skipped
112116
1 todo---tty-stream-chunk-separator
113117
---tty-stream-chunk-separator
114118
* traces-in-t-throws › notThrowsAsync
115119

116120
2 passed
117121
1 known failure
118-
13 tests failed
122+
14 tests failed
119123
1 skipped
120124
1 todo---tty-stream-chunk-separator
121125
---tty-stream-chunk-separator
122126
* traces-in-t-throws › throwsAsync
123127

124128
2 passed
125129
1 known failure
126-
14 tests failed
130+
15 tests failed
127131
1 skipped
128132
1 todo---tty-stream-chunk-separator
129133
---tty-stream-chunk-separator
130134
* traces-in-t-throws › throwsAsync different error
131135

132136
2 passed
133137
1 known failure
134-
15 tests failed
138+
16 tests failed
135139
1 skipped
136140
1 todo---tty-stream-chunk-separator
137141
---tty-stream-chunk-separator
138142
* uncaught-exception › passes
139143

140144
3 passed
141145
1 known failure
142-
15 tests failed
146+
16 tests failed
143147
1 skipped
144148
1 todo---tty-stream-chunk-separator
145149
---tty-stream-chunk-separator
146150
* unhandled-rejection › passes
147151

148152
4 passed
149153
1 known failure
150-
15 tests failed
154+
16 tests failed
151155
1 skipped
152156
1 todo---tty-stream-chunk-separator
153157
---tty-stream-chunk-separator
154158
* unhandled-rejection › unhandled non-error rejection
155159

156160
5 passed
157161
1 known failure
158-
15 tests failed
162+
16 tests failed
159163
1 skipped
160164
1 todo---tty-stream-chunk-separator
161165
---tty-stream-chunk-separator
@@ -192,6 +196,29 @@
192196

193197

194198

199+
nested-objects › format like with max depth 4
200+
201+
nested-objects.js:54
202+
203+
53: };
204+
 54: t.like(actual, pattern);
205+
55: });
206+
207+
Difference:
208+
209+
{
210+
a: {
211+
b: {
212+
- foo: 'bar',
213+
+ foo: 'qux',
214+
},
215+
},
216+
}
217+
218+
› test-tap/fixture/report/regular/nested-objects.js:54:4
219+
220+
221+
195222
output-in-hook › failing test
196223

197224
output-in-hook.js:34
@@ -502,7 +529,7 @@
502529

503530
─
504531

505-
15 tests failed
532+
16 tests failed
506533
1 known failure
507534
1 test skipped
508535
1 test todo

‎test-tap/reporters/mini.regular.v14.log

+48-21
Original file line numberDiff line numberDiff line change
@@ -7,155 +7,159 @@
77

88
1 test failed---tty-stream-chunk-separator
99
---tty-stream-chunk-separator
10+
* nested-objects › format like with max depth 4
11+
12+
2 tests failed---tty-stream-chunk-separator
13+
---tty-stream-chunk-separator
1014
* output-in-hook › passing test
1115

1216
1 passed
13-
1 test failed---tty-stream-chunk-separator
17+
2 tests failed---tty-stream-chunk-separator
1418
---tty-stream-chunk-separator
1519
* output-in-hook › failing test
1620

1721
1 passed
18-
2 tests failed---tty-stream-chunk-separator
22+
3 tests failed---tty-stream-chunk-separator
1923
---tty-stream-chunk-separator
2024
* test › passes
2125

2226
2 passed
23-
2 tests failed
27+
3 tests failed
2428
1 skipped
2529
1 todo---tty-stream-chunk-separator
2630
---tty-stream-chunk-separator
2731
* test › fails
2832

2933
2 passed
30-
3 tests failed
34+
4 tests failed
3135
1 skipped
3236
1 todo---tty-stream-chunk-separator
3337
---tty-stream-chunk-separator
3438
* test › known failure
3539

3640
2 passed
3741
1 known failure
38-
3 tests failed
42+
4 tests failed
3943
1 skipped
4044
1 todo---tty-stream-chunk-separator
4145
---tty-stream-chunk-separator
4246
* test › no longer failing
4347

4448
2 passed
4549
1 known failure
46-
4 tests failed
50+
5 tests failed
4751
1 skipped
4852
1 todo---tty-stream-chunk-separator
4953
---tty-stream-chunk-separator
5054
* test › logs
5155

5256
2 passed
5357
1 known failure
54-
5 tests failed
58+
6 tests failed
5559
1 skipped
5660
1 todo---tty-stream-chunk-separator
5761
---tty-stream-chunk-separator
5862
* test › formatted
5963

6064
2 passed
6165
1 known failure
62-
6 tests failed
66+
7 tests failed
6367
1 skipped
6468
1 todo---tty-stream-chunk-separator
6569
---tty-stream-chunk-separator
6670
* test › power-assert
6771

6872
2 passed
6973
1 known failure
70-
7 tests failed
74+
8 tests failed
7175
1 skipped
7276
1 todo---tty-stream-chunk-separator
7377
---tty-stream-chunk-separator
7478
* test › bad throws
7579

7680
2 passed
7781
1 known failure
78-
8 tests failed
82+
9 tests failed
7983
1 skipped
8084
1 todo---tty-stream-chunk-separator
8185
---tty-stream-chunk-separator
8286
* test › bad notThrows
8387

8488
2 passed
8589
1 known failure
86-
9 tests failed
90+
10 tests failed
8791
1 skipped
8892
1 todo---tty-stream-chunk-separator
8993
---tty-stream-chunk-separator
9094
* test › implementation throws non-error
9195

9296
2 passed
9397
1 known failure
94-
10 tests failed
98+
11 tests failed
9599
1 skipped
96100
1 todo---tty-stream-chunk-separator
97101
---tty-stream-chunk-separator
98102
* traces-in-t-throws › throws
99103

100104
2 passed
101105
1 known failure
102-
11 tests failed
106+
12 tests failed
103107
1 skipped
104108
1 todo---tty-stream-chunk-separator
105109
---tty-stream-chunk-separator
106110
* traces-in-t-throws › notThrows
107111

108112
2 passed
109113
1 known failure
110-
12 tests failed
114+
13 tests failed
111115
1 skipped
112116
1 todo---tty-stream-chunk-separator
113117
---tty-stream-chunk-separator
114118
* traces-in-t-throws › notThrowsAsync
115119

116120
2 passed
117121
1 known failure
118-
13 tests failed
122+
14 tests failed
119123
1 skipped
120124
1 todo---tty-stream-chunk-separator
121125
---tty-stream-chunk-separator
122126
* traces-in-t-throws › throwsAsync
123127

124128
2 passed
125129
1 known failure
126-
14 tests failed
130+
15 tests failed
127131
1 skipped
128132
1 todo---tty-stream-chunk-separator
129133
---tty-stream-chunk-separator
130134
* traces-in-t-throws › throwsAsync different error
131135

132136
2 passed
133137
1 known failure
134-
15 tests failed
138+
16 tests failed
135139
1 skipped
136140
1 todo---tty-stream-chunk-separator
137141
---tty-stream-chunk-separator
138142
* uncaught-exception › passes
139143

140144
3 passed
141145
1 known failure
142-
15 tests failed
146+
16 tests failed
143147
1 skipped
144148
1 todo---tty-stream-chunk-separator
145149
---tty-stream-chunk-separator
146150
* unhandled-rejection › passes
147151

148152
4 passed
149153
1 known failure
150-
15 tests failed
154+
16 tests failed
151155
1 skipped
152156
1 todo---tty-stream-chunk-separator
153157
---tty-stream-chunk-separator
154158
* unhandled-rejection › unhandled non-error rejection
155159

156160
5 passed
157161
1 known failure
158-
15 tests failed
162+
16 tests failed
159163
1 skipped
160164
1 todo---tty-stream-chunk-separator
161165
---tty-stream-chunk-separator
@@ -192,6 +196,29 @@
192196

193197

194198

199+
nested-objects › format like with max depth 4
200+
201+
nested-objects.js:54
202+
203+
53: };
204+
 54: t.like(actual, pattern);
205+
55: });
206+
207+
Difference:
208+
209+
{
210+
a: {
211+
b: {
212+
- foo: 'bar',
213+
+ foo: 'qux',
214+
},
215+
},
216+
}
217+
218+
› test-tap/fixture/report/regular/nested-objects.js:54:4
219+
220+
221+
195222
output-in-hook › failing test
196223

197224
output-in-hook.js:34
@@ -502,7 +529,7 @@
502529

503530
─
504531

505-
15 tests failed
532+
16 tests failed
506533
1 known failure
507534
1 test skipped
508535
1 test todo

‎test-tap/reporters/tap.regular.v10.log

+49-29
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,26 @@ not ok 3 - nested-objects › format with max depth 4
3737
process._tickCallback (internal/process/next_tick.js:68:7)
3838
...
3939
---tty-stream-chunk-separator
40+
# nested-objects › format like with max depth 4
41+
not ok 4 - nested-objects › format like with max depth 4
42+
---
43+
name: AssertionError
44+
assertion: like
45+
values:
46+
'Difference:': |2-
47+
{
48+
a: {
49+
b: {
50+
- foo: 'bar',
51+
+ foo: 'qux',
52+
},
53+
},
54+
}
55+
at: |-
56+
t (test-tap/fixture/report/regular/nested-objects.js:54:4)
57+
process._tickCallback (internal/process/next_tick.js:68:7)
58+
...
59+
---tty-stream-chunk-separator
4060
# output-in-hook › before hook
4161
---tty-stream-chunk-separator
4262
# output-in-hook › before hook
@@ -52,10 +72,10 @@ not ok 3 - nested-objects › format with max depth 4
5272
# beforeEach
5373
---tty-stream-chunk-separator
5474
# output-in-hook › passing test
55-
ok 4 - output-in-hook › passing test
75+
ok 5 - output-in-hook › passing test
5676
---tty-stream-chunk-separator
5777
# output-in-hook › failing test
58-
not ok 5 - output-in-hook › failing test
78+
not ok 6 - output-in-hook › failing test
5979
---
6080
name: AssertionError
6181
message: Test failed via `t.fail()`
@@ -82,16 +102,16 @@ not ok 5 - output-in-hook › failing test
82102
# afterAlways
83103
---tty-stream-chunk-separator
84104
# test › skip
85-
ok 6 - test › skip # SKIP
105+
ok 7 - test › skip # SKIP
86106
---tty-stream-chunk-separator
87107
# test › todo
88-
not ok 7 - test › todo # TODO
108+
not ok 8 - test › todo # TODO
89109
---tty-stream-chunk-separator
90110
# test › passes
91-
ok 8 - test › passes
111+
ok 9 - test › passes
92112
---tty-stream-chunk-separator
93113
# test › fails
94-
not ok 9 - test › fails
114+
not ok 10 - test › fails
95115
---
96116
name: AssertionError
97117
message: Test failed via `t.fail()`
@@ -102,10 +122,10 @@ not ok 9 - test › fails
102122
...
103123
---tty-stream-chunk-separator
104124
# test › known failure
105-
ok 10 - test › known failure
125+
ok 11 - test › known failure
106126
---tty-stream-chunk-separator
107127
# test › no longer failing
108-
not ok 11 - test › no longer failing
128+
not ok 12 - test › no longer failing
109129
---
110130
name: Error
111131
message: >-
@@ -115,7 +135,7 @@ not ok 11 - test › no longer failing
115135
...
116136
---tty-stream-chunk-separator
117137
# test › logs
118-
not ok 12 - test › logs
138+
not ok 13 - test › logs
119139
* hello
120140
* world
121141
---
@@ -128,7 +148,7 @@ not ok 12 - test › logs
128148
...
129149
---tty-stream-chunk-separator
130150
# test › formatted
131-
not ok 13 - test › formatted
151+
not ok 14 - test › formatted
132152
---
133153
name: AssertionError
134154
assertion: deepEqual
@@ -142,7 +162,7 @@ not ok 13 - test › formatted
142162
...
143163
---tty-stream-chunk-separator
144164
# test › power-assert
145-
not ok 14 - test › power-assert
165+
not ok 15 - test › power-assert
146166
---
147167
name: AssertionError
148168
assertion: assert
@@ -155,7 +175,7 @@ not ok 14 - test › power-assert
155175
...
156176
---tty-stream-chunk-separator
157177
# test › bad throws
158-
not ok 15 - test › bad throws
178+
not ok 16 - test › bad throws
159179
---
160180
name: AssertionError
161181
message: Improper usage of `t.throws()` detected
@@ -172,7 +192,7 @@ not ok 15 - test › bad throws
172192
...
173193
---tty-stream-chunk-separator
174194
# test › bad notThrows
175-
not ok 16 - test › bad notThrows
195+
not ok 17 - test › bad notThrows
176196
---
177197
name: AssertionError
178198
message: Improper usage of `t.notThrows()` detected
@@ -189,7 +209,7 @@ not ok 16 - test › bad notThrows
189209
...
190210
---tty-stream-chunk-separator
191211
# test › implementation throws non-error
192-
not ok 17 - test › implementation throws non-error
212+
not ok 18 - test › implementation throws non-error
193213
---
194214
name: AssertionError
195215
message: Error thrown in test
@@ -199,7 +219,7 @@ not ok 17 - test › implementation throws non-error
199219
...
200220
---tty-stream-chunk-separator
201221
# traces-in-t-throws › throws
202-
not ok 18 - traces-in-t-throws › throws
222+
not ok 19 - traces-in-t-throws › throws
203223
---
204224
name: AssertionError
205225
assertion: throws
@@ -221,7 +241,7 @@ not ok 18 - traces-in-t-throws › throws
221241
...
222242
---tty-stream-chunk-separator
223243
# traces-in-t-throws › notThrows
224-
not ok 19 - traces-in-t-throws › notThrows
244+
not ok 20 - traces-in-t-throws › notThrows
225245
---
226246
name: AssertionError
227247
assertion: notThrows
@@ -242,7 +262,7 @@ not ok 19 - traces-in-t-throws › notThrows
242262
...
243263
---tty-stream-chunk-separator
244264
# traces-in-t-throws › notThrowsAsync
245-
not ok 20 - traces-in-t-throws › notThrowsAsync
265+
not ok 21 - traces-in-t-throws › notThrowsAsync
246266
---
247267
name: AssertionError
248268
assertion: notThrowsAsync
@@ -259,7 +279,7 @@ not ok 20 - traces-in-t-throws › notThrowsAsync
259279
...
260280
---tty-stream-chunk-separator
261281
# traces-in-t-throws › throwsAsync
262-
not ok 21 - traces-in-t-throws › throwsAsync
282+
not ok 22 - traces-in-t-throws › throwsAsync
263283
---
264284
name: AssertionError
265285
assertion: throwsAsync
@@ -276,7 +296,7 @@ not ok 21 - traces-in-t-throws › throwsAsync
276296
...
277297
---tty-stream-chunk-separator
278298
# traces-in-t-throws › throwsAsync different error
279-
not ok 22 - traces-in-t-throws › throwsAsync different error
299+
not ok 23 - traces-in-t-throws › throwsAsync different error
280300
---
281301
name: AssertionError
282302
assertion: throwsAsync
@@ -296,27 +316,27 @@ not ok 22 - traces-in-t-throws › throwsAsync different erro
296316
...
297317
---tty-stream-chunk-separator
298318
# uncaught-exception › passes
299-
ok 23 - uncaught-exception › passes
319+
ok 24 - uncaught-exception › passes
300320
---tty-stream-chunk-separator
301321
# Error: Can’t catch me
302-
not ok 24 - Error: Can’t catch me
322+
not ok 25 - Error: Can’t catch me
303323
---
304324
name: Error
305325
message: Can’t catch me
306326
at: 'Timeout.setTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9)'
307327
...
308328
---tty-stream-chunk-separator
309329
# uncaught-exception.js exited with a non-zero exit code: 1
310-
not ok 25 - uncaught-exception.js exited with a non-zero exit code: 1
330+
not ok 26 - uncaught-exception.js exited with a non-zero exit code: 1
311331
---tty-stream-chunk-separator
312332
# unhandled-rejection › passes
313-
ok 26 - unhandled-rejection › passes
333+
ok 27 - unhandled-rejection › passes
314334
---tty-stream-chunk-separator
315335
# unhandled-rejection › unhandled non-error rejection
316-
ok 27 - unhandled-rejection › unhandled non-error rejection
336+
ok 28 - unhandled-rejection › unhandled non-error rejection
317337
---tty-stream-chunk-separator
318338
# Error: Can’t catch me
319-
not ok 28 - Error: Can’t catch me
339+
not ok 29 - Error: Can’t catch me
320340
---
321341
name: Error
322342
message: Can’t catch me
@@ -326,17 +346,17 @@ not ok 28 - Error: Can’t catch me
326346
...
327347
---tty-stream-chunk-separator
328348
# unhandled-rejection
329-
not ok 29 - unhandled-rejection
349+
not ok 30 - unhandled-rejection
330350
---
331351
message: Non-error object
332352
formatted: 'null'
333353
...
334354
---tty-stream-chunk-separator
335355

336-
1..23
337-
# tests 22
356+
1..24
357+
# tests 23
338358
# pass 6
339359
# skip 1
340-
# fail 22
360+
# fail 23
341361

342362
---tty-stream-chunk-separator

‎test-tap/reporters/tap.regular.v12.log

+47-29
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ not ok 3 - nested-objects › format with max depth 4
3535
at: 'test-tap/fixture/report/regular/nested-objects.js:28:4'
3636
...
3737
---tty-stream-chunk-separator
38+
# nested-objects › format like with max depth 4
39+
not ok 4 - nested-objects › format like with max depth 4
40+
---
41+
name: AssertionError
42+
assertion: like
43+
values:
44+
'Difference:': |2-
45+
{
46+
a: {
47+
b: {
48+
- foo: 'bar',
49+
+ foo: 'qux',
50+
},
51+
},
52+
}
53+
at: 'test-tap/fixture/report/regular/nested-objects.js:54:4'
54+
...
55+
---tty-stream-chunk-separator
3856
# output-in-hook › before hook
3957
---tty-stream-chunk-separator
4058
# output-in-hook › before hook
@@ -50,10 +68,10 @@ not ok 3 - nested-objects › format with max depth 4
5068
# beforeEach
5169
---tty-stream-chunk-separator
5270
# output-in-hook › passing test
53-
ok 4 - output-in-hook › passing test
71+
ok 5 - output-in-hook › passing test
5472
---tty-stream-chunk-separator
5573
# output-in-hook › failing test
56-
not ok 5 - output-in-hook › failing test
74+
not ok 6 - output-in-hook › failing test
5775
---
5876
name: AssertionError
5977
message: Test failed via `t.fail()`
@@ -78,16 +96,16 @@ not ok 5 - output-in-hook › failing test
7896
# afterAlways
7997
---tty-stream-chunk-separator
8098
# test › skip
81-
ok 6 - test › skip # SKIP
99+
ok 7 - test › skip # SKIP
82100
---tty-stream-chunk-separator
83101
# test › todo
84-
not ok 7 - test › todo # TODO
102+
not ok 8 - test › todo # TODO
85103
---tty-stream-chunk-separator
86104
# test › passes
87-
ok 8 - test › passes
105+
ok 9 - test › passes
88106
---tty-stream-chunk-separator
89107
# test › fails
90-
not ok 9 - test › fails
108+
not ok 10 - test › fails
91109
---
92110
name: AssertionError
93111
message: Test failed via `t.fail()`
@@ -96,10 +114,10 @@ not ok 9 - test › fails
96114
...
97115
---tty-stream-chunk-separator
98116
# test › known failure
99-
ok 10 - test › known failure
117+
ok 11 - test › known failure
100118
---tty-stream-chunk-separator
101119
# test › no longer failing
102-
not ok 11 - test › no longer failing
120+
not ok 12 - test › no longer failing
103121
---
104122
name: Error
105123
message: >-
@@ -109,7 +127,7 @@ not ok 11 - test › no longer failing
109127
...
110128
---tty-stream-chunk-separator
111129
# test › logs
112-
not ok 12 - test › logs
130+
not ok 13 - test › logs
113131
* hello
114132
* world
115133
---
@@ -120,7 +138,7 @@ not ok 12 - test › logs
120138
...
121139
---tty-stream-chunk-separator
122140
# test › formatted
123-
not ok 13 - test › formatted
141+
not ok 14 - test › formatted
124142
---
125143
name: AssertionError
126144
assertion: deepEqual
@@ -132,7 +150,7 @@ not ok 13 - test › formatted
132150
...
133151
---tty-stream-chunk-separator
134152
# test › power-assert
135-
not ok 14 - test › power-assert
153+
not ok 15 - test › power-assert
136154
---
137155
name: AssertionError
138156
assertion: assert
@@ -143,7 +161,7 @@ not ok 14 - test › power-assert
143161
...
144162
---tty-stream-chunk-separator
145163
# test › bad throws
146-
not ok 15 - test › bad throws
164+
not ok 16 - test › bad throws
147165
---
148166
name: AssertionError
149167
message: Improper usage of `t.throws()` detected
@@ -159,7 +177,7 @@ not ok 15 - test › bad throws
159177
...
160178
---tty-stream-chunk-separator
161179
# test › bad notThrows
162-
not ok 16 - test › bad notThrows
180+
not ok 17 - test › bad notThrows
163181
---
164182
name: AssertionError
165183
message: Improper usage of `t.notThrows()` detected
@@ -175,7 +193,7 @@ not ok 16 - test › bad notThrows
175193
...
176194
---tty-stream-chunk-separator
177195
# test › implementation throws non-error
178-
not ok 17 - test › implementation throws non-error
196+
not ok 18 - test › implementation throws non-error
179197
---
180198
name: AssertionError
181199
message: Error thrown in test
@@ -185,7 +203,7 @@ not ok 17 - test › implementation throws non-error
185203
...
186204
---tty-stream-chunk-separator
187205
# traces-in-t-throws › throws
188-
not ok 18 - traces-in-t-throws › throws
206+
not ok 19 - traces-in-t-throws › throws
189207
---
190208
name: AssertionError
191209
assertion: throws
@@ -202,7 +220,7 @@ not ok 18 - traces-in-t-throws › throws
202220
...
203221
---tty-stream-chunk-separator
204222
# traces-in-t-throws › notThrows
205-
not ok 19 - traces-in-t-throws › notThrows
223+
not ok 20 - traces-in-t-throws › notThrows
206224
---
207225
name: AssertionError
208226
assertion: notThrows
@@ -218,7 +236,7 @@ not ok 19 - traces-in-t-throws › notThrows
218236
...
219237
---tty-stream-chunk-separator
220238
# traces-in-t-throws › notThrowsAsync
221-
not ok 20 - traces-in-t-throws › notThrowsAsync
239+
not ok 21 - traces-in-t-throws › notThrowsAsync
222240
---
223241
name: AssertionError
224242
assertion: notThrowsAsync
@@ -234,7 +252,7 @@ not ok 20 - traces-in-t-throws › notThrowsAsync
234252
...
235253
---tty-stream-chunk-separator
236254
# traces-in-t-throws › throwsAsync
237-
not ok 21 - traces-in-t-throws › throwsAsync
255+
not ok 22 - traces-in-t-throws › throwsAsync
238256
---
239257
name: AssertionError
240258
assertion: throwsAsync
@@ -253,7 +271,7 @@ not ok 21 - traces-in-t-throws › throwsAsync
253271
...
254272
---tty-stream-chunk-separator
255273
# traces-in-t-throws › throwsAsync different error
256-
not ok 22 - traces-in-t-throws › throwsAsync different error
274+
not ok 23 - traces-in-t-throws › throwsAsync different error
257275
---
258276
name: AssertionError
259277
assertion: throwsAsync
@@ -271,10 +289,10 @@ not ok 22 - traces-in-t-throws › throwsAsync different erro
271289
...
272290
---tty-stream-chunk-separator
273291
# uncaught-exception › passes
274-
ok 23 - uncaught-exception › passes
292+
ok 24 - uncaught-exception › passes
275293
---tty-stream-chunk-separator
276294
# Error: Can’t catch me
277-
not ok 24 - Error: Can’t catch me
295+
not ok 25 - Error: Can’t catch me
278296
---
279297
name: Error
280298
message: Can’t catch me
@@ -285,34 +303,34 @@ not ok 24 - Error: Can’t catch me
285303
...
286304
---tty-stream-chunk-separator
287305
# uncaught-exception.js exited with a non-zero exit code: 1
288-
not ok 25 - uncaught-exception.js exited with a non-zero exit code: 1
306+
not ok 26 - uncaught-exception.js exited with a non-zero exit code: 1
289307
---tty-stream-chunk-separator
290308
# unhandled-rejection › passes
291-
ok 26 - unhandled-rejection › passes
309+
ok 27 - unhandled-rejection › passes
292310
---tty-stream-chunk-separator
293311
# unhandled-rejection › unhandled non-error rejection
294-
ok 27 - unhandled-rejection › unhandled non-error rejection
312+
ok 28 - unhandled-rejection › unhandled non-error rejection
295313
---tty-stream-chunk-separator
296314
# Error: Can’t catch me
297-
not ok 28 - Error: Can’t catch me
315+
not ok 29 - Error: Can’t catch me
298316
---
299317
name: Error
300318
message: Can’t catch me
301319
at: 'passes (test-tap/fixture/report/regular/unhandled-rejection.js:4:17)'
302320
...
303321
---tty-stream-chunk-separator
304322
# unhandled-rejection
305-
not ok 29 - unhandled-rejection
323+
not ok 30 - unhandled-rejection
306324
---
307325
message: Non-error object
308326
formatted: 'null'
309327
...
310328
---tty-stream-chunk-separator
311329

312-
1..23
313-
# tests 22
330+
1..24
331+
# tests 23
314332
# pass 6
315333
# skip 1
316-
# fail 22
334+
# fail 23
317335

318336
---tty-stream-chunk-separator

‎test-tap/reporters/tap.regular.v13.log

+47-29
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ not ok 3 - nested-objects › format with max depth 4
3535
at: 'test-tap/fixture/report/regular/nested-objects.js:28:4'
3636
...
3737
---tty-stream-chunk-separator
38+
# nested-objects › format like with max depth 4
39+
not ok 4 - nested-objects › format like with max depth 4
40+
---
41+
name: AssertionError
42+
assertion: like
43+
values:
44+
'Difference:': |2-
45+
{
46+
a: {
47+
b: {
48+
- foo: 'bar',
49+
+ foo: 'qux',
50+
},
51+
},
52+
}
53+
at: 'test-tap/fixture/report/regular/nested-objects.js:54:4'
54+
...
55+
---tty-stream-chunk-separator
3856
# output-in-hook › before hook
3957
---tty-stream-chunk-separator
4058
# output-in-hook › before hook
@@ -50,10 +68,10 @@ not ok 3 - nested-objects › format with max depth 4
5068
# beforeEach
5169
---tty-stream-chunk-separator
5270
# output-in-hook › passing test
53-
ok 4 - output-in-hook › passing test
71+
ok 5 - output-in-hook › passing test
5472
---tty-stream-chunk-separator
5573
# output-in-hook › failing test
56-
not ok 5 - output-in-hook › failing test
74+
not ok 6 - output-in-hook › failing test
5775
---
5876
name: AssertionError
5977
message: Test failed via `t.fail()`
@@ -78,16 +96,16 @@ not ok 5 - output-in-hook › failing test
7896
# afterAlways
7997
---tty-stream-chunk-separator
8098
# test › skip
81-
ok 6 - test › skip # SKIP
99+
ok 7 - test › skip # SKIP
82100
---tty-stream-chunk-separator
83101
# test › todo
84-
not ok 7 - test › todo # TODO
102+
not ok 8 - test › todo # TODO
85103
---tty-stream-chunk-separator
86104
# test › passes
87-
ok 8 - test › passes
105+
ok 9 - test › passes
88106
---tty-stream-chunk-separator
89107
# test › fails
90-
not ok 9 - test › fails
108+
not ok 10 - test › fails
91109
---
92110
name: AssertionError
93111
message: Test failed via `t.fail()`
@@ -96,10 +114,10 @@ not ok 9 - test › fails
96114
...
97115
---tty-stream-chunk-separator
98116
# test › known failure
99-
ok 10 - test › known failure
117+
ok 11 - test › known failure
100118
---tty-stream-chunk-separator
101119
# test › no longer failing
102-
not ok 11 - test › no longer failing
120+
not ok 12 - test › no longer failing
103121
---
104122
name: Error
105123
message: >-
@@ -109,7 +127,7 @@ not ok 11 - test › no longer failing
109127
...
110128
---tty-stream-chunk-separator
111129
# test › logs
112-
not ok 12 - test › logs
130+
not ok 13 - test › logs
113131
* hello
114132
* world
115133
---
@@ -120,7 +138,7 @@ not ok 12 - test › logs
120138
...
121139
---tty-stream-chunk-separator
122140
# test › formatted
123-
not ok 13 - test › formatted
141+
not ok 14 - test › formatted
124142
---
125143
name: AssertionError
126144
assertion: deepEqual
@@ -132,7 +150,7 @@ not ok 13 - test › formatted
132150
...
133151
---tty-stream-chunk-separator
134152
# test › power-assert
135-
not ok 14 - test › power-assert
153+
not ok 15 - test › power-assert
136154
---
137155
name: AssertionError
138156
assertion: assert
@@ -143,7 +161,7 @@ not ok 14 - test › power-assert
143161
...
144162
---tty-stream-chunk-separator
145163
# test › bad throws
146-
not ok 15 - test › bad throws
164+
not ok 16 - test › bad throws
147165
---
148166
name: AssertionError
149167
message: Improper usage of `t.throws()` detected
@@ -159,7 +177,7 @@ not ok 15 - test › bad throws
159177
...
160178
---tty-stream-chunk-separator
161179
# test › bad notThrows
162-
not ok 16 - test › bad notThrows
180+
not ok 17 - test › bad notThrows
163181
---
164182
name: AssertionError
165183
message: Improper usage of `t.notThrows()` detected
@@ -175,7 +193,7 @@ not ok 16 - test › bad notThrows
175193
...
176194
---tty-stream-chunk-separator
177195
# test › implementation throws non-error
178-
not ok 17 - test › implementation throws non-error
196+
not ok 18 - test › implementation throws non-error
179197
---
180198
name: AssertionError
181199
message: Error thrown in test
@@ -185,7 +203,7 @@ not ok 17 - test › implementation throws non-error
185203
...
186204
---tty-stream-chunk-separator
187205
# traces-in-t-throws › throws
188-
not ok 18 - traces-in-t-throws › throws
206+
not ok 19 - traces-in-t-throws › throws
189207
---
190208
name: AssertionError
191209
assertion: throws
@@ -202,7 +220,7 @@ not ok 18 - traces-in-t-throws › throws
202220
...
203221
---tty-stream-chunk-separator
204222
# traces-in-t-throws › notThrows
205-
not ok 19 - traces-in-t-throws › notThrows
223+
not ok 20 - traces-in-t-throws › notThrows
206224
---
207225
name: AssertionError
208226
assertion: notThrows
@@ -218,7 +236,7 @@ not ok 19 - traces-in-t-throws › notThrows
218236
...
219237
---tty-stream-chunk-separator
220238
# traces-in-t-throws › notThrowsAsync
221-
not ok 20 - traces-in-t-throws › notThrowsAsync
239+
not ok 21 - traces-in-t-throws › notThrowsAsync
222240
---
223241
name: AssertionError
224242
assertion: notThrowsAsync
@@ -234,7 +252,7 @@ not ok 20 - traces-in-t-throws › notThrowsAsync
234252
...
235253
---tty-stream-chunk-separator
236254
# traces-in-t-throws › throwsAsync
237-
not ok 21 - traces-in-t-throws › throwsAsync
255+
not ok 22 - traces-in-t-throws › throwsAsync
238256
---
239257
name: AssertionError
240258
assertion: throwsAsync
@@ -253,7 +271,7 @@ not ok 21 - traces-in-t-throws › throwsAsync
253271
...
254272
---tty-stream-chunk-separator
255273
# traces-in-t-throws › throwsAsync different error
256-
not ok 22 - traces-in-t-throws › throwsAsync different error
274+
not ok 23 - traces-in-t-throws › throwsAsync different error
257275
---
258276
name: AssertionError
259277
assertion: throwsAsync
@@ -271,10 +289,10 @@ not ok 22 - traces-in-t-throws › throwsAsync different erro
271289
...
272290
---tty-stream-chunk-separator
273291
# uncaught-exception › passes
274-
ok 23 - uncaught-exception › passes
292+
ok 24 - uncaught-exception › passes
275293
---tty-stream-chunk-separator
276294
# Error: Can’t catch me
277-
not ok 24 - Error: Can’t catch me
295+
not ok 25 - Error: Can’t catch me
278296
---
279297
name: Error
280298
message: Can’t catch me
@@ -285,34 +303,34 @@ not ok 24 - Error: Can’t catch me
285303
...
286304
---tty-stream-chunk-separator
287305
# uncaught-exception.js exited with a non-zero exit code: 1
288-
not ok 25 - uncaught-exception.js exited with a non-zero exit code: 1
306+
not ok 26 - uncaught-exception.js exited with a non-zero exit code: 1
289307
---tty-stream-chunk-separator
290308
# unhandled-rejection › passes
291-
ok 26 - unhandled-rejection › passes
309+
ok 27 - unhandled-rejection › passes
292310
---tty-stream-chunk-separator
293311
# unhandled-rejection › unhandled non-error rejection
294-
ok 27 - unhandled-rejection › unhandled non-error rejection
312+
ok 28 - unhandled-rejection › unhandled non-error rejection
295313
---tty-stream-chunk-separator
296314
# Error: Can’t catch me
297-
not ok 28 - Error: Can’t catch me
315+
not ok 29 - Error: Can’t catch me
298316
---
299317
name: Error
300318
message: Can’t catch me
301319
at: 'passes (test-tap/fixture/report/regular/unhandled-rejection.js:4:17)'
302320
...
303321
---tty-stream-chunk-separator
304322
# unhandled-rejection
305-
not ok 29 - unhandled-rejection
323+
not ok 30 - unhandled-rejection
306324
---
307325
message: Non-error object
308326
formatted: 'null'
309327
...
310328
---tty-stream-chunk-separator
311329

312-
1..23
313-
# tests 22
330+
1..24
331+
# tests 23
314332
# pass 6
315333
# skip 1
316-
# fail 22
334+
# fail 23
317335

318336
---tty-stream-chunk-separator

‎test-tap/reporters/tap.regular.v14.log

+47-29
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ not ok 3 - nested-objects › format with max depth 4
3535
at: 'test-tap/fixture/report/regular/nested-objects.js:28:4'
3636
...
3737
---tty-stream-chunk-separator
38+
# nested-objects › format like with max depth 4
39+
not ok 4 - nested-objects › format like with max depth 4
40+
---
41+
name: AssertionError
42+
assertion: like
43+
values:
44+
'Difference:': |2-
45+
{
46+
a: {
47+
b: {
48+
- foo: 'bar',
49+
+ foo: 'qux',
50+
},
51+
},
52+
}
53+
at: 'test-tap/fixture/report/regular/nested-objects.js:54:4'
54+
...
55+
---tty-stream-chunk-separator
3856
# output-in-hook › before hook
3957
---tty-stream-chunk-separator
4058
# output-in-hook › before hook
@@ -50,10 +68,10 @@ not ok 3 - nested-objects › format with max depth 4
5068
# beforeEach
5169
---tty-stream-chunk-separator
5270
# output-in-hook › passing test
53-
ok 4 - output-in-hook › passing test
71+
ok 5 - output-in-hook › passing test
5472
---tty-stream-chunk-separator
5573
# output-in-hook › failing test
56-
not ok 5 - output-in-hook › failing test
74+
not ok 6 - output-in-hook › failing test
5775
---
5876
name: AssertionError
5977
message: Test failed via `t.fail()`
@@ -78,16 +96,16 @@ not ok 5 - output-in-hook › failing test
7896
# afterAlways
7997
---tty-stream-chunk-separator
8098
# test › skip
81-
ok 6 - test › skip # SKIP
99+
ok 7 - test › skip # SKIP
82100
---tty-stream-chunk-separator
83101
# test › todo
84-
not ok 7 - test › todo # TODO
102+
not ok 8 - test › todo # TODO
85103
---tty-stream-chunk-separator
86104
# test › passes
87-
ok 8 - test › passes
105+
ok 9 - test › passes
88106
---tty-stream-chunk-separator
89107
# test › fails
90-
not ok 9 - test › fails
108+
not ok 10 - test › fails
91109
---
92110
name: AssertionError
93111
message: Test failed via `t.fail()`
@@ -96,10 +114,10 @@ not ok 9 - test › fails
96114
...
97115
---tty-stream-chunk-separator
98116
# test › known failure
99-
ok 10 - test › known failure
117+
ok 11 - test › known failure
100118
---tty-stream-chunk-separator
101119
# test › no longer failing
102-
not ok 11 - test › no longer failing
120+
not ok 12 - test › no longer failing
103121
---
104122
name: Error
105123
message: >-
@@ -109,7 +127,7 @@ not ok 11 - test › no longer failing
109127
...
110128
---tty-stream-chunk-separator
111129
# test › logs
112-
not ok 12 - test › logs
130+
not ok 13 - test › logs
113131
* hello
114132
* world
115133
---
@@ -120,7 +138,7 @@ not ok 12 - test › logs
120138
...
121139
---tty-stream-chunk-separator
122140
# test › formatted
123-
not ok 13 - test › formatted
141+
not ok 14 - test › formatted
124142
---
125143
name: AssertionError
126144
assertion: deepEqual
@@ -132,7 +150,7 @@ not ok 13 - test › formatted
132150
...
133151
---tty-stream-chunk-separator
134152
# test › power-assert
135-
not ok 14 - test › power-assert
153+
not ok 15 - test › power-assert
136154
---
137155
name: AssertionError
138156
assertion: assert
@@ -143,7 +161,7 @@ not ok 14 - test › power-assert
143161
...
144162
---tty-stream-chunk-separator
145163
# test › bad throws
146-
not ok 15 - test › bad throws
164+
not ok 16 - test › bad throws
147165
---
148166
name: AssertionError
149167
message: Improper usage of `t.throws()` detected
@@ -159,7 +177,7 @@ not ok 15 - test › bad throws
159177
...
160178
---tty-stream-chunk-separator
161179
# test › bad notThrows
162-
not ok 16 - test › bad notThrows
180+
not ok 17 - test › bad notThrows
163181
---
164182
name: AssertionError
165183
message: Improper usage of `t.notThrows()` detected
@@ -175,7 +193,7 @@ not ok 16 - test › bad notThrows
175193
...
176194
---tty-stream-chunk-separator
177195
# test › implementation throws non-error
178-
not ok 17 - test › implementation throws non-error
196+
not ok 18 - test › implementation throws non-error
179197
---
180198
name: AssertionError
181199
message: Error thrown in test
@@ -185,7 +203,7 @@ not ok 17 - test › implementation throws non-error
185203
...
186204
---tty-stream-chunk-separator
187205
# traces-in-t-throws › throws
188-
not ok 18 - traces-in-t-throws › throws
206+
not ok 19 - traces-in-t-throws › throws
189207
---
190208
name: AssertionError
191209
assertion: throws
@@ -202,7 +220,7 @@ not ok 18 - traces-in-t-throws › throws
202220
...
203221
---tty-stream-chunk-separator
204222
# traces-in-t-throws › notThrows
205-
not ok 19 - traces-in-t-throws › notThrows
223+
not ok 20 - traces-in-t-throws › notThrows
206224
---
207225
name: AssertionError
208226
assertion: notThrows
@@ -218,7 +236,7 @@ not ok 19 - traces-in-t-throws › notThrows
218236
...
219237
---tty-stream-chunk-separator
220238
# traces-in-t-throws › notThrowsAsync
221-
not ok 20 - traces-in-t-throws › notThrowsAsync
239+
not ok 21 - traces-in-t-throws › notThrowsAsync
222240
---
223241
name: AssertionError
224242
assertion: notThrowsAsync
@@ -234,7 +252,7 @@ not ok 20 - traces-in-t-throws › notThrowsAsync
234252
...
235253
---tty-stream-chunk-separator
236254
# traces-in-t-throws › throwsAsync
237-
not ok 21 - traces-in-t-throws › throwsAsync
255+
not ok 22 - traces-in-t-throws › throwsAsync
238256
---
239257
name: AssertionError
240258
assertion: throwsAsync
@@ -253,7 +271,7 @@ not ok 21 - traces-in-t-throws › throwsAsync
253271
...
254272
---tty-stream-chunk-separator
255273
# traces-in-t-throws › throwsAsync different error
256-
not ok 22 - traces-in-t-throws › throwsAsync different error
274+
not ok 23 - traces-in-t-throws › throwsAsync different error
257275
---
258276
name: AssertionError
259277
assertion: throwsAsync
@@ -271,10 +289,10 @@ not ok 22 - traces-in-t-throws › throwsAsync different erro
271289
...
272290
---tty-stream-chunk-separator
273291
# uncaught-exception › passes
274-
ok 23 - uncaught-exception › passes
292+
ok 24 - uncaught-exception › passes
275293
---tty-stream-chunk-separator
276294
# Error: Can’t catch me
277-
not ok 24 - Error: Can’t catch me
295+
not ok 25 - Error: Can’t catch me
278296
---
279297
name: Error
280298
message: Can’t catch me
@@ -285,34 +303,34 @@ not ok 24 - Error: Can’t catch me
285303
...
286304
---tty-stream-chunk-separator
287305
# uncaught-exception.js exited with a non-zero exit code: 1
288-
not ok 25 - uncaught-exception.js exited with a non-zero exit code: 1
306+
not ok 26 - uncaught-exception.js exited with a non-zero exit code: 1
289307
---tty-stream-chunk-separator
290308
# unhandled-rejection › passes
291-
ok 26 - unhandled-rejection › passes
309+
ok 27 - unhandled-rejection › passes
292310
---tty-stream-chunk-separator
293311
# unhandled-rejection › unhandled non-error rejection
294-
ok 27 - unhandled-rejection › unhandled non-error rejection
312+
ok 28 - unhandled-rejection › unhandled non-error rejection
295313
---tty-stream-chunk-separator
296314
# Error: Can’t catch me
297-
not ok 28 - Error: Can’t catch me
315+
not ok 29 - Error: Can’t catch me
298316
---
299317
name: Error
300318
message: Can’t catch me
301319
at: 'passes (test-tap/fixture/report/regular/unhandled-rejection.js:4:17)'
302320
...
303321
---tty-stream-chunk-separator
304322
# unhandled-rejection
305-
not ok 29 - unhandled-rejection
323+
not ok 30 - unhandled-rejection
306324
---
307325
message: Non-error object
308326
formatted: 'null'
309327
...
310328
---tty-stream-chunk-separator
311329

312-
1..23
313-
# tests 22
330+
1..24
331+
# tests 23
314332
# pass 6
315333
# skip 1
316-
# fail 22
334+
# fail 23
317335

318336
---tty-stream-chunk-separator

‎test-tap/reporters/verbose.regular.v10.log

+27-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
✖ bad-test-chain.js exited with a non-zero exit code: 1
1717
---tty-stream-chunk-separator
1818
✖ nested-objects › format with max depth 4
19+
---tty-stream-chunk-separator
20+
✖ nested-objects › format like with max depth 4
1921
---tty-stream-chunk-separator
2022
output-in-hook › before hook
2123
ℹ before
@@ -152,6 +154,30 @@
152154

153155

154156

157+
nested-objects › format like with max depth 4
158+
159+
nested-objects.js:54
160+
161+
53: };
162+
 54: t.like(actual, pattern);
163+
55: });
164+
165+
Difference:
166+
167+
{
168+
a: {
169+
b: {
170+
- foo: 'bar',
171+
+ foo: 'qux',
172+
},
173+
},
174+
}
175+
176+
› t (test-tap/fixture/report/regular/nested-objects.js:54:4)
177+
› process._tickCallback (internal/process/next_tick.js:68:7)
178+
179+
180+
155181
output-in-hook › failing test
156182

157183
output-in-hook.js:34
@@ -428,7 +454,7 @@
428454

429455
─
430456

431-
15 tests failed
457+
16 tests failed
432458
1 known failure
433459
1 test skipped
434460
1 test todo

‎test-tap/reporters/verbose.regular.v12.log

+26-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
✖ bad-test-chain.js exited with a non-zero exit code: 1
1717
---tty-stream-chunk-separator
1818
✖ nested-objects › format with max depth 4
19+
---tty-stream-chunk-separator
20+
✖ nested-objects › format like with max depth 4
1921
---tty-stream-chunk-separator
2022
output-in-hook › before hook
2123
ℹ before
@@ -152,6 +154,29 @@
152154

153155

154156

157+
nested-objects › format like with max depth 4
158+
159+
nested-objects.js:54
160+
161+
53: };
162+
 54: t.like(actual, pattern);
163+
55: });
164+
165+
Difference:
166+
167+
{
168+
a: {
169+
b: {
170+
- foo: 'bar',
171+
+ foo: 'qux',
172+
},
173+
},
174+
}
175+
176+
› test-tap/fixture/report/regular/nested-objects.js:54:4
177+
178+
179+
155180
output-in-hook › failing test
156181

157182
output-in-hook.js:34
@@ -412,7 +437,7 @@
412437

413438
─
414439

415-
15 tests failed
440+
16 tests failed
416441
1 known failure
417442
1 test skipped
418443
1 test todo

‎test-tap/reporters/verbose.regular.v13.log

+26-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
✖ bad-test-chain.js exited with a non-zero exit code: 1
1717
---tty-stream-chunk-separator
1818
✖ nested-objects › format with max depth 4
19+
---tty-stream-chunk-separator
20+
✖ nested-objects › format like with max depth 4
1921
---tty-stream-chunk-separator
2022
output-in-hook › before hook
2123
ℹ before
@@ -152,6 +154,29 @@
152154

153155

154156

157+
nested-objects › format like with max depth 4
158+
159+
nested-objects.js:54
160+
161+
53: };
162+
 54: t.like(actual, pattern);
163+
55: });
164+
165+
Difference:
166+
167+
{
168+
a: {
169+
b: {
170+
- foo: 'bar',
171+
+ foo: 'qux',
172+
},
173+
},
174+
}
175+
176+
› test-tap/fixture/report/regular/nested-objects.js:54:4
177+
178+
179+
155180
output-in-hook › failing test
156181

157182
output-in-hook.js:34
@@ -412,7 +437,7 @@
412437

413438
─
414439

415-
15 tests failed
440+
16 tests failed
416441
1 known failure
417442
1 test skipped
418443
1 test todo

‎test-tap/reporters/verbose.regular.v14.log

+26-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
✖ bad-test-chain.js exited with a non-zero exit code: 1
1717
---tty-stream-chunk-separator
1818
✖ nested-objects › format with max depth 4
19+
---tty-stream-chunk-separator
20+
✖ nested-objects › format like with max depth 4
1921
---tty-stream-chunk-separator
2022
output-in-hook › before hook
2123
ℹ before
@@ -152,6 +154,29 @@
152154

153155

154156

157+
nested-objects › format like with max depth 4
158+
159+
nested-objects.js:54
160+
161+
53: };
162+
 54: t.like(actual, pattern);
163+
55: });
164+
165+
Difference:
166+
167+
{
168+
a: {
169+
b: {
170+
- foo: 'bar',
171+
+ foo: 'qux',
172+
},
173+
},
174+
}
175+
176+
› test-tap/fixture/report/regular/nested-objects.js:54:4
177+
178+
179+
155180
output-in-hook › failing test
156181

157182
output-in-hook.js:34
@@ -412,7 +437,7 @@
412437

413438
─
414439

415-
15 tests failed
440+
16 tests failed
416441
1 known failure
417442
1 test skipped
418443
1 test todo

‎test-tap/test.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,14 @@ test('fails with thrown non-error object', t => {
360360

361361
test('skipped assertions count towards the plan', t => {
362362
const instance = ava(a => {
363-
a.plan(15);
363+
a.plan(16);
364364
a.pass.skip();
365365
a.fail.skip();
366366
a.is.skip(1, 1);
367367
a.not.skip(1, 2);
368368
a.deepEqual.skip({foo: 'bar'}, {foo: 'bar'});
369369
a.notDeepEqual.skip({foo: 'bar'}, {baz: 'thud'});
370+
a.like.skip({foo: 'bar'}, {foo: 'bar'});
370371
a.throws.skip(() => {
371372
throw new Error(); // eslint-disable-line unicorn/error-message
372373
});
@@ -381,20 +382,21 @@ test('skipped assertions count towards the plan', t => {
381382
});
382383
return instance.run().then(result => {
383384
t.is(result.passed, true);
384-
t.is(instance.planCount, 15);
385-
t.is(instance.assertCount, 15);
385+
t.is(instance.planCount, 16);
386+
t.is(instance.assertCount, 16);
386387
});
387388
});
388389

389390
test('assertion.skip() is bound', t => {
390391
const instance = ava(a => {
391-
a.plan(15);
392+
a.plan(16);
392393
(a.pass.skip)();
393394
(a.fail.skip)();
394395
(a.is.skip)(1, 1);
395396
(a.not.skip)(1, 2);
396397
(a.deepEqual.skip)({foo: 'bar'}, {foo: 'bar'});
397398
(a.notDeepEqual.skip)({foo: 'bar'}, {baz: 'thud'});
399+
(a.like.skip)({foo: 'bar'}, {foo: 'bar'});
398400
(a.throws.skip)(() => {
399401
throw new Error(); // eslint-disable-line unicorn/error-message
400402
});
@@ -409,8 +411,8 @@ test('assertion.skip() is bound', t => {
409411
});
410412
return instance.run().then(result => {
411413
t.is(result.passed, true);
412-
t.is(instance.planCount, 15);
413-
t.is(instance.assertCount, 15);
414+
t.is(instance.planCount, 16);
415+
t.is(instance.assertCount, 16);
414416
});
415417
});
416418

@@ -646,13 +648,14 @@ test('log from tests', t => {
646648

647649
test('assertions are bound', t => {
648650
// This does not test .fail() and .snapshot(). It'll suffice.
649-
return ava(a => {
650-
(a.plan)(13);
651+
return withExperiments({likeAssertion: true})(a => {
652+
(a.plan)(14);
651653
(a.pass)();
652654
(a.is)(1, 1);
653655
(a.not)(1, 2);
654656
(a.deepEqual)({foo: 'bar'}, {foo: 'bar'});
655657
(a.notDeepEqual)({foo: 'bar'}, {baz: 'thud'});
658+
(a.like)({foo: 'bar'}, {foo: 'bar'});
656659
(a.throws)(() => {
657660
throw new Error(); // eslint-disable-line unicorn/error-message
658661
});

‎test/assertions/fixtures/happy-path.js

+16
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ test(passes, 'is', 1, 1);
1111
test(passes, 'not', 1, 2);
1212
test(passes, 'deepEqual', {foo: 'bar'}, {foo: 'bar'});
1313
test(passes, 'notDeepEqual', {foo: 'bar'}, {foo: 'baz'});
14+
test(passes, 'like', {
15+
foo: 'bar',
16+
deep: {
17+
buz: 'qux',
18+
extra: 'irrelevant'
19+
},
20+
extra: 'irrelevant',
21+
deepExtra: {
22+
extra: 'irrelevant'
23+
}
24+
}, {
25+
foo: 'bar',
26+
deep: {
27+
buz: 'qux'
28+
}
29+
});
1430
test(passes, 'throws', () => {
1531
throw new Error('error');
1632
});

‎test/assertions/fixtures/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"ava": {
33
"files": [
44
"*.js"
5-
]
5+
],
6+
"nonSemVerExperiments": {
7+
"likeAssertion": true
8+
}
69
},
710
"dependencies": {
811
"ava": "file:../../.."

‎test/assertions/snapshots/test.js.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Generated by [AVA](https://avajs.dev).
1414
't.false(false) passes',
1515
't.falsy("") passes',
1616
't.is(1, 1) passes',
17+
't.like({"foo":"bar","deep":{"buz":"qux","extra":"irrelevant"},"extra":"irrelevant","deepExtra":{"extra":"irrelevant"}}, {"foo":"bar","deep":{"buz":"qux"}}) passes',
1718
't.not(1, 2) passes',
1819
't.notDeepEqual({"foo":"bar"}, {"foo":"baz"}) passes',
1920
't.notRegex("bar", {}) passes',
69 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.