Skip to content
masterclass Buddy

Jest · Module

stringContaining

expect.stringContaining checks that a received string contains an exact substring. It can be nested inside several Jest assertions and asymmetric matchers.

Last updated

Syntax

expect.stringContaining(string)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • expect.not.stringContaining
  • expect.stringMatching
  • expect.arrayContaining
  • expect.objectContaining
  • toEqual
  • toHaveBeenCalledWith

Source: Expect · Jest. Checked 2026-11-03.