Skip to content

Commit b4f7521

Browse files
committed
add test to verify that .setup() is async
1 parent f5fc95d commit b4f7521

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

abstract.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ function abstractPersistence (opts) {
173173
}
174174

175175
// testing starts here
176+
test('verify setup() method is async', async t => {
177+
t.plan(1)
178+
const prInstance = await persistence(t)
179+
t.assert.equal(prInstance.setup.constructor.name, 'AsyncFunction', '.setup() must be an async function')
180+
})
181+
176182
test('store and look up retained messages', async t => {
177183
t.plan(1)
178184
await matchRetainedWithPattern(t, 'hello/world')

callBackPersistence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class CallBackPersistence extends EventEmitter {
3131
})
3232
}
3333

34-
setup (broker) {
34+
async setup (broker) {
3535
return this.asyncPersistence.setup(broker)
3636
}
3737

0 commit comments

Comments
 (0)