Tests boilerplate
This commit is contained in:
@@ -15,9 +15,6 @@
|
||||
"varstmt": true,
|
||||
"sub": true,
|
||||
"quotmark": "single",
|
||||
"browser": true,
|
||||
"jquery": true,
|
||||
"devel": true,
|
||||
"node": true,
|
||||
"globals": {
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ then edit the config.json file with your values :
|
||||
```bash
|
||||
npm start
|
||||
#or
|
||||
node server.js
|
||||
node src/server.js
|
||||
```
|
||||
|
||||
You might want to use something like screen to separate the process from your current terminal session.
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
"name": "gitblog.md",
|
||||
"version": "1.0.0",
|
||||
"description": "A static blog using Markdown pulled from your git repository.",
|
||||
"main": "server.js",
|
||||
"main": "src/server.js",
|
||||
"dependencies": {
|
||||
"express": "^4.17.1",
|
||||
"ncp": "^2.0.0",
|
||||
@@ -19,7 +19,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest",
|
||||
"install": "postinstall.js"
|
||||
"install": "src/postinstall.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const config = require('./config.json');
|
||||
const config = require('../config.json');
|
||||
const app = require('./app')(config);
|
||||
|
||||
const port = config.nodePort|3000;
|
||||
@@ -0,0 +1,14 @@
|
||||
/* jshint -W117 */
|
||||
const request = require('supertest');
|
||||
const config = require('./config.test.json');
|
||||
const app = require('../src/app')(config);
|
||||
|
||||
describe('Test root path', () => {
|
||||
test('GET / 200', done => {
|
||||
request(app).get('/').then(response => {
|
||||
expect(response.statusCode).toBe(200);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user