Ver Fonte

Put tests’ <body> at the right place

Alexandre Dieulot há 6 anos atrás
pai
commit
327a8df08c
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      test/app.js

+ 2 - 1
test/app.js

@@ -56,6 +56,8 @@ async function requestListener(req, res) {
       headers['Cache-Control'] = `max-age=${CACHE_MAX_AGE}`
       headers['Cache-Control'] = `max-age=${CACHE_MAX_AGE}`
     }
     }
 
 
+    content += await fsPromises.readFile(path.resolve(__dirname, 'header.html'))
+
     if (DATA_INSTANT) {
     if (DATA_INSTANT) {
       content += `<body>`
       content += `<body>`
     }
     }
@@ -64,7 +66,6 @@ async function requestListener(req, res) {
     }
     }
     dataInstantAttribute = DATA_INSTANT ? `data-instant` : ``
     dataInstantAttribute = DATA_INSTANT ? `data-instant` : ``
 
 
-    content += await fsPromises.readFile(path.resolve(__dirname, 'header.html'))
     content += `<h1>Page ${page}</h1>`
     content += `<h1>Page ${page}</h1>`
     for (let i = 1; i <= 3; i++) {
     for (let i = 1; i <= 3; i++) {
       if (page != i) {
       if (page != i) {