Skip to content

Commit 80dd0e1

Browse files
authored
build: Run yarn-deduplicate (#5951)
Use https://github.com/atlassian/yarn-deduplicate to make sure we dedupe deps properly. This should help speed up CI times since we don't have to cache as much stuff.
1 parent ab7c2f8 commit 80dd0e1

File tree

5 files changed

+234
-2382
lines changed

5 files changed

+234
-2382
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"sinon": "^7.3.2",
9999
"size-limit": "^4.5.5",
100100
"ts-jest": "^27.1.4",
101-
"ts-node": "^10.7.0",
101+
"ts-node": "10.9.1",
102102
"tslib": "^2.3.1",
103103
"typedoc": "^0.18.0",
104104
"typescript": "3.8.3"

packages/e2e-tests/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"devDependencies": {
2222
"@types/glob": "8.0.0",
23+
"@types/node": "^14.6.4",
2324
"glob": "8.0.3",
2425
"ts-node": "10.9.1",
2526
"typescript": "3.8.3",

packages/gatsby/test/sdk.test.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
import { init as reactInitRaw, SDK_VERSION } from '@sentry/react';
1+
import { init, SDK_VERSION } from '@sentry/react';
22
import { Integrations } from '@sentry/tracing';
33
import { Integration } from '@sentry/types';
44

55
import { init as gatsbyInit } from '../src/sdk';
66
import { UserIntegrations } from '../src/utils/integrations';
77
import { GatsbyOptions } from '../src/utils/types';
88

9-
const reactInit = reactInitRaw as jest.Mock;
10-
jest.mock('@sentry/react');
9+
jest.mock('@sentry/react', () => {
10+
const actual = jest.requireActual('@sentry/react');
11+
return {
12+
...actual,
13+
init: jest.fn().mockImplementation(actual.init),
14+
};
15+
});
16+
17+
const reactInit = init as jest.Mock;
1118

1219
describe('Initialize React SDK', () => {
1320
afterEach(() => reactInit.mockReset());

packages/svelte/test/sdk.test.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
import { addGlobalEventProcessor, init as browserInitRaw, SDK_VERSION } from '@sentry/browser';
1+
import { addGlobalEventProcessor, init as browserInit, SDK_VERSION } from '@sentry/browser';
22
import { EventProcessor } from '@sentry/types';
33

44
import { detectAndReportSvelteKit, init as svelteInit, isSvelteKitApp } from '../src/sdk';
55

6-
const browserInit = browserInitRaw as jest.Mock;
7-
const addGlobalEventProcessorFunction = addGlobalEventProcessor as jest.Mock;
86
let passedEventProcessor: EventProcessor | undefined;
9-
addGlobalEventProcessorFunction.mockImplementation(proc => {
10-
passedEventProcessor = proc;
11-
});
127

13-
jest.mock('@sentry/browser');
8+
jest.mock('@sentry/browser', () => {
9+
const actual = jest.requireActual('@sentry/browser');
10+
return {
11+
...actual,
12+
init: jest.fn().mockImplementation(actual.init),
13+
addGlobalEventProcessor: jest.fn().mockImplementation(proc => {
14+
passedEventProcessor = proc;
15+
}),
16+
};
17+
});
1418

1519
describe('Initialize Svelte SDk', () => {
1620
afterAll(() => {
@@ -48,7 +52,7 @@ describe('detectAndReportSvelteKit()', () => {
4852
it('registers a global event processor', async () => {
4953
detectAndReportSvelteKit();
5054

51-
expect(addGlobalEventProcessorFunction).toHaveBeenCalledTimes(1);
55+
expect(addGlobalEventProcessor).toHaveBeenCalledTimes(1);
5256
expect(passedEventProcessor?.id).toEqual('svelteKitProcessor');
5357
});
5458

0 commit comments

Comments
 (0)