Compare commits

...

2 commits

Author SHA1 Message Date
f4470ac2e9
Update github code scanning stuff to latest
Some checks failed
njsscan sarif / njsscan code scanning (push) Failing after 2s
discord bot tests / discord bot tests (push) Successful in 11s
2024-10-24 01:39:27 +02:00
b36a71d517
Add test for getCreationDate
All checks were successful
discord bot tests / discord bot tests (push) Successful in 12s
2024-10-24 01:34:46 +02:00
2 changed files with 24 additions and 2 deletions

View file

@ -33,10 +33,10 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: nodejsscan scan - name: nodejsscan scan
id: njsscan id: njsscan
uses: ajinabraham/njsscan-action@7237412fdd36af517e2745077cedbf9d6900d711 uses: ajinabraham/njsscan-action@v7
with: with:
args: '. --sarif --output results.sarif || true' args: '. --sarif --output results.sarif || true'
- name: Upload njsscan report - name: Upload njsscan report
uses: github/codeql-action/upload-sarif@v2 uses: github/codeql-action/upload-sarif@v3
with: with:
sarif_file: results.sarif sarif_file: results.sarif

View file

@ -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])
}
});