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.

18 lines
517 B

9 years ago
  1. 'use strict'
  2. const test = require('tape')
  3. const request = require('req-then')
  4. const LocalWebServer = require('../../')
  5. const c = require('../common')
  6. test('static', function (t) {
  7. t.plan(3)
  8. const ws = new LocalWebServer()
  9. ws.addIndex(__dirname, { icons: true })
  10. const server = ws.getServer()
  11. server.listen(8100, () => {
  12. request('http://localhost:8100/')
  13. .then(c.checkResponse(t, 200, [ /listing directory/, /class="icon/ ]))
  14. .then(server.close.bind(server))
  15. .catch(c.fail(t))
  16. })
  17. })