Node.js18의 node:test형

3978 단어 Node.jsTypeScripttech
@types/node 아직 없는 것 같아요.
declare module "node:test" {
  type TestContext = {
    diagnostic(message: string): void;
    runOnly(shouldRunOnlyTests: boolean): void;
    skip(...message: string[]): void;
    todo(...message: string[]): void;
    test: Test;
  };
  type TestCb =
    | ((testContext: TestContext) => void)
    | ((testContext: TestContext) => Promise<void>);
  type Test = (name: string, cb: TestCb) => void;
  const test: Test;
  export default test;
}

좋은 웹페이지 즐겨찾기