Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrationTests: small refactoring #3262

Merged
merged 1 commit into from Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 13 additions & 14 deletions integrationTests/integration-test.js
Expand Up @@ -28,22 +28,21 @@ describe('Integration Tests', () => {
);

function testOnNodeProject(projectName) {
exec(`cp -R ${path.join(__dirname, projectName)} ${tmpDir}`);
const projectPath = path.join(__dirname, projectName);

const cwd = path.join(tmpDir, projectName);
exec('npm --quiet install', { cwd, stdio: 'inherit' });
exec('npm --quiet test', { cwd, stdio: 'inherit' });
}
const packageJSONPath = path.join(projectPath, 'package.json');
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, 'utf-8'));

it('Should compile with all supported TS versions', () => {
testOnNodeProject('ts');
}).timeout(40000);
it(packageJSON.description, () => {
exec(`cp -R ${projectPath} ${tmpDir}`);

it('Should work on all supported node versions', () => {
testOnNodeProject('node');
}).timeout(40000);
const cwd = path.join(tmpDir, projectName);
exec('npm --quiet install', { cwd, stdio: 'inherit' });
exec('npm --quiet test', { cwd, stdio: 'inherit' });
}).timeout(40000);
}

it('Should be compatible with Webpack', () => {
testOnNodeProject('webpack');
}).timeout(40000);
testOnNodeProject('ts');
testOnNodeProject('node');
testOnNodeProject('webpack');
});
1 change: 1 addition & 0 deletions integrationTests/node/package.json
@@ -1,5 +1,6 @@
{
"private": true,
"description": "graphql-js should work on all supported node versions",
"scripts": {
"test": "node test.js"
},
Expand Down
1 change: 1 addition & 0 deletions integrationTests/ts/package.json
@@ -1,5 +1,6 @@
{
"private": true,
"description": "graphql-js should compile with all supported TS versions",
"scripts": {
"test": "node test.js"
},
Expand Down
1 change: 1 addition & 0 deletions integrationTests/webpack/package.json
@@ -1,5 +1,6 @@
{
"private": true,
"description": "graphql-js should be compatible with Webpack",
"scripts": {
"test": "webpack && node test.js"
},
Expand Down