From 6b7062046eafaf613b58b5429bc8e1deb3edaec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Fri, 9 Dec 2016 23:07:18 +0100 Subject: [PATCH] Use Nuxt server for tests --- lib/server.js | 4 ++++ test/basic.test.js | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/server.js b/lib/server.js index 4d61bf6feb..2446611091 100644 --- a/lib/server.js +++ b/lib/server.js @@ -24,6 +24,10 @@ class Server { return this } + close (cb) { + return this.server.close(cb) + } + } module.exports = Server diff --git a/test/basic.test.js b/test/basic.test.js index f8e3462725..184cedad2c 100755 --- a/test/basic.test.js +++ b/test/basic.test.js @@ -1,6 +1,5 @@ import test from 'ava' import jsdom from 'jsdom' -import { createServer } from 'http' import { resolve } from 'path' const port = 4002 const url = (route) => 'http://localhost:' + port + route @@ -18,7 +17,7 @@ test.before('Init Nuxt.js', t => { nuxt = new Nuxt(options) return nuxt.build() .then(function () { - server = createServer((req, res) => nuxt.render(req, res)) + server = new nuxt.Server(nuxt) server.listen(port, 'localhost') }) })