@web/test-runner-dev-server
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

Test Runner Dev Server

Server for serving test files, based on es-dev-server.

See @web/test-runner for a default implementation and CLI for the test runner.

The dev server has a lot of configuration options and a plugin system. Check out the es-dev-server docs for all possible options.

If you're using @web/test-runner, you can configure the dev server from the configuration file. For example:

import proxy from 'koa-proxies';
import awesomePlugin from 'awesome-plugin';

export default {
  devServer: {
    rootDir: '../..',
    moduleDirs: ['node_modules', 'fancy_modules'],
    middlewares: [
      proxy('/api', {
        target: 'http://localhost:9001',
      }),
    ],
    plugins: [
      // use a plugin
      awesomePlugin({ someOption: 'someProperty' }),
      // create an inline plugin
      {
        transform(context) {
          if (context.path === '/src/environment.js') {
            return { body: `export const version = '${packageJson.version}';` };
          }
        },
      },
    ],
  },
};

/@web/test-runner-dev-server/

    Package Sidebar

    Install

    npm i @web/test-runner-dev-server

    Weekly Downloads

    0

    Version

    0.3.1

    License

    MIT

    Unpacked Size

    28.4 kB

    Total Files

    19

    Last publish

    Collaborators

    • modern-web
    • westbrook
    • larsdenbakker
    • bennyp
    • jorenbroekema
    • passle
    • d4kmor