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

test: enable GraphQL file upload tests #7980

Merged
merged 2 commits into from
May 6, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion spec/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -31,7 +34,6 @@
"jequal": true,
"create": true,
"arrayContains": true,
"expectAsync": true,
mtrezza marked this conversation as resolved.
Show resolved Hide resolved
"databaseAdapter": true
},
"rules": {
Expand Down
4 changes: 2 additions & 2 deletions spec/ParseGraphQLServer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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',
Expand Down
36 changes: 36 additions & 0 deletions spec/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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)) {
Expand All @@ -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)) {
Expand All @@ -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;
Expand Down