@@ -4,10 +4,22 @@ var WindowsKillClass = require('../lib/windows-kill-class');
44
55var test = ava . test ;
66
7+ var noop = function ( ) { } ;
8+
9+ var defaultApplyOptions = WindowsKillClass . prototype . _applyOptions ;
10+ WindowsKillClass . prototype . _applyOptions = noop ;
11+
712var windowsKill = new WindowsKillClass ( {
8- replaceNodeKill : false
13+ replaceNodeKill : false ,
14+ warmUp : true
915} ) ;
1016
17+ windowsKill . _native . warmUp = noop ;
18+ WindowsKillClass . prototype . _applyOptions = defaultApplyOptions ;
19+
20+ windowsKill . _applyOptions ( ) ;
21+
22+
1123test ( 'instance should be an object' , t => {
1224 t . is ( typeof windowsKill , 'object' ) ;
1325 t . pass ( ) ;
@@ -18,8 +30,14 @@ test('instance should have kill property which is a function', t => {
1830 t . pass ( ) ;
1931} ) ;
2032
21- test ( 'instance should have shouldReplaceNodesKill property and must be false' , t => {
22- t . is ( typeof windowsKill . shouldReplaceNodesKill , 'boolean' , 'check shouldReplaceNodesKill property is boolean' ) ;
23- t . is ( windowsKill . shouldReplaceNodesKill , false , 'check shouldReplaceNodesKill property is boolean' ) ;
33+ test ( 'instance should have _shouldReplaceNodesKill property and must be false' , t => {
34+ t . is ( typeof windowsKill . _shouldReplaceNodesKill , 'boolean' , 'check _shouldReplaceNodesKill property is boolean' ) ;
35+ t . is ( windowsKill . _shouldReplaceNodesKill , false , 'check _shouldReplaceNodesKill property is boolean' ) ;
36+ t . pass ( ) ;
37+ } ) ;
38+
39+ test ( 'instance should have _shouldWarmUp property and must be true' , t => {
40+ t . is ( typeof windowsKill . _shouldWarmUp , 'boolean' , 'check _shouldWarmUp property is boolean' ) ;
41+ t . is ( windowsKill . _shouldWarmUp , true , 'check _shouldWarmUp property is boolean' ) ;
2442 t . pass ( ) ;
2543} ) ;
0 commit comments