Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timgit committed Dec 20, 2019
1 parent 2e92df5 commit c608601
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,8 @@ class Manager extends EventEmitter {
const jobs = result.rows.map(job => {
job.done = async (error, response) => {
if (error) {
console.log('job.done() got an error')
await this.fail(job.id, error)
} else {
console.log('job.done() reporting success')
await this.complete(job.id, response)
}
}
Expand All @@ -267,7 +265,7 @@ class Manager extends EventEmitter {
: jobs
}

fetchCompleted (name, batchSize) {
async fetchCompleted (name, batchSize) {
return this.fetch(completedJobPrefix + name, batchSize)
}

Expand Down
4 changes: 0 additions & 4 deletions test/databaseTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ describe('database', function () {

const newConnections = connectionCount - prevConnectionCount

console.log(`listeners: ${listenerCount} pool size: ${poolSize}`)
console.log('connections:')
console.log(` before subscribing: ${prevConnectionCount} now: ${connectionCount} new: ${newConnections}`)

assert(newConnections <= poolSize)

await boss.stop()
Expand Down
4 changes: 2 additions & 2 deletions test/initTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ const assert = require('chai').assert
const PgBoss = require('../src/index')
const helper = require('./testHelper')

describe('initialization', function () {
describe('init', function () {
this.timeout(10000)

beforeEach(() => helper.init())

it('should fail if connecting to an uninitialized instance', async function () {
try {
const config = helper.getConfig()
new PgBoss(config).connect()
await new PgBoss(config).connect()
} catch (error) {
assert.isNotNull(error)
}
Expand Down

0 comments on commit c608601

Please sign in to comment.