From 8b46709295b1277f31c3539958c22fea60c4be41 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Wed, 24 Aug 2022 03:14:20 +0300 Subject: [PATCH] Update update.test.js --- tests/commands/database/update.test.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/commands/database/update.test.js b/tests/commands/database/update.test.js index a6465989cd..abaf4b7a96 100644 --- a/tests/commands/database/update.test.js +++ b/tests/commands/database/update.test.js @@ -32,9 +32,20 @@ removed 1 duplicates done `) - expect(content('tests/__data__/output/database/streams.db')).toEqual( - content('tests/__data__/expected/database/db_update.streams.db') - ) + let input = content('tests/__data__/input/database/db_update.streams.db') + let output = content('tests/__data__/output/database/streams.db') + let expected = content('tests/__data__/expected/database/db_update.streams.db') + + let inputDate = input.find(i => i._id === '2ST8btby3mmsgPF0')['updated_at'] + let outputDate = output.find(i => i._id === '2ST8btby3mmsgPF0')['updated_at'] + + expect(outputDate).not.toEqual(inputDate) + + output = output.map(i => { + delete i['updated_at'] + return i + }) + expect(output).toEqual(expected) }) function content(filepath) {