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

bun:test beforeAll function | API Reference | Bun

bun:test beforeAll function | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/bun:test/beforeAllFbeforeAll

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/bun:test/beforeAllFbeforeAll

function

test.beforeAllfunction beforeAll(fn: () => void | Promiseunknown> | (done: (err?: unknown) => void) => void,options?: HookOptions): void;Runs a function, once, before all the tests.

This is useful for running set up tasks, like initializing a global variable or connecting to a database.

If this function throws, tests will not run in this file.

@param fnthe function to run

let database; beforeAll(async () => { database = await connect("localhost"); });

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 →

智能索引记录