Skip to content

Commit f9d6bc8

Browse files
authored
fix(test): add test for shorthand transform (#210)
1 parent 715d717 commit f9d6bc8

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lib/conversions.js

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ const templates = {
2828
}
2929
}
3030

31+
module.exports.templates = templates
32+
3133
const convert = async function (template) {
3234
/*
3335
- things to add from cutenode/action-meeting

test/index.js

+20
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { suite, test } = require('mocha')
33
const assert = require('assert')
44
const { DateTime } = require('luxon')
55
const pkg = require('../package.json')
6+
const { convert, templates } = require('../lib/conversions')
67
const meetings = require('../lib/meetings')
78

89
suite(`${pkg.name} unit`, () => {
@@ -18,3 +19,22 @@ suite(`${pkg.name} unit`, () => {
1819
assert.deepStrictEqual(next.toISO(), DateTime.fromISO('2020-04-16T13:00:00.0Z').toISO())
1920
})
2021
})
22+
23+
test('shorthands transform', async () => {
24+
templates.values.title = 'Test Meeting'
25+
templates.values.agendaLabel = 'meeting-agenda'
26+
templates.values.invitees = '@pkgjs/meet'
27+
templates.values.observers = '@nodejs/package-maintenance'
28+
29+
const input = `# <!-- title -->
30+
<!-- agenda label -->
31+
<!-- invitees -->
32+
<!-- observers -->`
33+
34+
const output = `# Test Meeting
35+
meeting-agenda
36+
@pkgjs/meet
37+
@nodejs/package-maintenance`
38+
39+
assert.equal(await convert(input), output)
40+
})

0 commit comments

Comments
 (0)