Skip to content

Commit bfb0fa5

Browse files
committed
ref(serverless): Fix awslambda tests
1 parent e1f46b9 commit bfb0fa5

File tree

3 files changed

+123
-90
lines changed

3 files changed

+123
-90
lines changed

packages/serverless/src/awslambda.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { existsSync } from 'fs';
22
import { hostname } from 'os';
33
import { basename, resolve } from 'path';
44
import { types } from 'util';
5-
/* eslint-disable max-lines */
65
import type { NodeOptions, Scope } from '@sentry/node';
76
import { SDK_VERSION } from '@sentry/node';
87
import {
@@ -19,12 +18,11 @@ import {
1918
} from '@sentry/node';
2019
import type { Integration, Options, SdkMetadata, Span } from '@sentry/types';
2120
import { isString, logger } from '@sentry/utils';
22-
// NOTE: I have no idea how to fix this right now, and don't want to waste more time, as it builds just fine — Kamil
2321
import type { Context, Handler } from 'aws-lambda';
2422
import { performance } from 'perf_hooks';
2523

2624
import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core';
27-
import { AWSServices } from './awsservices';
25+
import { awsServicesIntegration } from './awsservices';
2826
import { DEBUG_BUILD } from './debug-build';
2927
import { markEventUnhandled } from './utils';
3028

@@ -71,12 +69,12 @@ export interface WrapperOptions {
7169
export const defaultIntegrations: Integration[] = [
7270
// eslint-disable-next-line deprecation/deprecation
7371
...nodeDefaultIntegrations,
74-
new AWSServices({ optional: true }),
72+
awsServicesIntegration({ optional: true }),
7573
];
7674

7775
/** Get the default integrations for the AWSLambda SDK. */
7876
export function getDefaultIntegrations(options: Options): Integration[] {
79-
return [...getNodeDefaultIntegrations(options), new AWSServices({ optional: true })];
77+
return [...getNodeDefaultIntegrations(options), awsServicesIntegration({ optional: true })];
8078
}
8179

8280
interface AWSLambdaOptions extends NodeOptions {

packages/serverless/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import * as AWSLambda from './awslambda';
33
import * as GCPFunction from './gcpfunction';
44
export { AWSLambda, GCPFunction };
55

6-
export { AWSServices } from './awsservices';
6+
// eslint-disable-next-line deprecation/deprecation
7+
export { AWSServices, awsServicesIntegration } from './awsservices';
78

89
// TODO(v8): We have to explicitly export these because of the namespace exports
910
// above. This is because just doing `export * from '@sentry/node'` will not

0 commit comments

Comments
 (0)