Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 2cfc1cd

Browse files
integrationTests: sync with graphql-js (#711)
1 parent 50b9b24 commit 2cfc1cd

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

integrationTests/integration-test.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,31 @@ 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', () => {
18-
const tmpDir = path.join(os.tmpdir(), 'graphql-js-integrationTmp');
19+
const tmpDir = path.join(os.tmpdir(), 'express-graphql-integrationTmp');
1920
fs.rmdirSync(tmpDir, { recursive: true });
2021
fs.mkdirSync(tmpDir);
2122

2223
const distDir = path.resolve('./npmDist');
23-
exec(`npm pack ${distDir} && cp express-graphql-*.tgz express-graphql.tgz`, {
24-
cwd: tmpDir,
25-
});
24+
const archiveName = exec(`npm --quiet pack ${distDir}`, { cwd: tmpDir });
25+
fs.renameSync(
26+
path.join(tmpDir, archiveName),
27+
path.join(tmpDir, 'express-graphql.tgz'),
28+
);
2629

2730
function testOnNodeProject(projectName) {
2831
exec(`cp -R ${path.join(__dirname, projectName)} ${tmpDir}`);
2932

3033
const cwd = path.join(tmpDir, projectName);
31-
exec('npm install --quiet', { cwd });
32-
exec('npm test', { cwd });
34+
exec('npm --quiet install', { cwd, stdio: 'inherit' });
35+
exec('npm --quiet test', { cwd, stdio: 'inherit' });
3336
}
3437

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

0 commit comments

Comments
 (0)