Skip to content

Commit

Permalink
Delete unnecessary files and required files, add new router test
Browse files Browse the repository at this point in the history
  • Loading branch information
renatadev committed Dec 19, 2019
1 parent 12b7d1a commit b6422f6
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 16 deletions.
5 changes: 1 addition & 4 deletions public/styles/index.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* index.css */

:root {
spacing variables: golden ratio */
/* spacing variables: golden ratio */
--space-xs: 0.382rem;
--space-s: 0.618rem;
--space-m: 1rem;
Expand All @@ -15,10 +15,8 @@ body {
flex-direction: column;
background-image: url("../librarybg.jpeg");
background-size: cover;

justify-content: center;
border: black solid;

font-size: var(--space-l);
font-weight: bold;
}
Expand All @@ -40,7 +38,6 @@ header {
background-color: rgba(255, 255, 255, 0.9);
margin: 5rem;
padding: 1rem;

font-family: 'Cutive Mono', monospace;
}

Expand Down
4 changes: 1 addition & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const favicon = require('serve-favicon');
const bodyParser = require('body-parser');
const exphbs = require('express-handlebars');
const controllers = require('./controllers/index');
const helpers = require('./views/helpers/index');

const app = express();

Expand All @@ -16,8 +15,7 @@ app.engine(
extname: 'hbs',
layoutsDir: path.join(__dirname, 'views', 'layouts'),
partialsDir: path.join(__dirname, 'views', 'partials'),
defaultLayout: 'main',
helpers,
defaultLayout: 'main'
})
);

Expand Down
2 changes: 0 additions & 2 deletions src/controllers/errors.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const path = require('path');

exports.client = (req, res) => {
res.status(404).render('404', {
statusCode: 404,
Expand Down
2 changes: 0 additions & 2 deletions src/controllers/home.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const path = require('path');

exports.get = (request, response) => {
response.render('home');
};
1 change: 0 additions & 1 deletion src/controllers/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const express = require("express");
const path = require("path");
const router = express.Router();

// importing route controllers
Expand Down
2 changes: 0 additions & 2 deletions src/controllers/resource.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const path = require('path');
const express = require('express');
const db = require('../model/queries/index');

exports.post = (request, response) => {
Expand Down
1 change: 0 additions & 1 deletion src/views/helpers/index.js

This file was deleted.

Empty file removed src/views/helpers/updateTable.js
Empty file.
1 change: 0 additions & 1 deletion tests/index.test.js

This file was deleted.

11 changes: 11 additions & 0 deletions tests/routes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,14 @@ test("Test 404 error is being served correctly", t => {
t.end();
});
});

test('Testing endpoint /library/:language', t => {
request(app)
.get('/library/html')
.expect(200)
.end((err, res) => {
t.error(err, 'Error is null');
t.equals(res.statusCode, 200, 'Should return a 200 status code');
t.end();
});
});

0 comments on commit b6422f6

Please sign in to comment.