Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit cae1000

Browse files
author
Michal Vlasák
committed
🔥 Remove version info from Sentry test snapshot
1 parent ee76e59 commit cae1000

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/tests/sentry-mocked.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import omit = require('omit-deep');
12
import { levels } from '../levels';
23

34
let loggerFactory;
45
const scope: any = {};
5-
const withScope = jest.fn(fn =>
6+
const withScope = jest.fn((fn) =>
67
fn({
78
setContext: (key: string, val: any) => {
89
scope.context = { [key]: val };
@@ -16,7 +17,7 @@ const withScope = jest.fn(fn =>
1617
})
1718
);
1819

19-
const createCapture = (cb = () => {}) => data => {
20+
const createCapture = (cb = () => {}) => (data) => {
2021
cb();
2122
return { data, scope };
2223
};
@@ -86,12 +87,12 @@ describe('sentry mocked', () => {
8687
"fatal",
8788
]
8889
`);
89-
expect(captureMessage.mock.results[0].value).toMatchInlineSnapshot(`
90+
expect(captureMessage.mock.results[0].value.scope.extras['cosmas.pkgVersion']).toBeDefined();
91+
expect(omit(captureMessage.mock.results[0].value, 'cosmas.pkgVersion')).toMatchInlineSnapshot(`
9092
Object {
9193
"data": "fatal",
9294
"scope": Object {
9395
"extras": Object {
94-
"cosmas.pkgVersion": "2.0.0-rc.2",
9596
"level": 60,
9697
"message": "fatal",
9798
"severity": "CRITICAL",

0 commit comments

Comments
 (0)