Skip to content

Commit 0267d38

Browse files
committed
Merge remote-tracking branch 'origin/master' into feat/ember-add-render-and-initial-load
2 parents f041b3c + daae471 commit 0267d38

File tree

10 files changed

+444
-13
lines changed

10 files changed

+444
-13
lines changed

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ module.exports = [
2121
name: '@sentry/browser + @sentry/tracing - CDN Bundle (gzipped)',
2222
path: 'packages/tracing/build/bundle.tracing.min.js',
2323
gzip: true,
24-
limit: '23 KB',
24+
limit: '25 KB',
2525
},
2626
];

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ Besides the high-level SDKs, this repository contains shared packages, helpers a
8282
development. If you're thinking about contributing to or creating a JavaScript-based SDK, have a look at the resources
8383
below:
8484

85-
- [`@sentry/apm`](https://github.com/getsentry/sentry-javascript/tree/master/packages/apm): Provides Integrations and
86-
extensions for APM
85+
- [`@sentry/tracing`](https://github.com/getsentry/sentry-javascript/tree/master/packages/tracing): Provides Integrations and
86+
extensions for Perfromance Monitoring / Tracing
8787
- [`@sentry/hub`](https://github.com/getsentry/sentry-javascript/tree/master/packages/hub): Global state management of
8888
SDKs
8989
- [`@sentry/minimal`](https://github.com/getsentry/sentry-javascript/tree/master/packages/minimal): Minimal SDK for

packages/integrations/src/vue.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ export class Vue implements Integration {
151151
/**
152152
* @inheritDoc
153153
*/
154-
public constructor(options: Partial<IntegrationOptions>) {
154+
public constructor(
155+
options: Partial<Omit<IntegrationOptions, 'tracingOptions'> & { tracingOptions: Partial<TracingOptions> }>,
156+
) {
155157
this._options = {
156158
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
157159
Vue: getGlobalObject<any>().Vue,
@@ -313,7 +315,7 @@ export class Vue implements Integration {
313315
}
314316
};
315317

316-
// Each compomnent has it's own scope, so all activities are only related to one of them
318+
// Each component has it's own scope, so all activities are only related to one of them
317319
this._options.tracingOptions.hooks.forEach(operation => {
318320
// Retrieve corresponding hooks from Vue lifecycle.
319321
// eg. mount => ['beforeMount', 'mounted']

packages/serverless/.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ module.exports = {
1616
project: './tsconfig.json',
1717
},
1818
},
19+
{
20+
files: ['test/**'],
21+
rules: {
22+
'no-empty': 'off',
23+
'@typescript-eslint/no-empty-function': 'off',
24+
'@typescript-eslint/no-explicit-any': 'off',
25+
'@typescript-eslint/no-non-null-assertion': 'off',
26+
},
27+
},
1928
],
2029
rules: {
2130
'@typescript-eslint/no-var-requires': 'off',

packages/serverless/package.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
"@sentry/node": "5.23.0",
2121
"@sentry/types": "5.23.0",
2222
"@sentry/utils": "5.23.0",
23-
"@types/aws-lambda": "^8.10.62",
24-
"@types/node": "^14.6.4",
2523
"tslib": "^1.9.3"
2624
},
2725
"devDependencies": {
2826
"@sentry-internal/eslint-config-sdk": "5.23.0",
27+
"@types/aws-lambda": "^8.10.62",
28+
"@types/node": "^14.6.4",
2929
"eslint": "7.6.0",
30+
"jest": "^24.7.1",
3031
"npm-run-all": "^4.1.2",
3132
"prettier": "1.19.0",
3233
"rimraf": "^2.6.3",
@@ -51,5 +52,25 @@
5152
"test:watch": "jest --watch --passWithNoTests",
5253
"pack": "npm pack"
5354
},
54-
"sideEffects": false
55+
"sideEffects": false,
56+
"jest": {
57+
"collectCoverage": true,
58+
"transform": {
59+
"^.+\\.ts$": "ts-jest"
60+
},
61+
"moduleFileExtensions": [
62+
"js",
63+
"ts"
64+
],
65+
"testEnvironment": "node",
66+
"testMatch": [
67+
"**/*.test.ts"
68+
],
69+
"globals": {
70+
"ts-jest": {
71+
"tsConfig": "./tsconfig.json",
72+
"diagnostics": false
73+
}
74+
}
75+
}
5576
}

packages/serverless/src/awslambda.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,7 @@ export const wrapHandler = <TEvent = any, TResult = any>(
165165
if (args[0] === null || args[0] === undefined) {
166166
resolve(callback(...args));
167167
} else {
168-
captureExceptionAsync(args[0], context, options).then(
169-
() => reject(callback(...args)),
170-
() => reject(callback(...args)),
171-
);
168+
captureExceptionAsync(args[0], context, options).finally(() => reject(callback(...args)));
172169
}
173170
};
174171
};

packages/serverless/test/.gitkeep

Whitespace-only changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export const SDK_VERSION = '6.6.6';
2+
export const Severity = {
3+
Warning: 'warning',
4+
};
5+
export const fakeScope = {
6+
addEventProcessor: jest.fn(),
7+
setTransactionName: jest.fn(),
8+
setTag: jest.fn(),
9+
setContext: jest.fn(),
10+
};
11+
export const captureException = jest.fn();
12+
export const captureMessage = jest.fn();
13+
export const withScope = jest.fn(cb => cb(fakeScope));
14+
export const flush = jest.fn(() => Promise.resolve());
15+
16+
export const resetMocks = (): void => {
17+
fakeScope.addEventProcessor.mockClear();
18+
fakeScope.setTransactionName.mockClear();
19+
fakeScope.setTag.mockClear();
20+
fakeScope.setContext.mockClear();
21+
22+
captureException.mockClear();
23+
captureMessage.mockClear();
24+
withScope.mockClear();
25+
flush.mockClear();
26+
};

0 commit comments

Comments
 (0)