0.6.0 • Published 4 years ago

@web/test-runner-server v0.6.0

Weekly downloads
8
License
MIT
Repository
github
Last release
4 years ago

Test Runner Server

Server for communicating with the browser and serving test files, based on @web/dev-server-core.

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.

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 {
  rootDir: '../..',
  middleware: [
    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}';` };
        }
      },
    },
  ],
};

Typescript and JSX

Tests run in the browser, code written in TS or JSX needs to be compiled before it is possible to test them in the browser. You could do this transformation outside of the test runner, for example using babel or tsc. This would be the most predictable, but not the fastest approach.

Another option is to use something like @web/dev-server-esbuild.

0.6.0

4 years ago

0.5.16

4 years ago

0.5.15

4 years ago

0.5.14

4 years ago

0.5.13

4 years ago

0.5.12

4 years ago

0.5.11

4 years ago

0.5.10

4 years ago

0.5.9

4 years ago

0.5.8

4 years ago

0.5.7

4 years ago

0.5.6

4 years ago

0.5.5

4 years ago

0.5.4

4 years ago

0.5.3

4 years ago

0.5.0

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.4.6

4 years ago

0.4.5

4 years ago

0.4.4

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago