mirror of
https://github.com/Aviortheking/IMIE_CQ.git
synced 2025-04-22 19:02:13 +00:00
Ajout du premier test IndexController => A toi de jouer floflo
This commit is contained in:
parent
7e6b55c1cb
commit
edc96ab216
6
.prettierrc.json
Normal file
6
.prettierrc.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"trailingComma": "es5",
|
||||
"tabWidth": 4,
|
||||
"semi": false,
|
||||
"singleQuote": true
|
||||
}
|
366
package-lock.json
generated
366
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node ./bin/www",
|
||||
"test": "mocha"
|
||||
"test": "mocha --recursive --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"cookie-parser": "~1.4.4",
|
||||
@ -15,7 +15,9 @@
|
||||
"pug": "2.0.0-beta11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"assert": "^2.0.0",
|
||||
"mocha": "^8.0.1",
|
||||
"nodemon": "^2.0.4"
|
||||
"nodemon": "^2.0.4",
|
||||
"prettier": "2.0.5"
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
var express = require("express");
|
||||
var router = express.Router();
|
||||
var express = require('express')
|
||||
var router = express.Router()
|
||||
|
||||
/* GET home page. */
|
||||
router.get("/", function (req, res, next) {
|
||||
res.render("index", { title: "Express" });
|
||||
});
|
||||
router.get('/', function (req, res, next) {
|
||||
res.render('index', { title: 'Express' })
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
26
test/test.js
26
test/test.js
@ -0,0 +1,26 @@
|
||||
const assert = require('assert')
|
||||
|
||||
describe("Test de l'index.js", () => {
|
||||
it("Doit retourner une réponse 'SoftWare Quality Module'", () => {
|
||||
// Arrange
|
||||
|
||||
const data = 'SoftWare Quality Module'
|
||||
const indexController = new IndexController()
|
||||
let result = null
|
||||
|
||||
const req = {}
|
||||
const res = {
|
||||
send: (value) => {
|
||||
result = value
|
||||
},
|
||||
}
|
||||
|
||||
// Act
|
||||
|
||||
indexController.index(req, res)
|
||||
|
||||
// Assert
|
||||
|
||||
assert.equal(result, data)
|
||||
})
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user