{"_id":"@animech-public/jest-process-manager","_rev":"2-ad330b5e210360ba025a5b515dd4c9a8","name":"@animech-public/jest-process-manager","dist-tags":{"latest":"0.5.1"},"versions":{"0.5.0":{"name":"@animech-public/jest-process-manager","version":"0.5.0","keywords":["jest","jest-environment","server"],"author":{"name":"Animech Technologies"},"license":"MIT","_id":"@animech-public/jest-process-manager@0.5.0","maintainers":[{"name":"godiagonal","email":"samueljohanssonhue@gmail.com"},{"name":"aidinabedi","email":"aidinabedi@gmail.com"},{"name":"andersgallon","email":"anders.gallon@animech.com"}],"homepage":"https://github.com/playwright-community/jest-process-manager#readme","bugs":{"url":"https://github.com/playwright-community/jest-process-manager/issues"},"dist":{"shasum":"434beed38148d5d08a4c6d37e0513a503ce3bdf1","tarball":"https://registry.npmjs.org/@animech-public/jest-process-manager/-/jest-process-manager-0.5.0.tgz","fileCount":4,"integrity":"sha512-udsVZqM6RjmbcB27lEmYvrFE1CoJSMVYQGcvsSYQ4io3Y9K1hoA4G2rB6Jo7BU1EOCOilGHyGe9lYj9vW8wV9g==","signatures":[{"sig":"MEUCIHcYQpkRcOv46sZ49G+3yWPxDWFMYZ2Bq+yqIHUApzq/AiEAk8CG747ctlCKdPI2yg7PAnAhukRtzXhYi6SOBhEv978=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13396},"main":"lib/index.js","types":"src/types.d.ts","gitHead":"ceceb94dada60c394ac74b998db7edd62b245fe9","scripts":{"dev":"tsc --watch","lint":"tsc --noEmit","build":"tsc","prebuild":"rm -rf lib/"},"_npmUser":{"name":"aidinabedi","email":"aidinabedi@gmail.com"},"repository":{"url":"git+https://github.com/playwright-community/jest-process-manager.git","type":"git"},"_npmVersion":"10.9.3","description":"Starts a server before your Jest tests and tears it down after.","directories":{},"_nodeVersion":"22.20.0","dependencies":{"cwd":"^0.10.0","exit":"^0.1.2","chalk":"^4.1.0","spawnd":"^5.0.0","prompts":"^2.4.1","wait-on":"^7.0.0","tree-kill":"^1.2.2","signal-exit":"^3.0.3","find-process":"^1.4.4","@types/wait-on":"^5.2.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/cwd":"^0.10.0","typescript":"^4.2.4","@types/exit":"^0.1.31","@types/prompts":"^2.0.10","@types/signal-exit":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/jest-process-manager_0.5.0_1761740214493_0.5857804590929492","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@animech-public/jest-process-manager","description":"Starts a server before your Jest tests and tears it down after.","version":"0.5.1","main":"lib/index.js","types":"src/types.d.ts","repository":{"type":"git","url":"git+https://github.com/playwright-community/jest-process-manager.git"},"author":{"name":"Animech Technologies"},"license":"MIT","keywords":["jest","jest-environment","server"],"scripts":{"build":"tsc","dev":"tsc --watch","lint":"tsc --noEmit"},"dependencies":{"@types/wait-on":"^5.2.0","chalk":"^4.1.0","cwd":"^0.10.0","exit":"^0.1.2","find-process":"^1.4.4","prompts":"^2.4.1","signal-exit":"^3.0.3","spawnd":"^5.0.0","tree-kill":"^1.2.2","wait-on":"^7.0.0"},"devDependencies":{"@types/cwd":"^0.10.0","@types/exit":"^0.1.31","@types/prompts":"^2.0.10","@types/signal-exit":"^3.0.0","typescript":"^4.2.4"},"_id":"@animech-public/jest-process-manager@0.5.1","gitHead":"ceceb94dada60c394ac74b998db7edd62b245fe9","bugs":{"url":"https://github.com/playwright-community/jest-process-manager/issues"},"homepage":"https://github.com/playwright-community/jest-process-manager#readme","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-G5ijMc/Qzev7l3vKJpRrf3fbxRrYER0hqC75gE7Ahy8tBlK6NvRRo1yzwaedcVq7XQet+jdLcmrtY2wQwi59Ow==","shasum":"7c8e732f8e7b70ba2acb4f177eadd37996e4fdb4","tarball":"https://registry.npmjs.org/@animech-public/jest-process-manager/-/jest-process-manager-0.5.1.tgz","fileCount":6,"unpackedSize":22897,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICKdOeaKID6RjZaBqxBpWVDv7FVL6jim15Kg39AFC/tAAiEAkdDz8TjJctkl/9B+1MzIB07QISaZ/2X/MYSxxBLLsc4="}]},"_npmUser":{"name":"aidinabedi","email":"aidinabedi@gmail.com"},"directories":{},"maintainers":[{"name":"godiagonal","email":"samueljohanssonhue@gmail.com"},{"name":"aidinabedi","email":"aidinabedi@gmail.com"},{"name":"andersgallon","email":"anders.gallon@animech.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jest-process-manager_0.5.1_1761740899102_0.48341672582725237"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-29T12:16:54.386Z","modified":"2025-10-29T12:28:19.508Z","0.5.0":"2025-10-29T12:16:54.686Z","0.5.1":"2025-10-29T12:28:19.300Z"},"bugs":{"url":"https://github.com/playwright-community/jest-process-manager/issues"},"author":{"name":"Animech Technologies"},"license":"MIT","homepage":"https://github.com/playwright-community/jest-process-manager#readme","keywords":["jest","jest-environment","server"],"repository":{"type":"git","url":"git+https://github.com/playwright-community/jest-process-manager.git"},"description":"Starts a server before your Jest tests and tears it down after.","maintainers":[{"name":"godiagonal","email":"samueljohanssonhue@gmail.com"},{"name":"aidinabedi","email":"aidinabedi@gmail.com"},{"name":"andersgallon","email":"anders.gallon@animech.com"}],"readme":"# jest-process-manager\n\n**This project was forked because the package [`jest-dev-server`](https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-dev-server) is no longer maintained.**\n\n[![CI](https://github.com/playwright-community/jest-process-manager/workflows/CI/badge.svg)](https://github.com/playwright-community/jest-process-manager/actions)\n[![npm](https://img.shields.io/npm/v/jest-process-manager)](http://npmjs.com/package/jest-process-manager)\n\nStarts a server before your Jest tests and tears it down after.\n\n## Why\n\n[`jest-playwright-preset`](https://github.com/playwright-community/jest-playwright) or `jest-puppeteer` works great for running tests in Jest using your preferred end-to-end testing library.\nIt's also useful for starting a local development server during the tests without letting Jest hang.\nThis package extracts just the local development server spawning without any ties to Puppeteer.\n\n## Install\n\n```bash\nnpm install --save-dev jest-process-manager\n```\n\n## Usage\n\n`jest-process-manager` exports `setup`,`teardown` and `getServers` functions.\n\n```js\n// global-setup.js\nconst { setup: setupDevServer } = require('jest-process-manager')\n\nmodule.exports = async function globalSetup() {\n  await setupDevServer({\n    command: `node config/start.js --port=3000`,\n    launchTimeout: 50000,\n    port: 3000,\n  })\n  // Your global setup\n}\n```\n\nIt is also possible to specify several servers:\n\n```js\n// global-setup.js\nconst { setup: setupDevServer } = require('jest-process-manager')\n\nmodule.exports = async function globalSetup() {\n  await setupDevServer([\n    {\n      command: 'node server.js',\n      port: 4444,\n    },\n    {\n      command: 'node server2.js',\n      port: 4445,\n    },\n  ])\n  // Your global setup\n}\n```\n\n```js\n// global-setup.js\nconst { setup: setupDevServer, getServers } = require('jest-process-manager')\n\nmodule.exports = async function globalSetup() {\n  await setupDevServer({\n    command: `node config/start.js --port=3000`,\n    launchTimeout: 50000,\n    port: 3000,\n  })\n  getServers.then(servers => {\n    // You can get to the servers and do whatever you want\n  })\n  // Your global setup\n}\n```\n\n```js\n// global-teardown.js\nconst { teardown: teardownDevServer } = require('jest-process-manager')\n\nmodule.exports = async function globalTeardown() {\n  await teardownDevServer()\n  // Your global teardown\n}\n```\n\n## Options\n\n### `command`\n\nType: `string`, required.\n\nCommand to execute to start the port.\nDirectly passed to [`spawnd`](https://www.npmjs.com/package/spawnd).\n\n```js\nmodule.exports = {\n  command: 'npm run start',\n}\n```\n\n### `debug`\n\nType: `boolean`, default to `false`.\n\nLog server output, useful if server is crashing at start.\n\n```js\nmodule.exports = {\n  command: 'npm run start',\n  debug: true,\n}\n```\n\n### `launchTimeout`\n\nType: `number`, default to `5000`.\n\nHow many milliseconds to wait for the spawned server to be available before giving up.\nDefaults to [`wait-port`](https://www.npmjs.com/package/wait-port)'s default.\n\n```js\nmodule.exports = {\n  command: 'npm run start',\n  launchTimeout: 30000,\n}\n```\n\n---\n\nFollowing options are linked to [`spawnd`](https://www.npmjs.com/package/spawnd).\n\n### `host`\n\nType: `string`, default to `localhost`.\n\nHost to wait for activity on before considering the server running.\nMust be used in conjunction with `port`.\n\n```js\nmodule.exports = {\n  command: 'npm run start --port 3000',\n  host: 'customhost.com',\n  port: 3000,\n}\n```\n\n### `protocol`\n\nType: (`https`, `http`, `http-get`, `https-get`, `tcp`, `socket`) default to `tcp`.\n\nTo wait for an HTTP or TCP endpoint before considering the server running, include `http` or `tcp` as a protocol.\nMust be used in conjunction with `port`.\nThis give you ability to define resource prefix for [`wait-on`](https://github.com/jeffbski/wait-on) package.\n\n```js\nmodule.exports = {\n  command: 'npm run start --port 3000',\n  protocol: 'http',\n  port: 3000,\n}\n```\n\n### `port`\n\nType: `number`, default to `3000`.\n\nPort to wait for activity on before considering the server running.\nIf not provided, the server is assumed to immediately be running.\n\n```js\nmodule.exports = {\n  command: 'npm run start --port 3000',\n  port: 3000,\n}\n```\n\n### `basePath`\n\nType: `string`\n\nOption for a basePath where server is running.\n\n```js\nmodule.exports = {\n  command: 'npm run start',\n  basePath: '/myservice',\n}\n```\n\n### `usedPortAction`\n\nType: `string` (`ask`, `error`, `ignore`, `kill`) default to `ask`.\n\nIt defines the action to take if port is already used:\n\n- `ask`: a prompt is shown to decide if you want to kill the process or not\n- `error`: an errow is thrown\n- `ignore`: your test are executed, we assume that the server is already started\n- `kill`: the process is automatically killed without a prompt\n\n```js\nmodule.exports = {\n  command: 'npm run start --port 3000',\n  port: 3000,\n  usedPortAction: 'kill',\n}\n```\n\n### `waitOnScheme`\n\n`jest-dev-server` use the [`wait-on`](https://www.npmjs.com/package/wait-on) npm package to wait for resources to become available before calling callback.\n\nType: `object`, default to `{}`.\n\n- `delay`: optional initial delay in ms, default 0\n- `interval`: optional poll resource interval in ms, default 250ms\n- `log`: optional flag which outputs to stdout, remaining resources waited on and when complete or errored\n- `reverse`: optional flag to reverse operation so checks are for resources being NOT available, default false\n- `timeout`: optional timeout in ms, default Infinity. Aborts with error\n- `tcpTimeout`: optional tcp timeout in ms, default 300ms\n- `verbose`: optional flag which outputs debug output, default false\n- `window`: optional stabilization time in ms, default 750ms. Waits this amount of time for file sizes to stabilize or other resource availability to remain unchanged\n\n**Note:** http(s) specific options, see https://github.com/request/request#readme for specific details\n\n```js\nmodule.exports = {\n  command: 'npm run start --port 3000',\n  port: 3000,\n  usedPortAction: 'kill',\n  waitOnScheme: {\n    delay: 1000,\n  },\n}\n```\n\n### `options`\n\nOptions which will be passed down to the [spawn](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) of the process. For example environment variables:\n\n```js\n// global-setup.js\nconst { setup: setupDevServer, getServers } = require('jest-process-manager')\n\nmodule.exports = async function globalSetup() {\n  await setupDevServer({\n    command: `node config/start.js --port=3000`,\n    launchTimeout: 50000,\n    port: 3000,\n    options: {\n      env: {\n        \"FOO\": \"bar\",\n      }\n    }\n  })\n  getServers.then(servers => {\n    // You can get to the servers and do whatever you want\n  })\n  // Your global setup\n}\n```\n\n## Troubleshooting\n\n- If using `port` makes the terminal to ask for root password although the port is valid and accessible then use `usePortAction: 'ignore'`.\n\n## License\n\nhttps://github.com/playwright-community/jest-process-manager/blob/master/LICENSE\n","readmeFilename":"README.md"}