You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
566 B

9 years ago
8 years ago
9 years ago
8 years ago
9 years ago
8 years ago
9 years ago
8 years ago
9 years ago
8 years ago
9 years ago
  1. 'use strict'
  2. const TestRunner = require('test-runner')
  3. const request = require('req-then')
  4. const LocalWebServer = require('../')
  5. const a = require('assert')
  6. const runner = new TestRunner()
  7. runner.test('basic', async function () {
  8. const port = 9000 + this.index
  9. const localWebServer = new LocalWebServer({
  10. port: port,
  11. directory: 'test/fixture',
  12. logFormat: 'none'
  13. })
  14. localWebServer.launch()
  15. const response = await request(`http://localhost:${port}/one.txt`)
  16. localWebServer.server.close()
  17. a.strictEqual(response.data.toString(), 'one\n')
  18. })