Skip to content
Merged
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
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ jobs:
- run: npm install
- run: npm test

testint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 24
- run: npm install
- run: npm run test:integration
env:
GITHUB_TOKEN: ${{ secrets.INT_TEST_TOKEN }}
action-in-action:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion lib/meetings.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"scripts": {
"build": "npx @vercel/ncc build",
"test": "standard && mocha test/index.js",
"test:integration": "standard && mocha",
"test:integration": "standard && mocha test/integration.js",
"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
16 changes: 10 additions & 6 deletions test/integration.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'
/* global Temporal */
require('dotenv').config()
const { suite, test, before } = require('mocha')
const assert = require('assert')
/* global Temporal */
if (!global.Temporal) {
const polyfill = require('@js-temporal/polyfill')
global.Temporal = polyfill.Temporal
Expand All @@ -20,18 +20,21 @@ suite(`${pkg.name} integration`, () => {
const issue = await meetings.shouldCreateNextMeetingIssue(client, {
owner: 'wesleytodd',
repo: 'meeting-maker',
issueTitle: (date) => `Test Meeting ${date.toZonedDateTimeISO('UTC').toPlainDate().toString()}`,
issueTitle: ({ date }) => `Test Meeting ${date.toZonedDateTimeISO('UTC').toPlainDate().toString()}`,
createWithin: 'P7D',
agendaLabel: 'meeting-agenda',
schedules: [
// 1pm GMT April 16 repeating every 28 days
'2020-04-16T13:00:00.0Z/P28D'
],
now: Temporal.Instant.from('2020-04-13T13:00:00.0Z')
now: Temporal.Instant.from('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 ${Temporal.Instant.from('2020-04-16T13:00:00.0Z').toZonedDateTimeISO('UTC').toPlainDate().toString()}`)
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 @@ -40,6 +43,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 @@ -48,8 +52,8 @@ suite(`${pkg.name} integration`, () => {
'2020-04-16T13:00:00.0Z/P28D'
],
now: Temporal.Instant.from('2020-04-13T13:00:00.0Z'),
issueTitle: (date) => `Test Meeting ${date.toZonedDateTimeISO('UTC').toPlainDate().toString()}`,
labels: ['testMeeting', 'test']
issueTitle: ({ date }) => `Test Meeting ${date.toZonedDateTimeISO('UTC').toPlainDate().toString()}`,
meetingLabels: ['testMeeting', 'test']
})

assert.deepStrictEqual(issue.data.title, `Test Meeting ${Temporal.Instant.from('2020-04-16T13:00:00.0Z').toZonedDateTimeISO('UTC').toPlainDate().toString()}`)
Expand Down