Skip to content

Commit

Permalink
chore: add test for object handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
estephinson committed Nov 1, 2023
1 parent 41475f5 commit a57a5f0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/build/tests/core/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@ test('Event handlers are called', async (t) => {
t.true(flag)
})

test('Event handlers with description are called', async (t) => {
let flag = false
await new Fixture('./fixtures/empty')
.withFlags({
eventHandlers: {
onPostBuild: {
handler: () => {
flag = true
},
description: 'Test onPostBuild',
},
},
})
.runWithBuild()

t.true(flag)
})

test('Exit code is 1 on build cancellation', async (t) => {
const { exitCode } = await new Fixture('./fixtures/cancel').runBuildBinary()
t.is(exitCode, 1)
Expand Down

0 comments on commit a57a5f0

Please sign in to comment.