Skip to content

Commit 3b10b17

Browse files
integrationTests: remove shell command for copying files (#2802)
1 parent 16009cb commit 3b10b17

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

integrationTests/integration-test.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ const childProcess = require('child_process');
88
const { describe, it } = require('mocha');
99

1010
function exec(command, options = {}) {
11-
return childProcess.execSync(command, {
12-
stdio: 'inherit',
11+
const result = childProcess.execSync(command, {
12+
encoding: 'utf-8',
1313
...options,
1414
});
15+
return result != null ? result.trimEnd() : result;
1516
}
1617

1718
describe('Integration Tests', () => {
@@ -20,14 +21,18 @@ describe('Integration Tests', () => {
2021
fs.mkdirSync(tmpDir);
2122

2223
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+
);
2429

2530
function testOnNodeProject(projectName) {
2631
exec(`cp -R ${path.join(__dirname, projectName)} ${tmpDir}`);
2732

2833
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' });
3136
}
3237

3338
it('Should compile with all supported TS versions', () => {

0 commit comments

Comments
 (0)