From ae39c189805b639cf107f6f8ad7d42256321b1c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Tue, 8 Jan 2019 14:55:33 +0100 Subject: [PATCH 1/5] Run all backend tests I accidently left `describe.only` in the test suite. That usually runs only one block of tests instead of all tests. My fault, sorry --- src/graphql-schema.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphql-schema.test.js b/src/graphql-schema.test.js index 4956c3ab0..a58fb3599 100644 --- a/src/graphql-schema.test.js +++ b/src/graphql-schema.test.js @@ -19,7 +19,7 @@ afterEach(async () => { await app.close() }) -describe.only('login', () => { +describe('login', () => { const mutation = (params) => { const { email, password } = params return ` From 1dd852ee9f17ed4e4c6b0682788b00850696d4ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 9 Jan 2019 04:30:55 +0000 Subject: [PATCH 2/5] Bump neo4j-graphql-js from 2.1.1 to 2.2.0 Bumps [neo4j-graphql-js](https://github.com/neo4j-graphql/neo4j-graphql-js) from 2.1.1 to 2.2.0. - [Release notes](https://github.com/neo4j-graphql/neo4j-graphql-js/releases) - [Changelog](https://github.com/neo4j-graphql/neo4j-graphql-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/neo4j-graphql/neo4j-graphql-js/commits) Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5636e1283..12df68317 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "lodash": "~4.17.11", "ms": "~2.1.1", "neo4j-driver": "~1.7.2", - "neo4j-graphql-js": "~2.1.1", + "neo4j-graphql-js": "~2.2.0", "node-fetch": "~2.3.0", "npm-run-all": "~4.1.5", "passport": "~0.4.0", diff --git a/yarn.lock b/yarn.lock index 1d861e0e6..ee9b4a0df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5393,10 +5393,10 @@ neo4j-driver@^1.7.2, neo4j-driver@~1.7.2: text-encoding "^0.6.4" uri-js "^4.2.1" -neo4j-graphql-js@~2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/neo4j-graphql-js/-/neo4j-graphql-js-2.1.1.tgz#bdb1af2fb45d1058492852ed9307586f6deab37d" - integrity sha512-OcDaFIfOKZF02jmxnWWTLQr64mu79RGAtDULfciwElW59GjRF425M2Yf4gLJuQFscnh7d+Qk/+Ng+jVbz+V4lA== +neo4j-graphql-js@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/neo4j-graphql-js/-/neo4j-graphql-js-2.2.0.tgz#f0d934b376e9476ef2aa1600e86eb1f8a74c10a2" + integrity sha512-DyYRE6wAVPKxDAHkRwiZmNYx+Vv3KVFQp2Ul1Ay4f2ahW52mWzwMFe/Rlbau3phFYSZZAeaRCT7XLBy++sg/cQ== dependencies: graphql "^14.0.2" lodash "^4.17.11" From 2571d82447acd2747e890119af38eb7bc81a705b Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Wed, 9 Jan 2019 13:12:37 +0100 Subject: [PATCH 3/5] Disabled cypther logs and added DEBUG env var --- src/graphql-schema.js | 2 +- src/seed/data/index.js | 2 +- src/server.js | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/graphql-schema.js b/src/graphql-schema.js index 9cee7ad51..33fc8b4c1 100644 --- a/src/graphql-schema.js +++ b/src/graphql-schema.js @@ -102,7 +102,7 @@ export const resolvers = { .then(async (result) => { session.close() const [currentUser] = await result.records.map(function (record) { - console.log(record.get('user')) + // console.log(record.get('user')) return record.get('user') }) if (currentUser && await bcrypt.compareSync(password, currentUser.password)) { diff --git a/src/seed/data/index.js b/src/seed/data/index.js index e66342fe3..e50fececc 100644 --- a/src/seed/data/index.js +++ b/src/seed/data/index.js @@ -36,5 +36,5 @@ export default async function (client) { } }) /* eslint-disable-next-line no-console */ - console.log('Seeded Data', data) + console.log('Seeded Data...') } diff --git a/src/server.js b/src/server.js index 3b0e0a561..9a27aeb35 100644 --- a/src/server.js +++ b/src/server.js @@ -21,6 +21,7 @@ let schema = makeExecutableSchema({ }) const driver = neo4j().getDriver() +const debug = process.env.NODE_ENV !== 'production' && process.env.DEBUG === 'true' schema = augmentSchema(schema, { query: { @@ -28,7 +29,8 @@ schema = augmentSchema(schema, { }, mutation: { exclude: ['Statistics', 'LoggedInUser'] - } + }, + debug: debug }) schema = applyScalars(applyDirectives(schema)) @@ -50,7 +52,7 @@ const createServer = (options) => { return payload }, schema: schema, - tracing: true, + tracing: debug, middlewares: middleware(schema), mocks: (process.env.MOCK === 'true') ? mocks : false } From 86c7b9338653fb7afcfd68ef172084ccf03f6641 Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Wed, 9 Jan 2019 13:14:18 +0100 Subject: [PATCH 4/5] Removed unneeded log --- src/graphql-schema.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/graphql-schema.js b/src/graphql-schema.js index 33fc8b4c1..95a62cb99 100644 --- a/src/graphql-schema.js +++ b/src/graphql-schema.js @@ -102,7 +102,6 @@ export const resolvers = { .then(async (result) => { session.close() const [currentUser] = await result.records.map(function (record) { - // console.log(record.get('user')) return record.get('user') }) if (currentUser && await bcrypt.compareSync(password, currentUser.password)) { From 13666df3e2dad48da03e4c1928303b2c063a799e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Wed, 9 Jan 2019 13:48:44 +0100 Subject: [PATCH 5/5] Don't run tests in /dist folder If you ran `yarn run build` followed by `yarn run test:jest` it was running the tests twice, because it matched the `/dist` folder to. --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 12df68317..9d83da85b 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,10 @@ }, "author": "Human Connection gGmbH", "license": "MIT", + "jest": { + "verbose": true, + "testMatch": ["**/src/**/?(*.)+(spec|test).js?(x)" ] + }, "dependencies": { "apollo-cache-inmemory": "~1.3.11", "apollo-client": "~2.4.8",