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

Commit

Permalink
test: fix failing tests and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dalelotts committed Dec 1, 2021
1 parent f4414b4 commit 494d877
Show file tree
Hide file tree
Showing 24 changed files with 8,240 additions and 6,970 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ plugins:
- node
- istanbul
- import
- mocha
extends:
- 'plugin:mocha/recommended'
settings:
node:
tryExtensions: ['.js', '.json', '.node', '.ts', '.d.ts']

rules:
mocha/no-mocha-arrows: off

##############################################################################
# Internal rules located in 'resources/eslint-internal-rules'.
# See './resources/eslint-internal-rules/README.md'
Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/aws.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/express-graphql.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const rootValue = {
const app = express();
app.use(
'/graphql',
// eslint-disable-next-line @typescript-eslint/no-misused-promises
graphqlHTTP({
schema,
rootValue,
Expand Down
1 change: 1 addition & 0 deletions examples/index_subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const subscriptionEndpoint = `ws://localhost:${PORT}/subscriptions`;
const app = express();
app.use(
'/graphql',
// eslint-disable-next-line @typescript-eslint/no-misused-promises
graphqlHTTP({
schema,
rootValue,
Expand Down
1 change: 1 addition & 0 deletions examples/index_subscription_legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const subscriptionEndpoint = `ws://localhost:${PORT}/subscriptions`;
const app = express();
app.use(
'/graphql',
// eslint-disable-next-line @typescript-eslint/no-misused-promises
graphqlHTTP({
schema,
rootValue,
Expand Down
26 changes: 16 additions & 10 deletions integrationTests/integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@ function exec(command, options = {}) {
}

describe('Integration Tests', () => {
const tmpDir = path.join(os.tmpdir(), 'express-graphql-integrationTmp');
fs.rmdirSync(tmpDir, { recursive: true, force: true });
fs.mkdirSync(tmpDir);

const distDir = path.resolve('./npmDist');
const archiveName = exec(`npm --quiet pack ${distDir}`, { cwd: tmpDir });
fs.renameSync(
path.join(tmpDir, archiveName),
path.join(tmpDir, 'express-graphql.tgz'),
);
let tmpDir;

before(() => {
tmpDir = path.join(os.tmpdir(), 'express-graphql-integrationTmp');
fs.mkdirSync(tmpDir, { recursive: true });
fs.rmSync(tmpDir, { recursive: true, force: true });
fs.mkdirSync(tmpDir, { recursive: true });

const distDir = path.resolve('./npmDist');
const archiveName = exec(`npm --quiet pack ${distDir}`, { cwd: tmpDir });

fs.renameSync(
path.join(tmpDir, archiveName),
path.join(tmpDir, 'express-graphql.tgz'),
);
});

function testOnNodeProject(projectName) {
exec(`cp -R ${path.join(__dirname, projectName)} ${tmpDir}`);
Expand Down
7 changes: 4 additions & 3 deletions integrationTests/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
},
"dependencies": {
"express-graphql": "file:../express-graphql.tgz",
"graphql": "14.7.0",
"node-10": "npm:[email protected]",
"graphql": "16.0.1",
"node-12": "npm:[email protected]",
"node-14": "npm:[email protected]",
"node-15": "npm:[email protected]"
"node-15": "npm:[email protected]",
"node-16": "npm:[email protected]",
"node-17": "npm:[email protected]"
}
}
1 change: 1 addition & 0 deletions integrationTests/node/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const path = require('path');
const childProcess = require('child_process');

// eslint-disable-next-line import/extensions
const { dependencies } = require('./package.json');

const nodeVersions = Object.keys(dependencies)
Expand Down
17 changes: 7 additions & 10 deletions integrationTests/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
"test": "node test.js"
},
"dependencies": {
"@types/node": "14.0.13",
"@types/node": "16.11.11",
"express-graphql": "file:../express-graphql.tgz",
"graphql": "14.7.0",
"typescript-3.4": "npm:[email protected]",
"typescript-3.5": "npm:[email protected]",
"typescript-3.6": "npm:[email protected]",
"typescript-3.7": "npm:[email protected]",
"typescript-3.8": "npm:[email protected]",
"typescript-3.9": "npm:[email protected]",
"typescript-4.0": "npm:[email protected]",
"typescript-4.1": "npm:[email protected]"
"graphql": "16.0.1",
"typescript-4.1": "npm:[email protected]",
"typescript-4.2": "npm:[email protected]",
"typescript-4.3": "npm:[email protected]",
"typescript-4.4": "npm:[email protected]",
"typescript-4.5": "npm:[email protected]"
}
}
2 changes: 2 additions & 0 deletions integrationTests/ts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const path = require('path');
const childProcess = require('child_process');

// eslint-disable-next-line import/extensions
const { dependencies } = require('./package.json');

const tsVersions = Object.keys(dependencies)
Expand All @@ -13,5 +14,6 @@ for (const version of tsVersions) {
console.log(`Testing on ${version} ...`);

const tscPath = path.join(__dirname, 'node_modules', version, 'bin/tsc');
console.log('tscPath', tscPath);
childProcess.execSync(tscPath, { stdio: 'inherit' });
}
Loading

0 comments on commit 494d877

Please sign in to comment.