Skip to content

Commit 802ca72

Browse files
committed
fix
1 parent 786f52e commit 802ca72

File tree

4 files changed

+17
-53
lines changed

4 files changed

+17
-53
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,7 @@ If your pull request introduces a change that may affect the storage or retrieva
263263
* If your feature is intended to work with MongoDB and PostgreSQL, you can include or exclude tests more granularly with:
264264

265265
- `it_only_mongodb_version('>=4.4')` // will test with any version of Postgres but only with version >=4.4 of MongoDB; accepts semver notation to specify a version range
266-
- `it_exclude_mongodb_version('<4.4')` // will test with any version of Postgres and MongoDB, excluding version <4.4 of MongoDB; accepts semver notation to specify a version range
267266
- `it_only_postgres_version('>=13')` // will test with any version of Mongo but only with version >=13 of Postgres; accepts semver notation to specify a version range
268-
- `it_exclude_postgres_version('<13')` // will test with any version of Postgres and MongoDB, excluding version <13 of Postgres; accepts semver notation to specify a version range
269267

270268
#### Postgres with Docker
271269

spec/.eslintrc.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
"it_only_node_version": true,
2424
"fit_only_mongodb_version": true,
2525
"fit_only_node_version": true,
26-
"it_exclude_mongodb_version": true,
27-
"it_exclude_postgres_version": true,
28-
"fit_exclude_mongodb_version": true,
29-
"fit_exclude_node_version": true,
3026
"it_exclude_dbs": true,
3127
"fit_exclude_dbs": true,
3228
"describe_only_db": true,

spec/ParseQuery.hint.spec.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const masterKeyOptions = {
1818
json: true,
1919
};
2020

21-
fdescribe_only_db('mongo')('Parse.Query hint', () => {
21+
describe_only_db('mongo')('Parse.Query hint', () => {
2222
beforeEach(() => {
2323
config = Config.get('test');
2424
});
@@ -27,12 +27,6 @@ fdescribe_only_db('mongo')('Parse.Query hint', () => {
2727
await TestUtils.destroyAllDataPermanently(false);
2828
});
2929

30-
fit_only_mongodb_version('<5.1>=6')('debug', async () => {
31-
});
32-
33-
fit_only_mongodb_version('>5.1<6')('debug', async () => {
34-
});
35-
3630
it_only_mongodb_version('<5.1 || >=6')('query find with hint string', async () => {
3731
const object = new TestObject();
3832
await object.save();

spec/helper.js

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,9 @@ global.it_only_mongodb_version = version => {
505505
};
506506

507507
global.it_only_postgres_version = version => {
508+
if (!semver.validRange(version)) {
509+
throw new Error('Invalid version range');
510+
}
508511
const envVersion = process.env.POSTGRES_VERSION;
509512
if (!envVersion || semver.satisfies(envVersion, version)) {
510513
return it;
@@ -514,6 +517,9 @@ global.it_only_postgres_version = version => {
514517
};
515518

516519
global.it_only_node_version = version => {
520+
if (!semver.validRange(version)) {
521+
throw new Error('Invalid version range');
522+
}
517523
const envVersion = process.version;
518524
if (!envVersion || semver.satisfies(envVersion, version)) {
519525
return it;
@@ -534,54 +540,24 @@ global.fit_only_mongodb_version = version => {
534540
}
535541
};
536542

537-
global.fit_only_node_version = version => {
538-
const envVersion = process.version;
539-
if (!envVersion || semver.satisfies(envVersion, version)) {
540-
return fit;
541-
} else {
542-
return xit;
543-
}
544-
};
545-
546-
global.it_exclude_mongodb_version = version => {
547-
const envVersion = process.env.MONGODB_VERSION;
548-
if (!envVersion || !semver.satisfies(envVersion, version)) {
549-
return it;
550-
} else {
551-
return xit;
543+
global.fit_only_postgres_version = version => {
544+
if (!semver.validRange(version)) {
545+
throw new Error('Invalid version range');
552546
}
553-
};
554-
555-
global.it_exclude_postgres_version = version => {
556547
const envVersion = process.env.POSTGRES_VERSION;
557-
if (!envVersion || !semver.satisfies(envVersion, version)) {
558-
return it;
559-
} else {
560-
return xit;
561-
}
562-
};
563-
564-
global.it_exclude_node_version = version => {
565-
const envVersion = process.env.NODE_VERSION;
566-
if (!envVersion || !semver.satisfies(envVersion, version)) {
567-
return it;
568-
} else {
569-
return xit;
570-
}
571-
};
572-
573-
global.fit_exclude_mongodb_version = version => {
574-
const envVersion = process.env.MONGODB_VERSION;
575-
if (!envVersion || !semver.satisfies(envVersion, version)) {
548+
if (!envVersion || semver.satisfies(envVersion, version)) {
576549
return fit;
577550
} else {
578551
return xit;
579552
}
580553
};
581554

582-
global.fit_exclude_node_version = version => {
583-
const envVersion = process.env.NODE_VERSION;
584-
if (!envVersion || !semver.satisfies(envVersion, version)) {
555+
global.fit_only_node_version = version => {
556+
if (!semver.validRange(version)) {
557+
throw new Error('Invalid version range');
558+
}
559+
const envVersion = process.version;
560+
if (!envVersion || semver.satisfies(envVersion, version)) {
585561
return fit;
586562
} else {
587563
return xit;

0 commit comments

Comments
 (0)