Skip to content

Commit fadb138

Browse files
committed
fix: Tests
1 parent 293400e commit fadb138

File tree

6 files changed

+35
-105
lines changed

6 files changed

+35
-105
lines changed

packages/core/test/lib/base.test.ts

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
import { Hub, Scope } from '@sentry/hub';
22
import { Event } from '@sentry/types';
3-
import { SentryError } from '@sentry/utils/error';
3+
import { SentryError } from '@sentry/utils';
44

55
import { TestBackend } from '../mocks/backend';
66
import { TestClient } from '../mocks/client';
77
import { TestIntegration } from '../mocks/integration';
88

99
const PUBLIC_DSN = 'https://username@domain/path';
1010

11-
jest.mock('@sentry/utils/misc', () => ({
12-
uuid4(): string {
13-
return '42';
14-
},
15-
getGlobalObject(): object {
16-
return {
17-
console: {
18-
log(): void {
19-
// no-empty
11+
jest.mock('@sentry/utils', () => {
12+
const original = require.requireActual('@sentry/utils');
13+
return {
14+
...original,
15+
16+
uuid4(): string {
17+
return '42';
18+
},
19+
getGlobalObject(): object {
20+
return {
21+
console: {
22+
log(): void {
23+
// no-empty
24+
},
25+
warn(): void {
26+
// no-empty
27+
},
28+
error(): void {
29+
// no-empty
30+
},
2031
},
21-
warn(): void {
22-
// no-empty
23-
},
24-
error(): void {
25-
// no-empty
26-
},
27-
},
28-
};
29-
},
30-
consoleSandbox(cb: () => any): any {
31-
return cb();
32-
},
33-
}));
34-
35-
jest.mock('@sentry/utils/string', () => ({
36-
truncate(str: string): string {
37-
return str;
38-
},
39-
}));
32+
};
33+
},
34+
consoleSandbox(cb: () => any): any {
35+
return cb();
36+
},
37+
truncate(str: string): string {
38+
return str;
39+
},
40+
};
41+
});
4042

4143
describe('BaseClient', () => {
4244
beforeEach(() => {

packages/core/test/lib/dsn.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SentryError } from '@sentry/utils/error';
1+
import { SentryError } from '@sentry/utils';
22

33
import { Dsn } from '../../src/dsn';
44

packages/core/test/mocks/backend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Event, Options } from '@sentry/types';
2-
import { SyncPromise } from '@sentry/utils/syncpromise';
2+
import { SyncPromise } from '@sentry/utils';
33

44
import { BaseBackend } from '../../src/basebackend';
55

packages/node/test/transports/http.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { TransportOptions } from '@sentry/types';
2-
import { SentryError } from '@sentry/utils/error';
2+
import { SentryError } from '@sentry/utils';
33
import * as HttpsProxyAgent from 'https-proxy-agent';
44

55
import { HTTPTransport } from '../../src/transports/http';

packages/node/test/transports/https.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { TransportOptions } from '@sentry/types';
2-
import { SentryError } from '@sentry/utils/error';
2+
import { SentryError } from '@sentry/utils';
33
import * as HttpsProxyAgent from 'https-proxy-agent';
44

55
import { HTTPSTransport } from '../../src/transports/https';

packages/utils/test/store.test.ts

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)