all files / blackbird/modules/middleware/__tests__/ favicon-test.js

93.33% Statements 14/15
100% Branches 0/0
87.5% Functions 7/8
93.33% Lines 14/15
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                          
const {expect} = require("chai");
const should = require("chai").should();
const callApp = require("../../utils/callApp");
const favicon = require("../favicon");
 
function ok() {
    return 200;
}
 
describe("middleware/favicon", function () {
    describe("when /favicon.ico is requested", function () {
        it("returns 404", function () {
            return callApp(favicon(ok), "/favicon.ico").then(function (conn) {
                expect(conn.status).to.equal(404);
            });
        });
    });
 
    describe("when /favicon.ico?a=b is requested", function () {
        it("returns 404", function () {
            return callApp(favicon(ok), "/favicon.ico?a=b").then(function (conn) {
                expect(conn.status).to.equal(404);
            });
        });
    });
});