Skip to content

Commit dbfff20

Browse files
committed
test: Simplify assertion, for readability
A side-effect of this is that if the test fails, the diffs are very easy to read.
1 parent 2ef5800 commit dbfff20

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

β€Žtests/Task.test.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,9 +1142,10 @@ describe('order of recurring tasks', () => {
11421142
const lines = task.toggleWithRecurrenceInUsersOrder().map((t) => t.toFileLineString());
11431143

11441144
// Assert
1145-
expect(lines.length).toEqual(2);
1146-
expect(lines[0]).toMatchInlineSnapshot('"- [ ] this is a recurring task πŸ” every day"');
1147-
expect(lines[1]).toMatchInlineSnapshot('"- [x] this is a recurring task πŸ” every day βœ… 2023-05-16"');
1145+
expect(lines).toStrictEqual([
1146+
'- [ ] this is a recurring task πŸ” every day',
1147+
'- [x] this is a recurring task πŸ” every day βœ… 2023-05-16',
1148+
]);
11481149
});
11491150

11501151
it('should honour new-task-before-old setting', () => {
@@ -1156,9 +1157,10 @@ describe('order of recurring tasks', () => {
11561157
const lines = task.toggleWithRecurrenceInUsersOrder().map((t) => t.toFileLineString());
11571158

11581159
// Assert
1159-
expect(lines.length).toEqual(2);
1160-
expect(lines[0]).toMatchInlineSnapshot('"- [ ] this is a recurring task πŸ” every day"');
1161-
expect(lines[1]).toMatchInlineSnapshot('"- [x] this is a recurring task πŸ” every day βœ… 2023-05-16"');
1160+
expect(lines).toStrictEqual([
1161+
'- [ ] this is a recurring task πŸ” every day',
1162+
'- [x] this is a recurring task πŸ” every day βœ… 2023-05-16',
1163+
]);
11621164
});
11631165

11641166
it('should honour old-task-before-new setting', () => {
@@ -1170,9 +1172,10 @@ describe('order of recurring tasks', () => {
11701172
const lines = task.toggleWithRecurrenceInUsersOrder().map((t) => t.toFileLineString());
11711173

11721174
// Assert
1173-
expect(lines.length).toEqual(2);
1174-
expect(lines[0]).toMatchInlineSnapshot('"- [x] this is a recurring task πŸ” every day βœ… 2023-05-16"');
1175-
expect(lines[1]).toMatchInlineSnapshot('"- [ ] this is a recurring task πŸ” every day"');
1175+
expect(lines).toStrictEqual([
1176+
'- [x] this is a recurring task πŸ” every day βœ… 2023-05-16',
1177+
'- [ ] this is a recurring task πŸ” every day',
1178+
]);
11761179
});
11771180
});
11781181

0 commit comments

Comments
Β (0)