.mocharc.yml
harmony: true
require: "./test/index.js"
file:
- "./test/init.js"
recursive: true
timeout: 60000
reporter: "spec"
exit: true
test/init.js
/* global afterEach, beforeEach */
beforeEach(async () => {});
afterEach(async () => {});
test/index.js
module.exports = require("supertest")(require("../app"));
test/blls/user.js
/* global describe, it */
const UserBll = require("server/blls/user");
const { expect } = require("chai");
describe("UserBll.list", function () {
it("#1 Users List", async () => {
const res = await UserBll.list(
{},
{ createdAt: -1 },
{ pageNum: 1, pageLimit: 10 }
);
expect(Array.isArray(res)).is.eql(true);
expect(res.length).is.eq(10);
});
});