Skip to content

contains scorer with empty-string needle always passes #28

Description

@royalpinto007

Problem

A contains scorer with an empty-string needle always passes ("".includes("") is trivially true), so a misconfigured suite goes green.

Where

src/scorers/contains.ts: needles are normalized and checked with hay.includes(...) with no empty-needle guard.

Acceptance

Add a failing test first asserting contains with value: "" returns passed: false. Then fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions