1
0
Fork 0

Update packages and tests

This commit is contained in:
Ethanell 2020-11-02 13:53:42 +01:00
parent 1e0896754d
commit 97e4008c56
4 changed files with 86 additions and 62 deletions

View file

@ -1,8 +1,18 @@
image: node:latest image: node:alpine
stages:
- prepare
- test
services: services:
- postgres:latest - postgres:latest
cache:
untracked: true
key: $CI_COMMIT_REF_SLUG
paths:
- node_modules/
variables: variables:
POSTGRES_DB: "letu" POSTGRES_DB: "letu"
POSTGRES_USER: "letu" POSTGRES_USER: "letu"
@ -10,7 +20,17 @@ variables:
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
NODE_ENV: "test" NODE_ENV: "test"
all_tests: install_requirements:
stage: prepare
script: script:
- apk add --no-cache python make g++
- npm config set registry http://registry.npmjs.org/
- npm install - npm install
artifacts:
paths:
- node_modules/
tests:
stage: test
script:
- npm test - npm test

113
package-lock.json generated
View file

@ -18,9 +18,9 @@
} }
}, },
"@types/node": { "@types/node": {
"version": "14.0.11", "version": "14.14.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.11.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz",
"integrity": "sha512-lCvvI24L21ZVeIiyIUHZ5Oflv1hhHQ5E1S25IRlKIXaRkVgmXpJMI3wUJkmym2bTbCe+WoIibQnMVAU3FguaOg==" "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw=="
}, },
"abbrev": { "abbrev": {
"version": "1.1.1", "version": "1.1.1",
@ -1772,9 +1772,9 @@
} }
}, },
"lodash": { "lodash": {
"version": "4.17.15", "version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
}, },
"log-symbols": { "log-symbols": {
"version": "3.0.0", "version": "3.0.0",
@ -2047,9 +2047,9 @@
} }
}, },
"moment": { "moment": {
"version": "2.26.0", "version": "2.29.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
"integrity": "sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw==" "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
}, },
"moment-timezone": { "moment-timezone": {
"version": "0.5.31", "version": "0.5.31",
@ -2501,31 +2501,23 @@
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
}, },
"pg": { "pg": {
"version": "8.2.1", "version": "8.4.2",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.2.1.tgz", "resolved": "https://registry.npmjs.org/pg/-/pg-8.4.2.tgz",
"integrity": "sha512-DKzffhpkWRr9jx7vKxA+ur79KG+SKw+PdjMb1IRhMiKI9zqYUGczwFprqy+5Veh/DCcFs1Y6V8lRLN5I1DlleQ==", "integrity": "sha512-E9FlUrrc7w3+sbRmL1CSw99vifACzB2TjhMM9J5w9D1LIg+6un0jKkpHS1EQf2CWhKhec2bhrBLVMmUBDbjPRQ==",
"requires": { "requires": {
"buffer-writer": "2.0.0", "buffer-writer": "2.0.0",
"packet-reader": "1.0.0", "packet-reader": "1.0.0",
"pg-connection-string": "^2.2.3", "pg-connection-string": "^2.4.0",
"pg-pool": "^3.2.1", "pg-pool": "^3.2.2",
"pg-protocol": "^1.2.4", "pg-protocol": "^1.3.0",
"pg-types": "^2.1.0", "pg-types": "^2.1.0",
"pgpass": "1.x", "pgpass": "1.x"
"semver": "4.3.2"
},
"dependencies": {
"semver": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz",
"integrity": "sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c="
}
} }
}, },
"pg-connection-string": { "pg-connection-string": {
"version": "2.2.3", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.2.3.tgz", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.4.0.tgz",
"integrity": "sha512-I/KCSQGmOrZx6sMHXkOs2MjddrYcqpza3Dtsy0AjIgBr/bZiPJRK9WhABXN1Uy1UDazRbi9gZEzO2sAhL5EqiQ==" "integrity": "sha512-3iBXuv7XKvxeMrIgym7njT+HlZkwZqqGX4Bu9cci8xHZNT+Um1gWKqCsAzcC0d95rcKMU5WBg6YRUcHyV0HZKQ=="
}, },
"pg-int8": { "pg-int8": {
"version": "1.0.1", "version": "1.0.1",
@ -2533,14 +2525,14 @@
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==" "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw=="
}, },
"pg-pool": { "pg-pool": {
"version": "3.2.1", "version": "3.2.2",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.2.1.tgz", "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.2.2.tgz",
"integrity": "sha512-BQDPWUeKenVrMMDN9opfns/kZo4lxmSWhIqo+cSAF7+lfi9ZclQbr9vfnlNaPr8wYF3UYjm5X0yPAhbcgqNOdA==" "integrity": "sha512-ORJoFxAlmmros8igi608iVEbQNNZlp89diFVx6yV5v+ehmpMY9sK6QgpmgoXbmkNaBAx8cOOZh9g80kJv1ooyA=="
}, },
"pg-protocol": { "pg-protocol": {
"version": "1.2.4", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.2.4.tgz", "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.3.0.tgz",
"integrity": "sha512-/8L/G+vW/VhWjTGXpGh8XVkXOFx1ZDY+Yuz//Ab8CfjInzFkreI+fDG3WjCeSra7fIZwAFxzbGptNbm8xSXenw==" "integrity": "sha512-64/bYByMrhWULUaCd+6/72c9PMWhiVFs3EVxl9Ct6a3v/U8+rKgqP2w+kKg/BIGgMJyB+Bk/eNivT32Al+Jghw=="
}, },
"pg-types": { "pg-types": {
"version": "2.2.0", "version": "2.2.0",
@ -2555,11 +2547,11 @@
} }
}, },
"pgpass": { "pgpass": {
"version": "1.0.2", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.2.tgz", "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.4.tgz",
"integrity": "sha1-Knu0G2BltnkH6R2hsHwYR8h3swY=", "integrity": "sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==",
"requires": { "requires": {
"split": "^1.0.0" "split2": "^3.1.1"
} }
}, },
"picomatch": { "picomatch": {
@ -2597,9 +2589,9 @@
"integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU=" "integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU="
}, },
"postgres-date": { "postgres-date": {
"version": "1.0.5", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.5.tgz", "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
"integrity": "sha512-pdau6GRPERdAYUQwkBnGKxEfPyhVZXG/JiS44iZWiNdSOWE09N2lUgN6yshuq6fVSon4Pm0VMXd1srUUkLe9iA==" "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q=="
}, },
"postgres-interval": { "postgres-interval": {
"version": "1.2.0", "version": "1.2.0",
@ -3003,9 +2995,9 @@
} }
}, },
"sequelize": { "sequelize": {
"version": "5.21.12", "version": "5.22.3",
"resolved": "https://registry.npmjs.org/sequelize/-/sequelize-5.21.12.tgz", "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-5.22.3.tgz",
"integrity": "sha512-WRTXLoH72HQnlEUbKI1Iev2yS1/epg72Chz0fHqk0MLn4Wj2pH/TS01lpMDGQqxZPXCxRGrwk1YxwUw2C0yI9A==", "integrity": "sha512-+nxf4TzdrB+PRmoWhR05TP9ukLAurK7qtKcIFv5Vhxm5Z9v+d2PcTT6Ea3YAoIQVkZ47QlT9XWAIUevMT/3l8Q==",
"requires": { "requires": {
"bluebird": "^3.5.0", "bluebird": "^3.5.0",
"cls-bluebird": "^2.1.0", "cls-bluebird": "^2.1.0",
@ -3025,11 +3017,11 @@
}, },
"dependencies": { "dependencies": {
"debug": { "debug": {
"version": "4.1.1", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
"requires": { "requires": {
"ms": "^2.1.1" "ms": "2.1.2"
} }
}, },
"ms": { "ms": {
@ -3265,12 +3257,24 @@
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz",
"integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q=="
}, },
"split": { "split2": {
"version": "1.0.1", "version": "3.2.2",
"resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz",
"integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==",
"requires": { "requires": {
"through": "2" "readable-stream": "^3.0.0"
},
"dependencies": {
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
}
} }
}, },
"sprintf-js": { "sprintf-js": {
@ -3516,11 +3520,6 @@
"inherits": "2" "inherits": "2"
} }
}, },
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"timers-ext": { "timers-ext": {
"version": "0.1.7", "version": "0.1.7",
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz",

View file

@ -4,7 +4,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"start": "node ./bin/www", "start": "node ./bin/www",
"test": "NODE_ENV=test mocha" "test": "NODE_ENV=test ./node_modules/mocha/bin/mocha"
}, },
"dependencies": { "dependencies": {
"cookie-parser": "~1.4.4", "cookie-parser": "~1.4.4",
@ -15,9 +15,9 @@
"http-errors": "~1.6.3", "http-errors": "~1.6.3",
"morgan": "~1.9.1", "morgan": "~1.9.1",
"node-sass-middleware": "0.11.0", "node-sass-middleware": "0.11.0",
"pg": "^8.2.1", "pg": "^8.4.2",
"pug": "2.0.0-beta11", "pug": "2.0.0-beta11",
"sequelize": "^5.21.12", "sequelize": "^5.22.3",
"sequelize-cli": "^5.5.1", "sequelize-cli": "^5.5.1",
"socket.io": "^2.3.0" "socket.io": "^2.3.0"
}, },

View file

@ -25,6 +25,11 @@ before(async () => {
it("Main page content", async () => { it("Main page content", async () => {
await request(app) await request(app)
.get("/") .get("/")
.expect(302);
});
it("Login page content", async () => {
await request(app)
.get("/login")
.expect(200); .expect(200);
}); });