From 7a7ab5f77e7ab709456dc9856920f18d0f3c16f1 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Wed, 16 Sep 2020 14:26:24 +0300 Subject: [PATCH] integrationTests: remove shell command for copying files --- integrationTests/integration-test.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/integrationTests/integration-test.js b/integrationTests/integration-test.js index cd295b52fd..c0371f676e 100644 --- a/integrationTests/integration-test.js +++ b/integrationTests/integration-test.js @@ -8,10 +8,11 @@ const childProcess = require('child_process'); const { describe, it } = require('mocha'); function exec(command, options = {}) { - return childProcess.execSync(command, { - stdio: 'inherit', + const result = childProcess.execSync(command, { + encoding: 'utf-8', ...options, }); + return result != null ? result.trimEnd() : result; } describe('Integration Tests', () => { @@ -20,14 +21,18 @@ describe('Integration Tests', () => { fs.mkdirSync(tmpDir); const distDir = path.resolve('./npmDist'); - exec(`npm pack ${distDir} && cp graphql-*.tgz graphql.tgz`, { cwd: tmpDir }); + const archiveName = exec(`npm --quiet pack ${distDir}`, { cwd: tmpDir }); + fs.renameSync( + path.join(tmpDir, archiveName), + path.join(tmpDir, 'graphql.tgz'), + ); function testOnNodeProject(projectName) { exec(`cp -R ${path.join(__dirname, projectName)} ${tmpDir}`); const cwd = path.join(tmpDir, projectName); - exec('npm install --quiet', { cwd }); - exec('npm test', { cwd }); + exec('npm --quiet install', { cwd, stdio: 'inherit' }); + exec('npm --quiet test', { cwd, stdio: 'inherit' }); } it('Should compile with all supported TS versions', () => {