Socket
Socket
Sign inDemoInstall

jest-dev-server

Package Overview
Dependencies
40
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jest-dev-server

Creates and tears down a local dev server during Jest tests.


Version published
Weekly downloads
239K
increased by6.37%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

0.1.0 (2018-03-02)

Features

  • first version 🎉

Readme

Source

jest-dev-server

Shamelessly copy & pasted from jest-puppeteer's jest-environment-puppeteer.

Starts a server before your Jest tests and tears it down after. Obeys generally the same settings as as jest-environment-puppeteer.

Why

jest-puppeteer works great for running tests in Jest using Puppeteer. It's also useful for starting a local development server during the tests without letting Jest hang. This package extracts just the local development server spawning without any ties to Puppeteer.

Usage

First off, if you're writing tests with Puppeteer, use jest-puppeteer instead.

jest-dev-server exports setupServer and teardownServer functions. setupServer will read in settings from jest-dev-server-config.js.

// globalSetup.js
module.exports = require("jest-dev-server").setupServer;
// globalTeardown.js
module.exports = require("jest-dev-server").teardownServer;
// jest-dev-server.config.js
module.exports = {
    server: {
        command: `node config/start.js --port=3000`,
        port: 3000,
        launchTimeout: 50000,
    },
};

Keywords

FAQs

Last updated on 14 May 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc