79400434

Date: 2025-01-30 15:48:50
Score: 0.5
Natty:
Report link

One extra use case for expect.stringContaining is that it can be used in nested matchers:

it("tests with nested stringContaining", () => {
  const o = {
    x: "testerama"
  };

  expect(o).toMatchObject({
    x: expect.stringContaining("test")
  });
});
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: CatSkald