@@ -13,9 +13,17 @@ import { assertEquals, assertInstanceOf } from "@std/assert";
1313import process from "node:process" ;
1414import { getCloudWatchLogsSink } from "./sink.ts" ;
1515
16- type Describe = ( name : string , run : ( ) => void | Promise < void > ) => void ;
17-
18- let test : Describe & { skip ?: Describe } = suite ( import . meta) ;
16+ type Describe = {
17+ ( name : string , run : ( ) => void | Promise < void > ) : void ;
18+ (
19+ name : string ,
20+ options : { sanitizeResources ?: boolean ; sanitizeOps ?: boolean } ,
21+ run : ( ) => void | Promise < void > ,
22+ ) : void ;
23+ skip ?: Describe ;
24+ } ;
25+
26+ let test : Describe = suite ( import . meta) as Describe ;
1927
2028// Skip integration tests unless AWS credentials are provided
2129// Also skip on Bun due to AWS SDK response parsing issues
@@ -42,7 +50,10 @@ if (skipIntegrationTests) {
4250const testLogGroupName = `/logtape/integration-test-${ Date . now ( ) } ` ;
4351const testLogStreamName = `test-stream-${ Date . now ( ) } ` ;
4452
45- test ( "Integration: CloudWatch Logs sink with real AWS service" , async ( ) => {
53+ test ( "Integration: CloudWatch Logs sink with real AWS service" , {
54+ sanitizeResources : false ,
55+ sanitizeOps : false ,
56+ } , async ( ) => {
4657 const client = new CloudWatchLogsClient ( {
4758 region : process . env . AWS_REGION ,
4859 credentials : {
@@ -137,10 +148,14 @@ test("Integration: CloudWatch Logs sink with real AWS service", async () => {
137148 } catch ( error ) {
138149 console . warn ( "Failed to cleanup test log group:" , error ) ;
139150 }
151+ client . destroy ( ) ;
140152 }
141153} ) ;
142154
143- test ( "Integration: CloudWatch Logs sink with batch processing" , async ( ) => {
155+ test ( "Integration: CloudWatch Logs sink with batch processing" , {
156+ sanitizeResources : false ,
157+ sanitizeOps : false ,
158+ } , async ( ) => {
144159 const client = new CloudWatchLogsClient ( {
145160 region : process . env . AWS_REGION ,
146161 credentials : {
@@ -230,10 +245,14 @@ test("Integration: CloudWatch Logs sink with batch processing", async () => {
230245 } catch ( error ) {
231246 console . warn ( "Failed to cleanup batch test log group:" , error ) ;
232247 }
248+ client . destroy ( ) ;
233249 }
234250} ) ;
235251
236- test ( "Integration: CloudWatch Logs sink with credentials from options" , async ( ) => {
252+ test ( "Integration: CloudWatch Logs sink with credentials from options" , {
253+ sanitizeResources : false ,
254+ sanitizeOps : false ,
255+ } , async ( ) => {
237256 const credentialsTestLogGroupName = `/logtape/credentials-test-${ Date . now ( ) } ` ;
238257 const credentialsTestLogStreamName = `credentials-test-stream-${ Date . now ( ) } ` ;
239258
@@ -333,10 +352,14 @@ test("Integration: CloudWatch Logs sink with credentials from options", async ()
333352 } catch ( error ) {
334353 console . warn ( "Failed to cleanup credentials test log group:" , error ) ;
335354 }
355+ client . destroy ( ) ;
336356 }
337357} ) ;
338358
339- test ( "Integration: CloudWatch Logs sink with JSON Lines formatter" , async ( ) => {
359+ test ( "Integration: CloudWatch Logs sink with JSON Lines formatter" , {
360+ sanitizeResources : false ,
361+ sanitizeOps : false ,
362+ } , async ( ) => {
340363 const structuredTestLogGroupName = `/logtape/structured-test-${ Date . now ( ) } ` ;
341364 const structuredTestLogStreamName = `structured-test-stream-${ Date . now ( ) } ` ;
342365
@@ -447,5 +470,6 @@ test("Integration: CloudWatch Logs sink with JSON Lines formatter", async () =>
447470 } catch ( error ) {
448471 console . warn ( "Failed to cleanup structured test log group:" , error ) ;
449472 }
473+ client . destroy ( ) ;
450474 }
451475} ) ;
0 commit comments