From bdd6610208e9fe5971e6aed4378598092f2b9b5a Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 24 Jun 2017 16:34:47 +0200
Subject: refactor: separate app, responders
---
test/app.test.js | 34 ++++++++++++++++++++++++++++++++++
test/index.test.js | 34 ----------------------------------
2 files changed, 34 insertions(+), 34 deletions(-)
create mode 100644 test/app.test.js
delete mode 100644 test/index.test.js
(limited to 'test')
diff --git a/test/app.test.js b/test/app.test.js
new file mode 100644
index 0000000..04596fa
--- /dev/null
+++ b/test/app.test.js
@@ -0,0 +1,34 @@
+const test = require('ava')
+const path = require('path')
+const request = require('supertest')
+
+const config = require('../src/modules/config.js')
+config.posts.folder = path.resolve(__dirname, './data/')
+
+const app = require('../src/app.js')
+
+test('homepage', t => {
+ return request(app.listen())
+ .get('/')
+ .expect(200)
+ .expect(/
Test Site<\/title>/)
+ .expect(/Test Site<\/h1>/)
+ .expect(/This is a test/)
+ .then(() => t.pass())
+})
+
+test('post', t => {
+ return request(app.listen())
+ .get('/post/testfile')
+ .expect(200)
+ .expect(/Lorem ipsum<\/h1>/)
+ .then(() => t.pass())
+})
+
+test('tags', t => {
+ return request(app.listen())
+ .get('/tag/a')
+ .expect(200)
+ .expect(/This is a test/)
+ .then(() => t.pass())
+})
diff --git a/test/index.test.js b/test/index.test.js
deleted file mode 100644
index 769097f..0000000
--- a/test/index.test.js
+++ /dev/null
@@ -1,34 +0,0 @@
-const test = require('ava')
-const path = require('path')
-const request = require('supertest')
-
-const config = require('../src/modules/config.js')
-config.posts.folder = path.resolve(__dirname, './data/')
-
-const app = require('../src/index.js')
-
-test('homepage', t => {
- return request(app.listen())
- .get('/')
- .expect(200)
- .expect(/Test Site<\/title>/)
- .expect(/Test Site<\/h1>/)
- .expect(/This is a test/)
- .then(() => t.pass())
-})
-
-test('post', t => {
- return request(app.listen())
- .get('/post/testfile')
- .expect(200)
- .expect(/Lorem ipsum<\/h1>/)
- .then(() => t.pass())
-})
-
-test('tags', t => {
- return request(app.listen())
- .get('/tag/a')
- .expect(200)
- .expect(/This is a test/)
- .then(() => t.pass())
-})
--
cgit 1.4.1