forked from 4TC-INSA-LYON/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestTC.js
38 lines (33 loc) · 815 Bytes
/
testTC.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var test = require('tape');
var request = (require('supertest'))('http://localhost:3000')
test('->Connexion', function(assert) {
request
.get('/user')
.expect(200)
.end( function(err, res) {
if (err) { throw err; }
assert.same(res.body.length, 21)
assert.end();
});
});
// test('->Insertion', function (assert) {
// request
// .post('/user')
// .send({"name": "toto"})
// .expect(200)
// .end( function(err, res) {
// if (err) { throw err; }
// assert.same(res.body, {})
// assert.end();
// });
// });
// test('->Get', function (assert) {
// request
// .get('/project/56a112e89ace319342ce09eb')
// .expect(200)
// .end( function(err, res) {
// if (err) { throw err; }
// assert.same(res.body.name, 'G9 Wotoy')
// assert.end();
// });
// });