From b36a71d517b5c7a7d95840f2907614b9cfa87ed7 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Thu, 24 Oct 2024 01:34:46 +0200 Subject: [PATCH 1/2] Add test for getCreationDate --- tests/getCreationDate.test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/getCreationDate.test.js diff --git a/tests/getCreationDate.test.js b/tests/getCreationDate.test.js new file mode 100644 index 0000000..4bbbf9f --- /dev/null +++ b/tests/getCreationDate.test.js @@ -0,0 +1,22 @@ +const getCreationDate = require('../util/getCreationDate'); + +const users = [ + { user: { createdAt: new Date("2016-01-29T14:47:58.915Z") } }, + { user: { createdAt: new Date("2018-08-20T15:51:47.090Z") } }, + { user: { createdAt: new Date("2019-04-08T21:08:11.212Z") } } + +] + +const humanReadableTime = [ + "2016-01-29 14:47:58", + "2018-08-20 15:51:47", + "2019-04-08 21:08:11" +] + + +test('Testing getCreationDate', () => { + for(let i = 0; i < users.length; i++){ + expect(getCreationDate(users[i])).toBe(humanReadableTime[i]) + } + +}); \ No newline at end of file From f4470ac2e9b7fd3f7b293a801d7d473d77b81925 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Thu, 24 Oct 2024 01:37:44 +0200 Subject: [PATCH 2/2] Update github code scanning stuff to latest --- .github/workflows/njsscan.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/njsscan.yml b/.github/workflows/njsscan.yml index 5cf6cee..ff888b4 100644 --- a/.github/workflows/njsscan.yml +++ b/.github/workflows/njsscan.yml @@ -33,10 +33,10 @@ jobs: uses: actions/checkout@v3 - name: nodejsscan scan id: njsscan - uses: ajinabraham/njsscan-action@7237412fdd36af517e2745077cedbf9d6900d711 + uses: ajinabraham/njsscan-action@v7 with: args: '. --sarif --output results.sarif || true' - name: Upload njsscan report - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: results.sarif