Skip to content

Commit

Permalink
start() returns this after started
Browse files Browse the repository at this point in the history
  • Loading branch information
timgit committed Aug 18, 2024
1 parent 4b3d9f4 commit 67f2f76
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pg-boss",
"version": "10.0.0",
"version": "10.0.1",
"description": "Queueing jobs in Postgres from Node.js like a boss",
"main": "./src/index.js",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class PgBoss extends EventEmitter {

async start () {
if (this.#starting || this.#started) {
return
return this
}

this.#starting = true
Expand Down
6 changes: 6 additions & 0 deletions test/configTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ describe('config', function () {
assert(false)
} catch {}
})

it('start() should return instance after', async function () {
const boss = this.test.boss = await helper.start({ ...this.test.bossConfig })
const result2 = await boss.start()
assert(result2)
})
})

0 comments on commit 67f2f76

Please sign in to comment.