Verified Commit 1c4c9ca4 authored by Aral Balkan's avatar Aral Balkan
Browse files

Update the test index page and its unit test

parent 5694014d
...@@ -6,8 +6,6 @@ const https = require('https') ...@@ -6,8 +6,6 @@ const https = require('https')
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const indexHTML = "<!DOCTYPE html><html lang='en'><head><title>Test</title><body><h1>Test</h1></body></html>"
async function secureGet (url) { async function secureGet (url) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -127,7 +125,7 @@ test('serve method', t => { ...@@ -127,7 +125,7 @@ test('serve method', t => {
} }
t.equal(response.statusCode, 200, 'request succeeds') t.equal(response.statusCode, 200, 'request succeeds')
t.equal(response.body, indexHTML, 'index loads') t.equal(response.body.replace(/\s/g, ''), fs.readFileSync(path.join(__dirname, 'site', 'index.html'), 'utf-8').replace(/\s/g, ''), 'index loads')
// //
// Test custom 404 page. // Test custom 404 page.
......
This diff is collapsed.
<!DOCTYPE html><html lang='en'><head><title>Test</title><body><h1>Test</h1></body></html> <!doctype html>
\ No newline at end of file <html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello!</title>
<style>
html {font-family: sans-serif; background-color: #eae7e1}
body {display: grid; align-items: center; justify-content: center; height: 100vh; vertical-align: top; margin: 0;}
main {padding-left: 2vw; padding-right: 2vw; display: grid; justify-items: center;}
p {text-align: center;}
</style>
</head>
<body>
<main>
<div>
<h1>Yay!</h1>
<img src="happy-monster.svg" alt="Pink monster, happy.">
</div>
<p><strong>Hello!</strong> Welcome to your Indie Web Server.</p>
</main>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment