Skip to content
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

fix(test): fix integration tests locally #221

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading