From 6f073fe9c4c8e8edc5237f0ffe66ac5486bc0daa Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 6 May 2022 22:12:28 +0200 Subject: [PATCH 1/2] added node helpers --- spec/.eslintrc.json | 8 +++++--- spec/helper.js | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/spec/.eslintrc.json b/spec/.eslintrc.json index 519da96484..4a4de7a8c8 100644 --- a/spec/.eslintrc.json +++ b/spec/.eslintrc.json @@ -18,10 +18,13 @@ "it_only_db": true, "it_only_mongodb_version": true, "it_only_postgres_version": true, + "it_only_node_version": true, "fit_only_mongodb_version": true, + "fit_only_node_version": true, "it_exclude_mongodb_version": true, "it_exclude_postgres_version": true, "fit_exclude_mongodb_version": true, + "fit_exclude_node_version": true, "it_exclude_dbs": true, "describe_only_db": true, "describe_only": true, @@ -31,11 +34,10 @@ "jequal": true, "create": true, "arrayContains": true, - "expectAsync": true, - "databaseAdapter": true + "databaseAdapter": true, }, "rules": { "no-console": [0], - "no-var": "error" + "no-var": "error", } } diff --git a/spec/helper.js b/spec/helper.js index 85ca7a7de4..39be89d880 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -461,6 +461,15 @@ global.it_only_postgres_version = version => { } }; +global.it_only_node_version = version => { + const envVersion = process.env.NODE_VERSION; + if (!envVersion || semver.satisfies(envVersion, version)) { + return it; + } else { + return xit; + } +}; + global.fit_only_mongodb_version = version => { const envVersion = process.env.MONGODB_VERSION; if (!envVersion || semver.satisfies(envVersion, version)) { @@ -470,6 +479,15 @@ global.fit_only_mongodb_version = version => { } }; +global.fit_only_node_version = version => { + const envVersion = process.env.NODE_VERSION; + if (!envVersion || semver.satisfies(envVersion, version)) { + return fit; + } else { + return xit; + } +}; + global.it_exclude_mongodb_version = version => { const envVersion = process.env.MONGODB_VERSION; if (!envVersion || !semver.satisfies(envVersion, version)) { @@ -488,6 +506,15 @@ global.it_exclude_postgres_version = version => { } }; +global.it_exclude_node_version = version => { + const envVersion = process.env.NODE_VERSION; + if (!envVersion || !semver.satisfies(envVersion, version)) { + return it; + } else { + return xit; + } +}; + global.fit_exclude_mongodb_version = version => { const envVersion = process.env.MONGODB_VERSION; if (!envVersion || !semver.satisfies(envVersion, version)) { @@ -497,6 +524,15 @@ global.fit_exclude_mongodb_version = version => { } }; +global.fit_exclude_node_version = version => { + const envVersion = process.env.NODE_VERSION; + if (!envVersion || !semver.satisfies(envVersion, version)) { + return fit; + } else { + return xit; + } +}; + global.fit_exclude_dbs = excluded => { if (excluded.indexOf(process.env.PARSE_SERVER_TEST_DB) >= 0) { return xit; From 74705dd964dedae937228d6162d946645d823f94 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 6 May 2022 22:18:43 +0200 Subject: [PATCH 2/2] enable tests --- spec/.eslintrc.json | 4 ++-- spec/ParseGraphQLServer.spec.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/.eslintrc.json b/spec/.eslintrc.json index 4a4de7a8c8..aa4a8fcdcb 100644 --- a/spec/.eslintrc.json +++ b/spec/.eslintrc.json @@ -34,10 +34,10 @@ "jequal": true, "create": true, "arrayContains": true, - "databaseAdapter": true, + "databaseAdapter": true }, "rules": { "no-console": [0], - "no-var": "error", + "no-var": "error" } } diff --git a/spec/ParseGraphQLServer.spec.js b/spec/ParseGraphQLServer.spec.js index e0f2fbc01a..0abe07e637 100644 --- a/spec/ParseGraphQLServer.spec.js +++ b/spec/ParseGraphQLServer.spec.js @@ -6793,7 +6793,7 @@ describe('ParseGraphQLServer', () => { describe('Files Mutations', () => { describe('Create', () => { - xit('should return File object', async () => { + it_only_node_version('<17')('should return File object', async () => { const clientMutationId = uuidv4(); parseServer = await global.reconfigureServer({ @@ -9096,7 +9096,7 @@ describe('ParseGraphQLServer', () => { expect(result6[0].node.name).toEqual('imACountry3'); }); - xit('should support files', async () => { + it_only_node_version('<17')('should support files', async () => { try { parseServer = await global.reconfigureServer({ publicServerURL: 'http://localhost:13377/parse',