import test from 'ava'
import devServer from '../util/load-server'
const defaultServer = {
  publicPath: '/',
  port: 8080,
  hot: true,
  historyApiFallback: true,
  lazy: false,
  stats: 'errors-only',
  protocol: 'http:',
  hostname: 'localhost'
}

test('default config', t => {
  const server = devServer(true)

  t.deepEqual(server, defaultServer)
})

test('disabled server', t => {
  const server = devServer(false)
  const serverA = devServer()

  t.deepEqual(server, {})
  t.deepEqual(serverA, {})
})

test('config', t => {
  const server = devServer({
    publicPath: '/dist/'
  })
  let config = defaultServer
  config.publicPath = '/dist/'

  t.deepEqual(server, config)
})

@@ -444,16 +444,83 @@
 Server()
+%0A  const result = %7B%0A    enable: false,%0A    stats: 'errors-only'%0A  %7D
 %0A%0A  t.de
@@ -535,18 +535,22 @@
 server, 
-%7B%7D
+result
 )%0A  t.de
@@ -570,10 +570,14 @@
 rA, 
-%7B%7D
+result
 )%0A%7D)

update test