-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add headers to webhook data #108
Conversation
1b097e3
to
45cfdd5
Compare
3f9e1d2
to
d3bfb97
Compare
368365a
to
683b3e2
Compare
src/utils/files.ts
Outdated
{ | ||
[DateLevel.Year]: date.getUTCFullYear().toString(), | ||
[DateLevel.Month]: ("0" + (date.getUTCMonth() + 1)).slice(-2), | ||
[DateLevel.Day]: ("0" + date.getUTCDate()).slice(-2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a function called padWithLeadingZeros
in the src/modules/migrations/add.ts
module that does exactly this. It would be nice to reuse it.
7dafee8
to
7a7a2c2
Compare
tests/unit/utils/number.test.ts
Outdated
it("should pad the number with leading zeros when numberOfZeros is greater than the length of the number", () => { | ||
expect(padWithLeadingZeros(5, 3)).toBe("005"); | ||
expect(padWithLeadingZeros(42, 5)).toBe("00042"); | ||
expect(padWithLeadingZeros(0, 4)).toBe("0000"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer parametrized tests over one test with multiple expects each for a different case.
tests/unit/utils/files.test.ts
Outdated
["2025-02-07-15-08", DateLevel.Minute], | ||
["2025-02-07-15-08-40", DateLevel.Second], | ||
])( | ||
"correctly serializes datetime", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include the case data in the test-case name so the cases are distinguishable. Now it is not possible to know which case failed. You can use there printf formatting. https://vitest.dev/api/#test-each
7a7a2c2
to
e6a0f8e
Compare
e6a0f8e
to
4ec949c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets go
Motivation
Which issue does this fix? Fixes #
issue number
If no issue exists, what is the fix or new feature? Were there any reasons to fix/implement things that are not obvious?
Checklist
How to test
If manual testing is required, what are the steps?