all files / modules/extensions/__tests__/ statusText-test.js

100% Statements 16/16
100% Branches 0/0
100% Functions 8/8
100% Lines 16/16
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    56×     56×     56× 56× 56×     56× 56×            
/* jshint -W058 */
const expect = require("expect");
const mach = require("../../index");
const StatusCodes = require("../../StatusCodes");
 
describe("extensions/statusText", function () {
    beforeEach(function () {
        mach.extend(require("../statusText"));
    });
 
    describe("Connection#statusText", function () {
        let conn;
        beforeEach(function () {
            conn = new mach.Connection();
        });
 
        Object.keys(StatusCodes).forEach(function (status) {
            describe(`with status ${status}`, function () {
                beforeEach(function () {
                    conn.status = status;
                });
 
                it("has the correct statusText", function () {
                    expect(conn.statusText).toEqual(`${status} ${StatusCodes[status]}`);
                });
            });
        });
    });
});