@@ -23,7 +23,7 @@ import start from './start.js';
2323describe ( 'start implementation' , async ( ) => {
2424 describe ( 'begins the app process' , async ( ) => {
2525 /** @type {sinon.SinonStub } */
26- let consoleLogStub ;
26+ let exitStub ;
2727 /** @type {sinon.SinonStub } */
2828 let stdoutWriteStub ;
2929 /** @type {sinon.SinonStub } */
@@ -34,7 +34,7 @@ describe('start implementation', async () => {
3434 let spawnStub ;
3535
3636 beforeEach ( ( ) => {
37- consoleLogStub = sinon . stub ( console , 'log ' ) ;
37+ exitStub = sinon . stub ( process , 'exit ' ) ;
3838 stdoutWriteStub = sinon . stub ( process . stdout , 'write' ) ;
3939 stderrWriteStub = sinon . stub ( process . stderr , 'write' ) ;
4040 mockSpawnProcess = {
@@ -84,7 +84,7 @@ describe('start implementation', async () => {
8484 assert . ok ( spawnStub . calledWith ( 'node' , [ path . resolve ( 'tmp' , 'start.js' ) ] ) ) ;
8585 assert . ok ( stdoutWriteStub . calledWith ( 'message' ) ) ;
8686 assert . ok ( stderrWriteStub . calledWith ( 'warning' ) ) ;
87- assert . ok ( consoleLogStub . calledWith ( 'Local run exited with code 0' ) ) ;
87+ assert . ok ( exitStub . calledWith ( 0 ) ) ;
8888 } ) ;
8989 } ) ;
9090
@@ -99,7 +99,7 @@ describe('start implementation', async () => {
9999 assert . ok ( spawnStub . calledWith ( 'node' , [ path . resolve ( 'tmp' , 'app.js' ) ] ) ) ;
100100 assert . ok ( stdoutWriteStub . calledWith ( 'defaults' ) ) ;
101101 assert . ok ( stderrWriteStub . calledWith ( 'watch out' ) ) ;
102- assert . ok ( consoleLogStub . calledWith ( 'Local run exited with code 2' ) ) ;
102+ assert . ok ( exitStub . calledWith ( 2 ) ) ;
103103 } ) ;
104104 } ) ;
105105
@@ -122,7 +122,7 @@ describe('start implementation', async () => {
122122 assert . ok ( spawnStub . calledWith ( 'node' , [ path . resolve ( 'application.js' ) ] ) ) ;
123123 assert . ok ( stdoutWriteStub . calledWith ( 'startled' ) ) ;
124124 assert . ok ( stderrWriteStub . calledWith ( 'erroneous' ) ) ;
125- assert . ok ( consoleLogStub . calledWith ( 'Local run exited with code 4' ) ) ;
125+ assert . ok ( exitStub . calledWith ( 4 ) ) ;
126126 } ) ;
127127 } ) ;
128128 } ) ;
0 commit comments