@@ -29,7 +29,7 @@ describe('index', () => {
2929 stagingDir : stagingDir ,
3030 signingPassword : '12345' ,
3131 host : 'localhost' ,
32- rekeySignedPackage : `../.. /testSignedPackage.pkg`
32+ rekeySignedPackage : `${ tempDir } /testSignedPackage.pkg`
3333 } ) ;
3434 options . rootDir = rootDir ;
3535 fsExtra . emptyDirSync ( tempDir ) ;
@@ -555,7 +555,9 @@ describe('index', () => {
555555
556556 it ( 'runs via the command line using the rokudeploy.json file' , function test ( ) {
557557 this . timeout ( 20000 ) ;
558- child_process . execSync ( `node dist/index.js` ) ;
558+ //build the project
559+ child_process . execSync ( `npm run build` , { stdio : 'inherit' } ) ;
560+ child_process . execSync ( `node dist/index.js` , { stdio : 'inherit' } ) ;
559561 } ) ;
560562
561563 describe ( 'generateBaseRequestOptions' , ( ) => {
@@ -911,7 +913,7 @@ describe('index', () => {
911913 <keyed-developer-id>${ options . devId } </keyed-developer-id>
912914 </device-info>` ;
913915 mockDoGetRequest ( body ) ;
914- fsExtra . outputFileSync ( ` ${ rootDir } / ${ options . rekeySignedPackage } ` , '' ) ;
916+ fsExtra . outputFileSync ( path . resolve ( rootDir , options . rekeySignedPackage ) , '' ) ;
915917 } ) ;
916918
917919 it ( 'does not crash when archive is undefined' , async ( ) => {
@@ -931,8 +933,13 @@ describe('index', () => {
931933 <font color="red">Success.</font>
932934 </div>` ;
933935 mockDoPostRequest ( body ) ;
934- options . rekeySignedPackage = `../../testSignedPackage.pkg` ;
935- await rokuDeploy . rekeyDevice ( options ) ;
936+ options . rekeySignedPackage = s `../notReal.pkg` ;
937+ try {
938+ fsExtra . writeFileSync ( s `${ tempDir } /notReal.pkg` , '' ) ;
939+ await rokuDeploy . rekeyDevice ( options ) ;
940+ } finally {
941+ fsExtra . removeSync ( s `${ tempDir } /notReal.pkg` ) ;
942+ }
936943 } ) ;
937944
938945 it ( 'should work with absolute path' , async ( ) => {
@@ -941,7 +948,7 @@ describe('index', () => {
941948 </div>` ;
942949 mockDoPostRequest ( body ) ;
943950
944- options . rekeySignedPackage = s `${ cwd } /testSignedPackage.pkg` ;
951+ options . rekeySignedPackage = s `${ tempDir } /testSignedPackage.pkg` ;
945952 await rokuDeploy . rekeyDevice ( options ) ;
946953 } ) ;
947954
0 commit comments