Tests boilerplate
This commit is contained in:
@@ -15,9 +15,6 @@
|
|||||||
"varstmt": true,
|
"varstmt": true,
|
||||||
"sub": true,
|
"sub": true,
|
||||||
"quotmark": "single",
|
"quotmark": "single",
|
||||||
"browser": true,
|
|
||||||
"jquery": true,
|
|
||||||
"devel": true,
|
|
||||||
"node": true,
|
"node": true,
|
||||||
"globals": {
|
"globals": {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ then edit the config.json file with your values :
|
|||||||
```bash
|
```bash
|
||||||
npm start
|
npm start
|
||||||
#or
|
#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.
|
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",
|
"name": "gitblog.md",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "A static blog using Markdown pulled from your git repository.",
|
"description": "A static blog using Markdown pulled from your git repository.",
|
||||||
"main": "server.js",
|
"main": "src/server.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"ncp": "^2.0.0",
|
"ncp": "^2.0.0",
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"install": "postinstall.js"
|
"install": "src/postinstall.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const config = require('./config.json');
|
const config = require('../config.json');
|
||||||
const app = require('./app')(config);
|
const app = require('./app')(config);
|
||||||
|
|
||||||
const port = config.nodePort|3000;
|
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