You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-09 10:22:46 +03:00
Replace usages of global
with globalThis
(#4489)
* Update src with globalThis * Update spec with globalThis * Replace in more spec/ places * More changes to src/ * Add a linter rule for global * Prettify * lint
This commit is contained in:
@@ -794,7 +794,7 @@ describe("SyncAccumulator", function () {
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
jest.spyOn(global.Date, "now").mockRestore();
|
||||
jest.spyOn(globalThis.Date, "now").mockRestore();
|
||||
});
|
||||
|
||||
it("should copy summary properties", function () {
|
||||
@@ -851,11 +851,11 @@ describe("SyncAccumulator", function () {
|
||||
const delta = 1000;
|
||||
const startingTs = 1000;
|
||||
|
||||
jest.spyOn(global.Date, "now").mockReturnValue(startingTs);
|
||||
jest.spyOn(globalThis.Date, "now").mockReturnValue(startingTs);
|
||||
|
||||
sa.accumulate(RES_WITH_AGE);
|
||||
|
||||
jest.spyOn(global.Date, "now").mockReturnValue(startingTs + delta);
|
||||
jest.spyOn(globalThis.Date, "now").mockReturnValue(startingTs + delta);
|
||||
|
||||
const output = sa.getJSON();
|
||||
expect(output.roomsData.join["!foo:bar"].timeline.events[0].unsigned?.age).toEqual(
|
||||
|
Reference in New Issue
Block a user