You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rap2-delos/test/test.counter.js

25 lines
693 B
JavaScript

/* global describe, it */
const app = require('../scripts/app')
const request = require('supertest').agent(app.listen())
const should = require('chai').should()
const { mockUsers, prepare } = require('./helper')
describe('Counter', () => {
let users = mockUsers()
prepare(request, should, users)
it('/app/counter', done => {
request.get('/app/counter')
.expect('Content-Type', /json/)
.expect(200)
.end((err, res) => {
should.not.exist(err)
let { version, users, mock } = res.body.data
version.should.be.a('string').not.eq('')
users.should.be.a('number').above(0)
mock.should.be.a('number')
done()
})
})
})