Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ggkovacs committed Dec 13, 2016
1 parent 6e5991a commit 5fb29bc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ test.before('setup', async t => {

function event(file, contentType) {
return (req, res) => {
const data = fs.readFileSync(file);
const data = fs.readFileSync(`${__dirname}/${file}`);
res.statusCode = 200;
res.setHeader('Content-Type', contentType);
res.write(data);
res.end();
}
}

s.on('/html', event('./data/index.html', 'text/html'));
s.on('/html/', event('./data/index.html', 'text/html'));
s.on('/rss', event('./data/rss.xml', 'text/xml'));
s.on('/nofavicon', event('./data/nofavicon.html', 'text/html'));
s.on('/nourl', event('./data/nourl.xml', 'text/xml'));
s.on('/html', event('data/index.html', 'text/html'));
s.on('/html/', event('data/index.html', 'text/html'));
s.on('/rss', event('data/rss.xml', 'text/xml'));
s.on('/nofavicon', event('data/nofavicon.html', 'text/html'));
s.on('/nourl', event('data/nourl.xml', 'text/xml'));

s.on('/favicon.ico', (req, res) => {
res.statusCode = 500;
Expand Down

0 comments on commit 5fb29bc

Please sign in to comment.