Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 5f7452f

Browse files
author
Bowden Kelly
authored
Merge pull request #53 from alan-agius4/feature/bump=deps
feat(*): update several dependencies
2 parents d10b2c6 + 5689081 commit 5f7452f

File tree

8 files changed

+5185
-4071
lines changed

8 files changed

+5185
-4071
lines changed

package-lock.json

+5,131-4,024
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+30-28
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
},
2727
"jest": {
2828
"globals": {
29-
"__TS_CONFIG__": "tsconfig.json"
29+
"ts-jest": {
30+
"tsConfigFile": "tsconfig.json"
31+
}
3032
},
3133
"moduleFileExtensions": [
3234
"ts",
@@ -41,59 +43,59 @@
4143
"testEnvironment": "node"
4244
},
4345
"dependencies": {
44-
"async": "^2.1.2",
46+
"async": "^2.5.0",
4547
"bcrypt-nodejs": "^0.0.3",
46-
"body-parser": "^1.15.2",
47-
"compression": "^1.6.2",
48+
"body-parser": "^1.18.2",
49+
"compression": "^1.7.1",
4850
"connect-mongo": "^1.3.2",
4951
"dotenv": "^2.0.0",
50-
"errorhandler": "^1.4.3",
51-
"express": "^4.14.0",
52-
"express-flash": "^0.0.2",
53-
"express-session": "^1.14.2",
54-
"express-validator": "^3.1.3",
55-
"fbgraph": "^1.3.0",
52+
"errorhandler": "^1.5.0",
53+
"express": "^4.16.2",
54+
"express-flash": "0.0.2",
55+
"express-session": "^1.15.6",
56+
"express-validator": "^4.2.1",
57+
"fbgraph": "^1.4.1",
5658
"lodash": "^4.17.4",
57-
"lusca": "^1.4.1",
58-
"mongoose": "^4.6.6",
59-
"morgan": "^1.7.0",
60-
"nodemailer": "^2.6.4",
61-
"passport": "0.3.2",
59+
"lusca": "^1.5.2",
60+
"mongoose": "^4.12.4",
61+
"morgan": "^1.9.0",
62+
"nodemailer": "^2.7.2",
63+
"passport": "^0.4.0",
6264
"passport-facebook": "^2.1.1",
6365
"passport-local": "^1.0.0",
64-
"pug": "^2.0.0-beta6",
65-
"request": "^2.78.0"
66+
"pug": "^2.0.0-rc.4",
67+
"request": "^2.83.0"
6668
},
6769
"devDependencies": {
6870
"@types/async": "^2.0.40",
6971
"@types/bcrypt-nodejs": "0.0.30",
7072
"@types/body-parser": "^1.16.2",
7173
"@types/compression": "0.0.33",
72-
"@types/connect-mongo": "0.0.32",
74+
"@types/connect-mongo": "0.0.34",
7375
"@types/dotenv": "^2.0.20",
74-
"@types/errorhandler": "0.0.30",
76+
"@types/errorhandler": "0.0.32",
7577
"@types/express": "^4.0.35",
76-
"@types/express-session": "0.0.32",
77-
"@types/jest": "^19.2.2",
78-
"@types/jquery": "^2.0.41",
79-
"@types/lodash": "^4.14.63",
80-
"@types/mongodb": "^2.1.43",
78+
"@types/express-session": "^1.15.5",
79+
"@types/jest": "^21.1.5",
80+
"@types/jquery": "^3.2.15",
81+
"@types/lodash": "^4.14.80",
82+
"@types/mongodb": "^2.2.15",
8183
"@types/mongoose": "^4.7.9",
8284
"@types/morgan": "^1.7.32",
8385
"@types/node": "^7.0.12",
8486
"@types/nodemailer": "^1.3.32",
8587
"@types/passport": "^0.3.3",
8688
"@types/passport-facebook": "^2.1.3",
87-
"@types/request": "0.0.45",
89+
"@types/request": "^2.0.7",
8890
"@types/supertest": "^2.0.0",
8991
"concurrently": "^3.4.0",
90-
"jest": "^19.0.2",
92+
"jest": "^21.2.1",
9193
"node-sass": "^4.5.2",
9294
"nodemon": "^1.11.0",
9395
"shelljs": "^0.7.7",
9496
"supertest": "^2.0.1",
95-
"ts-jest": "^19.0.8",
96-
"tslint": "^5.0.0",
97+
"ts-jest": "^21.1.4",
98+
"tslint": "^5.8.0",
9799
"typescript": "^2.4.0"
98100
}
99101
}

