{"name":"@tapjs/before","version":"4.0.5","keywords":["tapjs plugin"],"author":{"name":"Isaac Z. Schlueter"},"license":"BlueOak-1.0.0","_id":"@tapjs/before@4.0.5","maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"},{"name":"isaacs","email":"i@izs.me"}],"homepage":"https://github.com/tapjs/tapjs/src/spawn#readme","bugs":{"url":"https://github.com/tapjs/tapjs/issues"},"tap":{"typecheck":false},"dist":{"shasum":"499c1029b718f9a8341b99f64dd73a699db74b41","tarball":"http://registry-npm.ywwl.com/@tapjs/before/download/@tapjs/before-4.0.5.tgz","fileCount":13,"integrity":"sha512-1WOAGpYKxtFNWi1cf/BGXC2IqawNjV10FHvHZKllfLOUjtxfLYLvwnaRoqntILbc/SZeiFCXqSpWtaX/HzKYqg==","signatures":[{"sig":"MEYCIQC9CG6TJhcvYZeBmtlH5l9LV1ey8MnMjCZ1acjJqdq9UAIhAPn0vgo65v3MpgUKTY6hst3i85Cn8pjKxvt1o7mBJJs4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18421,"size":4277,"noattachment":false,"key":"/@tapjs/before/-/@tapjs/before-4.0.5.tgz"},"main":"./dist/commonjs/index.js","tshy":{"main":true,"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","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":"8102bd41059fa2dfb7014f93cabebf902ce0a332","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"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"repository":{"url":"git+https://github.com/tapjs/tapjs.git","type":"git"},"_npmVersion":"11.4.2","description":"a built-in tap extension for t.before()","directories":{},"_nodeVersion":"24.4.1","dependencies":{"is-actual-promise":"^1.0.1"},"_hasShrinkwrap":false,"peerDependencies":{"@tapjs/core":"4.0.5"},"_npmOperationalInternal":{"tmp":"tmp/before_4.0.5_1763430535398_0.05336227435968666","host":"s3://npm-registry-packages-npm-production"},"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":1763430535576,"_cnpm_publish_time":1763430535576,"dist-tags":{"latest":"4.3.13","pre":"1.0.0"}}