Skip to content

Commit d691591

Browse files
authored
test: enable GraphQL file upload tests (#7980)
1 parent 2eb5603 commit d691591

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

spec/.eslintrc.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
"it_only_db": true,
1919
"it_only_mongodb_version": true,
2020
"it_only_postgres_version": true,
21+
"it_only_node_version": true,
2122
"fit_only_mongodb_version": true,
23+
"fit_only_node_version": true,
2224
"it_exclude_mongodb_version": true,
2325
"it_exclude_postgres_version": true,
2426
"fit_exclude_mongodb_version": true,
27+
"fit_exclude_node_version": true,
2528
"it_exclude_dbs": true,
2629
"describe_only_db": true,
2730
"describe_only": true,
@@ -31,7 +34,6 @@
3134
"jequal": true,
3235
"create": true,
3336
"arrayContains": true,
34-
"expectAsync": true,
3537
"databaseAdapter": true
3638
},
3739
"rules": {

spec/ParseGraphQLServer.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6793,7 +6793,7 @@ describe('ParseGraphQLServer', () => {
67936793

67946794
describe('Files Mutations', () => {
67956795
describe('Create', () => {
6796-
xit('should return File object', async () => {
6796+
it_only_node_version('<17')('should return File object', async () => {
67976797
const clientMutationId = uuidv4();
67986798

67996799
parseServer = await global.reconfigureServer({
@@ -9096,7 +9096,7 @@ describe('ParseGraphQLServer', () => {
90969096
expect(result6[0].node.name).toEqual('imACountry3');
90979097
});
90989098

9099-
xit('should support files', async () => {
9099+
it_only_node_version('<17')('should support files', async () => {
91009100
try {
91019101
parseServer = await global.reconfigureServer({
91029102
publicServerURL: 'http://localhost:13377/parse',

spec/helper.js

+36
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,15 @@ global.it_only_postgres_version = version => {
461461
}
462462
};
463463

464+
global.it_only_node_version = version => {
465+
const envVersion = process.env.NODE_VERSION;
466+
if (!envVersion || semver.satisfies(envVersion, version)) {
467+
return it;
468+
} else {
469+
return xit;
470+
}
471+
};
472+
464473
global.fit_only_mongodb_version = version => {
465474
const envVersion = process.env.MONGODB_VERSION;
466475
if (!envVersion || semver.satisfies(envVersion, version)) {
@@ -470,6 +479,15 @@ global.fit_only_mongodb_version = version => {
470479
}
471480
};
472481

482+
global.fit_only_node_version = version => {
483+
const envVersion = process.env.NODE_VERSION;
484+
if (!envVersion || semver.satisfies(envVersion, version)) {
485+
return fit;
486+
} else {
487+
return xit;
488+
}
489+
};
490+
473491
global.it_exclude_mongodb_version = version => {
474492
const envVersion = process.env.MONGODB_VERSION;
475493
if (!envVersion || !semver.satisfies(envVersion, version)) {
@@ -488,6 +506,15 @@ global.it_exclude_postgres_version = version => {
488506
}
489507
};
490508

509+
global.it_exclude_node_version = version => {
510+
const envVersion = process.env.NODE_VERSION;
511+
if (!envVersion || !semver.satisfies(envVersion, version)) {
512+
return it;
513+
} else {
514+
return xit;
515+
}
516+
};
517+
491518
global.fit_exclude_mongodb_version = version => {
492519
const envVersion = process.env.MONGODB_VERSION;
493520
if (!envVersion || !semver.satisfies(envVersion, version)) {
@@ -497,6 +524,15 @@ global.fit_exclude_mongodb_version = version => {
497524
}
498525
};
499526

527+
global.fit_exclude_node_version = version => {
528+
const envVersion = process.env.NODE_VERSION;
529+
if (!envVersion || !semver.satisfies(envVersion, version)) {
530+
return fit;
531+
} else {
532+
return xit;
533+
}
534+
};
535+
500536
global.fit_exclude_dbs = excluded => {
501537
if (excluded.indexOf(process.env.PARSE_SERVER_TEST_DB) >= 0) {
502538
return xit;

0 commit comments

Comments
 (0)