src/server.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import * as express from "express";
55
import * as compression from "compression"; // compresses requests
66
import * as session from "express-session";
7+
import * as expressValidator from "express-validator";
78
import * as bodyParser from "body-parser";
89
import * as logger from "morgan";
910
import * as errorHandler from "errorhandler";
@@ -14,7 +15,6 @@ import * as flash from "express-flash";
1415
import * as path from "path";
1516
import * as mongoose from "mongoose";
1617
import * as passport from "passport";
17-
import expressValidator = require("express-validator");
1818

1919

2020
const MongoStore = mongo(session);
@@ -47,8 +47,9 @@ const app = express();
4747
* Connect to MongoDB.
4848
*/
4949
// mongoose.Promise = global.Promise;
50-
mongoose.connect(process.env.MONGODB_URI || process.env.MONGOLAB_URI);
51-
50+
mongoose.connect(process.env.MONGODB_URI || process.env.MONGOLAB_URI, {
51+
useMongoClient: true
52+
});
5253
mongoose.connection.on("error", () => {
5354
console.log("MongoDB connection error. Please make sure MongoDB is running.");
5455
process.exit();
@@ -88,13 +89,13 @@ app.use((req, res, next) => {
8889
app.use((req, res, next) => {
8990
// After successful login, redirect back to the intended page
9091
if (!req.user &&
91-
req.path !== "/login" &&
92-
req.path !== "/signup" &&
93-
!req.path.match(/^\/auth/) &&
94-
!req.path.match(/\./)) {
92+
req.path !== "/login" &&
93+
req.path !== "/signup" &&
94+
!req.path.match(/^\/auth/) &&
95+
!req.path.match(/\./)) {
9596
req.session.returnTo = req.path;
9697
} else if (req.user &&
97-
req.path == "/account") {
98+
req.path == "/account") {
9899
req.session.returnTo = req.path;
99100
}
100101
next();

test/api.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import {} from 'jest';
21
import * as supertest from "supertest";
3-
4-
const request = supertest("http://localhost:8000");
2+
import * as app from "../src/server";
53

64
describe("GET /api", () => {
5+
const request = supertest(app);
6+
77
it("should return 200 OK", () => {
88
request
99
.get("/api")

test/app.test.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import {} from 'jest';
21
import * as supertest from "supertest";
3-
const request = supertest("http://localhost:8000");
2+
import * as app from "../src/server";
43

54
describe("GET /random-url", () => {
5+
const request = supertest(app);
6+
67
it("should return 404", (done) => {
78
request.get("/reset")
89
.expect(404, done);

test/contact.test.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import {} from 'jest';
21
import * as supertest from "supertest";
3-
const request = supertest("http://localhost:8000");
2+
import * as app from "../src/server";
43

54
describe("GET /contact", () => {
5+
const request = supertest(app);
6+
67
it("should return 200 OK", (done) => {
78
request.get("/contact")
89
.expect(200, done);

test/home.test.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import {} from 'jest';
21
import * as supertest from "supertest";
3-
const request = supertest("http://localhost:8000");
2+
import * as app from "../src/server";
43

54
describe("GET /", () => {
5+
const request = supertest(app);
6+
67
it("should return 200 OK", (done) => {
78
request.get("/")
89
.expect(200, done);

test/user.test.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import {} from 'jest';
21
import * as supertest from "supertest";
3-
const request = supertest("http://localhost:8000");
2+
import * as app from "../src/server";
3+
4+
const request = supertest(app);
45

56
describe("GET /login", () => {
67
it("should return 200 OK", (done) => {

0 commit comments

Comments
 (0)