{"_id":"@tapjs/before@4.3.13","tap":{"typecheck":false},"bugs":{"url":"https://github.com/tapjs/tapjs/issues"},"dist":{"shasum":"dbfadb5d35aaf522a406c6530a0c1826b83119e2","tarball":"http://registry-npm.ywwl.com/@tapjs/before/download/@tapjs/before-4.3.13.tgz","fileCount":13,"integrity":"sha512-5EkSAEGzmmmSLaAAw4AEoqTHIsz7ma3dHqWEi8dPofIgsX1IjXbDjb3PG15RNOzAwciZ/3JdmMN0nPs9CrHjCA==","signatures":[{"sig":"MEUCIQCr+J7bVvHhZLUY29QrKb/XZxyTLvGFLJoQypI1eGuRfgIgexb+AqcMaUhK/OpYZsl4Qvh9u2TxkOymZp7RpJx5Lts=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDEF8JQb6yGJCUnn5nYSrUMhBUC7+MHayfjkkrvgTC8JgIgeCuOhCyQ3bPkzhJKkkw7GwOl6XekwBuDZ8MZUhT76ro="}],"unpackedSize":18478,"size":4298,"noattachment":false,"key":"/@tapjs/before/-/@tapjs/before-4.3.13.tgz"},"main":"./dist/commonjs/index.js","name":"@tapjs/before","tshy":{"main":true,"exports":{".":"./src/index.ts","./package.json":"./package.json"},"selfLink":false},"type":"module","types":"./dist/commonjs/index.d.ts","author":{"name":"Isaac Z. Schlueter"},"module":"./dist/esm/index.js","engines":{"node":"20 || >=22"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"6874ffcc3e671f64b5dbabdd25b26904d3e2ed84","license":"BlueOak-1.0.0","scripts":{"snap":"tap","test":"tap","format":"prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache","prepare":"tshy","presnap":"npm run prepare","pretest":"npm run prepare","typedoc":"typedoc --tsconfig tsconfig/esm.json ./src/*.ts"},"version":"4.3.13","_npmUser":{"name":"isaacs","email":"i@izs.me"},"homepage":"https://github.com/tapjs/tapjs/tree/main/src/before#readme","keywords":["tapjs plugin"],"repository":{"url":"git+ssh://git@github.com/tapjs/tapjs.git","path":"src/before","type":"git"},"_npmVersion":"12.2.0","description":"a built-in tap extension for t.before()","directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"},{"name":"isaacs","email":"i@izs.me"}],"_nodeVersion":"26.5.0","dependencies":{"is-actual-promise":"^1.0.1"},"_hasShrinkwrap":false,"peerDependencies":{"@tapjs/core":"4.6.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/before_4.3.13_1793744198704_0.5349353790659007"},"readme":"# `@tapjs/before`\n\nA default tap plugin providing `t.before()`.\n\n## USAGE\n\nThis plugin is installed with tap by default. If you had\npreviously removed it, you can `tap plugin add @tapjs/before` to\nbring it back.\n\n```ts\nimport t from 'tap'\nt.before(() => {\n  // this will run before the tests in this file start\n})\n```\n\nIf the method returns a promise, it will be awaited before moving\non to the next test.\n\nA `t.before()` method will run prior to any _subsequent_ child\ntests. If it's called before any child tests have started, then\nit will be run right away.\n\nSo, this test:\n\n```js\nimport t from 'tap'\n\nt.before(() => {\n  console.error('before initial')\n})\n\nt.test('first test', t => {\n  t.before(async () => {\n    // this will wait before moving on\n    await new Promise(res => setTimeout(res, 100))\n    console.error('before in first test')\n  })\n  console.error('in first test')\n  t.test('child test', t => {\n    console.error('child of first test')\n    t.end()\n  })\n  t.end()\n})\n\nt.before(() => {\n  console.error('before between')\n})\n\nt.test('second test', t => {\n  console.error('in second test')\n  t.end()\n})\n```\n\nwill print:\n\n```\nbefore initial\nin first test\nbefore in first test\nchild of first test\nbefore between\nin second test\n```\n\nEssentially, `t.before()` is a bit like a child test method that\ndoesn't get a `Test` object as an argument.\n","publish_time":1793744198792,"_cnpm_publish_time":1793744198792,"dist-tags":{"latest":"4.3.13","pre":"1.0.0"}}