-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
}) | ||
}) |