From c90d573f1185f094e61103495e49c3cc3189dc48 Mon Sep 17 00:00:00 2001 From: Klemek Date: Sat, 22 Jun 2019 09:35:32 +0200 Subject: [PATCH] Reformated some file walker tests --- test/file_walker.test.js | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/test/file_walker.test.js b/test/file_walker.test.js index 4eb6c2c..bf30e49 100644 --- a/test/file_walker.test.js +++ b/test/file_walker.test.js @@ -117,9 +117,10 @@ describe('Test index article reading', () => { `); fw.readIndexFile(file, 'custom_thumbnail', (err, info) => { expect(err).toBeNull(); - expect(info).toBeDefined(); - expect(info.title).toBe('This is an awesome title !?¤'); - expect(info.thumbnail).toBe('./thumbnail.jpg'); + expect(info).toEqual({ + title: 'This is an awesome title !?¤', + thumbnail: './thumbnail.jpg' + }); done(); }); }); @@ -132,9 +133,10 @@ describe('Test index article reading', () => { `); fw.readIndexFile(file, 'custom_thumbnail', (err, info) => { expect(err).toBeNull(); - expect(info).toBeDefined(); - expect(info.title).not.toBeDefined(); - expect(info.thumbnail).toBe('./thumbnail.jpg'); + expect(info).toEqual({ + title: undefined, + thumbnail: './thumbnail.jpg' + }); done(); }); }); @@ -143,9 +145,10 @@ describe('Test index article reading', () => { fs.writeFileSync(file, '#title'); fw.readIndexFile(file, 'custom_thumbnail', (err, info) => { expect(err).toBeNull(); - expect(info).toBeDefined(); - expect(info.title).toBe('title'); - expect(info.thumbnail).not.toBeDefined(); + expect(info).toEqual({ + title: 'title', + thumbnail: undefined + }); done(); }); }); @@ -158,9 +161,10 @@ describe('Test index article reading', () => { `); fw.readIndexFile(file, 'thumbnail', (err, info) => { expect(err).toBeNull(); - expect(info).toBeDefined(); - expect(info.title).toBe('This is an awesome title !?¤'); - expect(info.thumbnail).not.toBeDefined(); + expect(info).toEqual({ + title: 'This is an awesome title !?¤', + thumbnail: undefined + }); done(); }); }); @@ -174,9 +178,10 @@ describe('Test index article reading', () => { `); fw.readIndexFile(file, 'custom_thumbnail', (err, info) => { expect(err).toBeNull(); - expect(info).toBeDefined(); - expect(info.title).toBe('This is an awesome title !?¤'); - expect(info.thumbnail).toBe('./thumbnail.jpg'); + expect(info).toEqual({ + title: 'This is an awesome title !?¤', + thumbnail: './thumbnail.jpg' + }); done(); }); });