Skip to content

Commit

Permalink
add process test
Browse files Browse the repository at this point in the history
  • Loading branch information
wilk committed Oct 15, 2019
1 parent a562c02 commit da3edc9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions __tests__/process.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import os from 'os'

// this unit is used to increase the test coverage
describe('Process Testing', () => {
it('should terminate the worker pool using nodejs 12.5+', async () => {
Object.defineProperty(process, 'version', { value: 'v12.5.0' })
const { start, stop } = require('../src/job')
await start()

await stop()
})

it('should warn about the number of CPUs using more than 10 CPUs', async () => {
Object.defineProperty(os, 'cpus', { value: () => Array.from({ length: 12 }) })
const { start, stop } = require('../src/job')
await start()

await stop()
})
})

0 comments on commit da3edc9

Please sign in to comment.