Skip to content

Commit 53bd001

Browse files
lym953claude
andcommitted
test: assert exact invocation count; docs: note against over-defensive checks
Each function is invoked exactly twice, so assert toBe(2) instead of a loose lower bound. Also add a guideline to AGENTS.md against unnecessary defensive checks/tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent d12559f commit 53bd001

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ The Datadog Lambda Extension ("Bottlecap") is an AWS Lambda Extension written in
1010

1111
All Rust code lives under `bottlecap/`. Run these from that directory unless noted.
1212

13+
## Code Style
14+
15+
- Do not be overly defensive and add unnecessary checks or tests unless you have a good reason.
16+
1317
## Pull Requests
1418

1519
- When creating a PR, follow the PR template at `.github/pull_request_template.md`.

integration-tests/tests/durable-cold-start.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('Durable Function Cold-Start Metric Tag Integration Tests', () => {
5757
windowStart,
5858
windowEnd,
5959
);
60-
expect(totalCount).toBeGreaterThanOrEqual(2);
60+
expect(totalCount).toBe(2);
6161
expect(taggedCount).toBe(totalCount);
6262
});
6363

@@ -75,7 +75,7 @@ describe('Durable Function Cold-Start Metric Tag Integration Tests', () => {
7575
windowStart,
7676
windowEnd,
7777
);
78-
expect(totalCount).toBeGreaterThanOrEqual(2);
78+
expect(totalCount).toBe(2);
7979
expect(taggedCount).toBe(0);
8080
});
8181
});

0 commit comments

Comments
 (0)