From b5e2c96002255cc332e900dc6cfe04dd9259c4c8 Mon Sep 17 00:00:00 2001 From: David Woo Date: Wed, 27 Mar 2024 17:16:46 -0700 Subject: [PATCH] Fix integration test: Resolve Unix timestamp conversion error --- projects/initial-data/processRespository.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/initial-data/processRespository.test.js b/projects/initial-data/processRespository.test.js index 5949800..6b6aea9 100644 --- a/projects/initial-data/processRespository.test.js +++ b/projects/initial-data/processRespository.test.js @@ -12,16 +12,16 @@ describe('Skretch Objective', () => { let data; it('receives a mocked response from the GitHub API', async () => { data = await fetchRepoCreationDate(octokit, 'octocat', 'hello-world'); - expect(data).toEqual('2019-02-23T15:08:34Z'); + expect(data).toEqual(1550934514000); }); it('writes JSON data to csv file', async() => { const response = { - 'date_first_commit': '2019-02-23T15:08:34Z', + 'date_first_commit': 1550934514000, }; - const spy = jest.spyOn(DataRecorder.prototype, 'appendToCSV').mockImplementation(() => fs.appendFileSync('test.csv', '2019-02-23T15:08:34Z\n', 'utf8')); + const spy = jest.spyOn(DataRecorder.prototype, 'appendToCSV').mockImplementation(() => fs.appendFileSync('test.csv', '1550934514000', 'utf8')); const dataRecorder = new DataRecorder('test.csv'); dataRecorder.appendToCSV([response.date_first_commit]);