generated from HelloUnspecified/template-graph-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #221 from ThatConference/feat/online-create-channel
feat: create discord channel on create open space
- Loading branch information
Showing
9 changed files
with
275 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,14 @@ const requiredConfig = () => ({ | |
process.env.NOTIFICATION_EMAIL_FROM || '[email protected]', | ||
ogImageBaseUrl: | ||
process.env.OG_IMAGE_BASE_URL || configMissing('OG_IMAGE_BASE_URL'), | ||
thatJoinDiscordBot: { | ||
baseUrl: | ||
process.env.THAT_JOIN_BOT_BASE_URL ?? | ||
configMissing('THAT_JOIN_BOT_BASE_URL'), | ||
}, | ||
thatRequestSigningKey: | ||
process.env.THAT_REQUEST_SIGNING_KEY || | ||
configMissing('THAT_REQUEST_SIGNING_KEY'), | ||
}); | ||
|
||
export default requiredConfig(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { findDateAtNextHour } from '../findDateAtNextHour'; | ||
import dayjs from 'dayjs'; | ||
import mockDate from 'mockdate'; | ||
|
||
const tests = [ | ||
{ | ||
now: '2023-10-11T10:10:10', | ||
for: 8, | ||
expect: dayjs('2023-10-11T10:10:10') | ||
.add(1, 'day') | ||
.hour(8) | ||
.startOf('hour') | ||
.toDate(), | ||
}, | ||
{ | ||
now: '2023-10-11T10:10:10', | ||
for: 12, | ||
expect: dayjs('2023-10-11T10:10:10').hour(12).startOf('hour').toDate(), | ||
}, | ||
{ | ||
now: '2023-10-11T10:10:10', | ||
for: 10, | ||
expect: dayjs('2023-10-11T10:10:10') | ||
.add(1, 'day') | ||
.hour(10) | ||
.startOf('hour') | ||
.toDate(), | ||
}, | ||
{ | ||
now: '2023-10-11T11:00:00', | ||
for: 11, | ||
expect: dayjs('2023-10-11T11:00:00').hour(11).startOf('hour').toDate(), | ||
}, | ||
{ | ||
now: '2023-10-11T11:00:01', | ||
for: 11, | ||
expect: dayjs('2023-10-11T11:00:00') | ||
.add(1, 'day') | ||
.hour(11) | ||
.startOf('hour') | ||
.toDate(), | ||
}, | ||
{ | ||
now: '2023-10-11T10:59:59', | ||
for: 11, | ||
expect: dayjs('2023-10-11T10:59:59').hour(11).startOf('hour').toDate(), | ||
}, | ||
]; | ||
|
||
describe('findDateAtNextHour tests', () => { | ||
tests.forEach(testData => { | ||
it(`with ${testData.now}, hour ${testData.for}, returns ${testData.expect}`, () => { | ||
mockDate.set(testData.now); | ||
const result = findDateAtNextHour(testData.for); | ||
expect(result.toString()).toBe(testData.expect.toString()); | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
mockDate.reset(); | ||
}); | ||
}); |
Oops, something went wrong.