Skip to content

Commit

Permalink
fix: database test
Browse files Browse the repository at this point in the history
  • Loading branch information
CurryYangxx committed Dec 2, 2024
1 parent 5e90726 commit 8e57033
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/insomnia/src/common/__tests__/database.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ describe('onChange()', () => {
name: 'bar',
});
expect(changesSeen).toEqual([

Check failure on line 39 in packages/insomnia/src/common/__tests__/database.test.ts

View workflow job for this annotation

GitHub Actions / Test

src/common/__tests__/database.test.ts > onChange() > handles change listeners

AssertionError: expected [ …(2) ] to deeply equal [ …(2) ] - Expected + Received Array [ Array [ Array [ "insert", Object { "_id": "req_cc1dd2ca4275747aa88199e8efd42403", "afterResponseScript": undefined, "authentication": Object {}, "body": Object {}, "created": 1733125229397, "description": "", "headers": Array [], "isPrivate": false, "metaSortKey": -1733125229397, "method": "GET", "modified": 1733125229397, "name": "foo", "parameters": Array [], "parentId": "nothing", "pathParameters": undefined, "preRequestScript": undefined, "settingDisableRenderRequestBody": false, "settingEncodeUrl": true, "settingFollowRedirects": "global", "settingRebuildPath": true, "settingSendCookies": true, "settingStoreCookies": true, "type": "Request", "url": "", }, false, Array [], ], ], Array [ Array [ "update", Object { "_id": "req_cc1dd2ca4275747aa88199e8efd42403", "afterResponseScript": undefined, "authentication": Object {}, "body": Object {}, "created": 1733125229397, "description": "", "headers": Array [], "isPrivate": false, "metaSortKey": -1733125229397, "method": "GET", "modified": 1733125229398, "name": "bar", "parameters": Array [], "parentId": "nothing", "pathParameters": undefined, "preRequestScript": undefined, "settingDisableRenderRequestBody": false, "settingEncodeUrl": true, "settingFollowRedirects": "global", "settingRebuildPath": true, "settingSendCookies": true, "settingStoreCookies": true, "type": "Request", "url": "", }, false, + Array [ Object { "name": "bar", }, + ], ], ], ] ❯ src/common/__tests__/database.test.ts:39:25
[['insert', newDoc, false]],
[['update', updatedDoc, false]],
[['insert', newDoc, false, []]],
[['update', updatedDoc, false, { name: 'bar' }]],
]);
db.offChange(callback);
await models.request.create(doc);
Expand Down Expand Up @@ -71,8 +71,8 @@ describe('bufferChanges()', () => {
await db.flushChanges();
expect(changesSeen).toEqual([
[
['insert', newDoc, false],
['update', updatedDoc, false],
['insert', newDoc, false, []],
['update', updatedDoc, false, [true]],
],
]);
// Assert no more changes seen after flush again
Expand Down Expand Up @@ -106,8 +106,8 @@ describe('bufferChanges()', () => {
await new Promise(resolve => setTimeout(resolve, 1500));
expect(changesSeen).toEqual([
[
['insert', newDoc, false],
['update', updatedDoc, false],
['insert', newDoc, false, []],
['update', updatedDoc, false, [true]],
],
]);
});
Expand All @@ -132,8 +132,8 @@ describe('bufferChanges()', () => {
await new Promise(resolve => setTimeout(resolve, 1000));
expect(changesSeen).toEqual([
[
['insert', newDoc, false],
['update', updatedDoc, false],
['insert', newDoc, false, []],
['update', updatedDoc, false, [true]],
],
]);
});
Expand Down

0 comments on commit 8e57033

Please sign in to comment.