@@ -8,10 +8,11 @@ const childProcess = require('child_process');
8
8
const { describe, it } = require ( 'mocha' ) ;
9
9
10
10
function exec ( command , options = { } ) {
11
- return childProcess . execSync ( command , {
12
- stdio : 'inherit ' ,
11
+ const result = childProcess . execSync ( command , {
12
+ encoding : 'utf-8 ' ,
13
13
...options ,
14
14
} ) ;
15
+ return result != null ? result . trimEnd ( ) : result ;
15
16
}
16
17
17
18
describe ( 'Integration Tests' , ( ) => {
@@ -20,14 +21,18 @@ describe('Integration Tests', () => {
20
21
fs . mkdirSync ( tmpDir ) ;
21
22
22
23
const distDir = path . resolve ( './npmDist' ) ;
23
- exec ( `npm pack ${ distDir } && cp graphql-*.tgz graphql.tgz` , { cwd : tmpDir } ) ;
24
+ const archiveName = exec ( `npm --quiet pack ${ distDir } ` , { cwd : tmpDir } ) ;
25
+ fs . renameSync (
26
+ path . join ( tmpDir , archiveName ) ,
27
+ path . join ( tmpDir , 'graphql.tgz' ) ,
28
+ ) ;
24
29
25
30
function testOnNodeProject ( projectName ) {
26
31
exec ( `cp -R ${ path . join ( __dirname , projectName ) } ${ tmpDir } ` ) ;
27
32
28
33
const cwd = path . join ( tmpDir , projectName ) ;
29
- exec ( 'npm install --quiet' , { cwd } ) ;
30
- exec ( 'npm test' , { cwd } ) ;
34
+ exec ( 'npm --quiet install ' , { cwd, stdio : 'inherit' } ) ;
35
+ exec ( 'npm --quiet test' , { cwd, stdio : 'inherit' } ) ;
31
36
}
32
37
33
38
it ( 'Should compile with all supported TS versions' , ( ) => {
0 commit comments