Skip to content

Commit 337241b

Browse files
committed
use serve test helper method. /cc @brandondees @tmornini
1 parent 3fe0f29 commit 337241b

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

middleware/security.test

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,17 @@
88

99

1010
const
11-
{ test, fetch }
11+
{ test, fetch, serve }
1212
= require ('test')
1313

14-
, { Server }
15-
= require ('..')
16-
1714

1815
test ('calling next middleware')
1916

2017

2118
test ('X-XSS-Protection: 1; mode=block', async t => {
2219

2320
const
24-
server = (new Server).serve ``
21+
server = serve ``
2522
, response = await fetch ('http://localhost:8181/')
2623

2724

@@ -43,7 +40,7 @@ test ('X-XSS-Protection: 1; mode=block', async t => {
4340
test ('X-Frame-Options: deny', async t => {
4441

4542
const
46-
server = (new Server).serve ``
43+
server = serve ``
4744
, response = await fetch ('http://localhost:8181/')
4845

4946

@@ -58,7 +55,7 @@ test ('X-Frame-Options: deny', async t => {
5855
test ('X-Content-Type-Options: nosniff', async t => {
5956

6057
const
61-
server = (new Server).serve ``
58+
server = serve ``
6259
, response = await fetch ('http://localhost:8181/')
6360

6461

@@ -73,7 +70,7 @@ test ('X-Content-Type-Options: nosniff', async t => {
7370
test ('Strict-Transport-Security', async t => {
7471

7572
const
76-
server = (new Server).serve ``
73+
server = serve ``
7774
, response = await fetch ('http://localhost:8181/')
7875

7976
, age = 60 * 60 * 24 * 365

0 commit comments

Comments
 (0)