Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ It captures practical rules that prevent avoidable CI and PR churn.
- In docs Markdown, keep `<!--codeinclude-->` blocks tight with no blank lines between the markers and the include line, or the rendered snippet will contain blank lines between code lines.
- Tests should verify observable behavior changes, not only internal/config state.
- Example: for a security option, assert a real secure/insecure behavior difference.
- When adding a regression test for a bug fix, follow a red-green-refactor workflow.
- Run the focused test against the pre-fix implementation and confirm it fails for the expected reason.
- Apply the implementation change, rerun the same test, and confirm it passes.
- Report the red-green evidence in the PR verification summary.
- Test-only helper files under `src` (for example `*-test-utils.ts`) must be explicitly excluded from package `tsconfig.build.json` so they are not emitted into `build` and accidentally published.
- For substantial changes to GitHub Actions, runner images, Node/npm versions, or release/publish automation, consider running the manual `Node.js Package` workflow as a dry-run publish sanity check.
- Select the PR branch as the workflow ref to test publish workflow changes before merging.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("LogWaitStrategy", { timeout: 180_000 }, () => {
const start = new Date();
await using container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14")
.withCommand(["/bin/sh", "-c", 'sleep 2; echo "Ready"'])
.withWaitStrategy(Wait.forLogMessage("Ready"))
.withWaitStrategy(Wait.forLogMessage(/Ready/g))
.start();

expect(new Date().getTime() - start.getTime()).toBeGreaterThanOrEqual(2_000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export class LogWaitStrategy extends AbstractWaitStrategy {

const comparisonFn: (line: string) => boolean = (line: string) => {
if (this.message instanceof RegExp) {
if (this.message.global || this.message.sticky) {
this.message.lastIndex = 0;
}
return this.message.test(line);
} else {
return line.includes(this.message);
Expand Down
Loading