Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohansebas committed Nov 22, 2024
1 parent 1a93ded commit 4c35b38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/conversions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const inputs = {
observers: core.getInput('observers')
}

module.exports.inputs = inputs

// template keys and values that we automagically replace in
// markdown templates that are passed to us.
const templates = {
Expand All @@ -27,6 +25,8 @@ const templates = {
}
}

module.exports.templates = templates

const convert = async function (template) {
/*
- things to add from cutenode/action-meeting
Expand Down Expand Up @@ -63,7 +63,7 @@ const convert = async function (template) {
// passed to one in which the earliest instance of the
// template.keys iteration we're on is replaces with the
// matching template.values value.
console.log(inputs)
console.log(templates)
for (const keysKey in templates.keys) {
for (const valuesKey in templates.values) {
const keysValue = templates.keys[keysKey]
Expand Down
13 changes: 6 additions & 7 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { suite, test } = require('mocha')
const assert = require('assert')
const { DateTime } = require('luxon')
const pkg = require('../package.json')
const { convert, inputs } = require('../lib/conversions')
const { convert, templates } = require('../lib/conversions')
const meetings = require('../lib/meetings')

suite(`${pkg.name} unit`, () => {
Expand All @@ -21,10 +21,10 @@ suite(`${pkg.name} unit`, () => {
})

test('convert shorthands', async () => {
inputs.title = 'Test Meeting'
inputs.agendaLabel = 'meeting-agenda'
inputs.invitees = '@pkgjs/meet'
inputs.observers = '@nodejs/package-maintenance'
templates.values.title = 'Test Meeting'
templates.values.agendaLabel = 'meeting-agenda'
templates.values.invitees = '@pkgjs/meet'
templates.values.observers = '@nodejs/package-maintenance'

const input = `# <!-- title -->
<!-- agenda label -->
Expand All @@ -34,7 +34,6 @@ test('convert shorthands', async () => {
const output = `# Test Meeting
meeting-agenda
@pkgjs/meet
@nodejs/package-maintenance
`
@nodejs/package-maintenance`
assert.equal(await convert(input), output)
})

0 comments on commit 4c35b38

Please sign in to comment.