Skip to content

Commit 705855c

Browse files
authored
refactor: Bump jasmine from 5.7.1 to 6.1.0 (#10338)
1 parent faec923 commit 705855c

File tree

7 files changed

+62
-51
lines changed

7 files changed

+62
-51
lines changed

package-lock.json

Lines changed: 32 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"form-data": "4.0.5",
9191
"globals": "17.3.0",
9292
"graphql-tag": "2.12.6",
93-
"jasmine": "5.7.1",
93+
"jasmine": "6.1.0",
9494
"jasmine-spec-reporter": "7.0.0",
9595
"jsdoc": "4.0.4",
9696
"jsdoc-babel": "0.5.0",

spec/InstallationsRouter.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ describe('InstallationsRouter', () => {
166166
});
167167
});
168168

169-
it_only_db('postgres')('query installations with count = 1', async () => {
169+
it_only_db('postgres')('query installations with count = 1 postgres', async () => {
170170
const config = Config.get('test');
171171
const androidDeviceRequest = {
172172
installationId: '12345678-abcd-abcd-abcd-123456789abc',

spec/ParsePolygon.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ describe('Parse.Polygon testing', () => {
423423
});
424424
});
425425

426-
describe_only_db('mongo')('Parse.Polygon testing', () => {
426+
describe_only_db('mongo')('Parse.Polygon testing mongo', () => {
427427
const Config = require('../lib/Config');
428428
let config;
429429
beforeEach(async () => {

spec/ParseQuery.Aggregate.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ describe('Parse.Query Aggregate testing', () => {
474474
});
475475

476476
it_only_db('postgres')(
477-
'can group by any date field (it does not work if you have dirty data)', // rows in your collection with non date data in the field that is supposed to be a date
477+
'can group by any date field postgres (it does not work if you have dirty data)', // rows in your collection with non date data in the field that is supposed to be a date
478478
done => {
479479
const obj1 = new TestObject({ dateField2019: new Date(1990, 11, 1) });
480480
const obj2 = new TestObject({ dateField2019: new Date(1990, 5, 1) });

spec/ParseQuery.hint.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe_only_db('mongo')('Parse.Query hint', () => {
3939
expect(explain.queryPlanner.winningPlan.inputStage.indexName).toBe('_id_');
4040
});
4141

42-
it_only_mongodb_version('>=8')('query find with hint string', async () => {
42+
it_only_mongodb_version('>=8')('query find with hint string mongodb 8', async () => {
4343
const object = new TestObject();
4444
await object.save();
4545

@@ -65,7 +65,7 @@ describe_only_db('mongo')('Parse.Query hint', () => {
6565
});
6666
});
6767

68-
it_only_mongodb_version('>=8')('query find with hint object', async () => {
68+
it_only_mongodb_version('>=8')('query find with hint object mongodb 8', async () => {
6969
const object = new TestObject();
7070
await object.save();
7171

spec/support/CurrentSpecReporter.js

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -70,35 +70,31 @@ global.normalizeAsyncTests = function() {
7070
return fn;
7171
}
7272

73-
// Wrap it() specs
74-
const originalSpecConstructor = jasmine.Spec;
75-
jasmine.Spec = function(attrs) {
76-
const spec = new originalSpecConstructor(attrs);
77-
spec.queueableFn.fn = wrapDoneCallback(spec.queueableFn.fn);
78-
return spec;
79-
};
73+
function wrapGlobal(name) {
74+
const original = global[name];
75+
global[name] = function(descriptionOrFn, fn, timeout) {
76+
const args = Array.from(arguments);
77+
if (typeof descriptionOrFn === 'function') {
78+
args[0] = wrapDoneCallback(descriptionOrFn);
79+
return original.apply(this, args);
80+
}
81+
if (typeof fn === 'function') {
82+
args[1] = wrapDoneCallback(fn);
83+
return original.apply(this, args);
84+
}
85+
return original.apply(this, args);
86+
};
87+
if (original.each) {
88+
global[name].each = original.each;
89+
}
90+
}
8091

81-
// Wrap beforeEach/afterEach/beforeAll/afterAll
82-
const originalBeforeEach = jasmine.Suite.prototype.beforeEach;
83-
jasmine.Suite.prototype.beforeEach = function(fn) {
84-
fn.fn = wrapDoneCallback(fn.fn);
85-
return originalBeforeEach.call(this, fn);
86-
};
87-
const originalAfterEach = jasmine.Suite.prototype.afterEach;
88-
jasmine.Suite.prototype.afterEach = function(fn) {
89-
fn.fn = wrapDoneCallback(fn.fn);
90-
return originalAfterEach.call(this, fn);
91-
};
92-
const originalBeforeAll = jasmine.Suite.prototype.beforeAll;
93-
jasmine.Suite.prototype.beforeAll = function(fn) {
94-
fn.fn = wrapDoneCallback(fn.fn);
95-
return originalBeforeAll.call(this, fn);
96-
};
97-
const originalAfterAll = jasmine.Suite.prototype.afterAll;
98-
jasmine.Suite.prototype.afterAll = function(fn) {
99-
fn.fn = wrapDoneCallback(fn.fn);
100-
return originalAfterAll.call(this, fn);
101-
};
92+
wrapGlobal('it');
93+
wrapGlobal('fit');
94+
wrapGlobal('beforeEach');
95+
wrapGlobal('afterEach');
96+
wrapGlobal('beforeAll');
97+
wrapGlobal('afterAll');
10298
};
10399

104100
module.exports = CurrentSpecReporter;

0 commit comments

Comments
 (0)