温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/bun/test/Matchers/toContainValue
点击访问原文链接

Matchers.toContainValue method | bun:test module | Bun

Matchers.toContainValue method | bun:test module | BunBuildDocsReferenceGuidesBlogDiscord/bun:test/Matchers/toContainValueMtoContainValue

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/bun:test/Matchers/toContainValueMtoContainValue

method

test.Matchers.toContainValuetoContainValue(expected: unknown): void;Asserts that an object contain the provided value.

This method is deep and will look through child properties to find the expected value.

The input value must be an object.

@param expectedthe expected value

const shallow = { hello: "world" }; const deep = { message: shallow }; const deepArray = { message: [shallow] }; const o = { a: "foo", b: [1, "hello", true], c: "baz" }; expect(shallow).toContainValue("world"); expect({ foo: false }).toContainValue(false); expect(deep).toContainValue({ hello: "world" }); expect(deepArray).toContainValue([{ hello: "world" }]); expect(o).toContainValue("foo", "barr"); expect(o).toContainValue([1, "hello", true]); expect(o).not.toContainValue("qux"); // NOT expect(shallow).not.toContainValue("foo"); expect(deep).not.toContainValue({ foo: "bar" }); expect(deepArray).not.toContainValue([{ foo: "bar" }]);

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco

We're hiring →

智能索引记录