Skip to content

Commit

Permalink
fix(test): fix integration tests locally
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleytodd committed Feb 24, 2025
1 parent b9f1240 commit 4952897
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/meetings.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function getNextIssue (opts) {
title,
date,
agendaLabel: opts.agendaLabel,
agendaIssues: opts.agendaIssues,
agendaIssues: opts.agendaIssues || [],
meetingLink: opts.meetingLink,
labels: opts.meetingLabels,
meetingNotes: opts.meetingNotes || '',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"build": "npx @vercel/ncc build",
"test": "standard && mocha test/index.js",
"test:integration": "standard && mocha",
"test:integration:debug": "GITHUB_TOKEN=$(gh auth token) mocha --inspect --inspect-brk test/integration.js",
"lint:fix": "standard --fix",
"preversion": "npm t",
"postpublish": "git push origin && git push origin --tags",
Expand Down
14 changes: 9 additions & 5 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,21 @@ suite(`${pkg.name} integration`, () => {
const issue = await meetings.shouldCreateNextMeetingIssue(client, {
owner: 'wesleytodd',
repo: 'meeting-maker',
issueTitle: (date) => `Test Meeting ${date.toFormat('yyyy-MM-dd')}`,
issueTitle: ({ date }) => `Test Meeting ${date.toFormat('yyyy-MM-dd')}`,
createWithin: 'P7D',
agendaLabel: 'meeting-agenda',
schedules: [
// 1pm GMT April 16 repeating every 28 days
'2020-04-16T13:00:00.0Z/P28D'
],
now: DateTime.fromISO('2020-04-13T13:00:00.0Z')
now: DateTime.fromISO('2020-04-13T13:00:00.0Z'),
meetingLabels: ['testMeeting', 'test']
})
assert.deepStrictEqual(issue.owner, 'wesleytodd')
assert.deepStrictEqual(issue.repo, 'meeting-maker')
assert.deepStrictEqual(issue.title, `Test Meeting ${DateTime.fromISO('2020-04-16T13:00:00.0Z').toFormat('yyyy-MM-dd')}`)
assert.deepStrictEqual(issue.agendaLabel, 'meeting-agenda')
assert.deepStrictEqual(issue.meetingLabels, ['testMeeting, test'])
assert.deepStrictEqual(issue.labels, ['testMeeting', 'test'])
assert(typeof issue.body === 'string')
assert(Array.isArray(issue.agendaIssues))
})
Expand All @@ -36,6 +39,7 @@ suite(`${pkg.name} integration`, () => {
const issue = await meetings.createNextMeeting(client, {
owner: 'wesleytodd',
repo: 'meeting-maker',
createWithin: 'P7D',
schedules: [
// 5pm GMT April 2 repeating every 28 days
'2020-04-02T17:00:00.0Z/P28D',
Expand All @@ -44,8 +48,8 @@ suite(`${pkg.name} integration`, () => {
'2020-04-16T13:00:00.0Z/P28D'
],
now: DateTime.fromISO('2020-04-13T13:00:00.0Z'),
issueTitle: (date) => `Test Meeting ${date.toFormat('yyyy-MM-dd')}`,
labels: ['testMeeting', 'test']
issueTitle: ({ date }) => `Test Meeting ${date.toFormat('yyyy-MM-dd')}`,
meetingLabels: ['testMeeting', 'test']
})

assert.deepStrictEqual(issue.data.title, `Test Meeting ${DateTime.fromISO('2020-04-16T13:00:00.0Z').toFormat('yyyy-MM-dd')}`)
Expand Down

0 comments on commit 4952897

Please sign in to comment.