playwright/utils/testserver
Joel Einbinder c03e8b7946
chore(tests): add types for tests (#915)
I enabled vscode autocomplete in our test files. Typechecking had too many errors to enable, but it caught some real bugs that I will fix in a follow up.

This patch contains:
* `test/types.d.ts` - d.ts file for our test runner.
* `test/tsconfig.json` - typescript project for our tests.
* JSDoc header in all specs to mark the describe as a TestSuite
* Drive-by fix of a launcher test that was using `if` instead of `it`
* Some drive-by fixes of unimpactful typos in tests.
2020-02-10 13:20:13 -08:00
..
cert.pem Initial commit 2019-11-19 10:58:15 -08:00
index.js chore(tests): add types for tests (#915) 2020-02-10 13:20:13 -08:00
key.pem Initial commit 2019-11-19 10:58:15 -08:00
README.md chore: replace pptr with pw (#643) 2020-01-24 16:15:41 -08:00

TestServer

This test server is used internally by Playwright to test Playwright itself.

Example

const {TestServer} = require('.');

(async(() => {
  const httpServer = await TestServer.create(__dirname, 8000),
  const httpsServer = await TestServer.createHTTPS(__dirname, 8001)
  httpServer.setRoute('/hello', (req, res) => {
    res.end('Hello, world!');
  });
  console.log('HTTP and HTTPS servers are running!');
})();