Skip to content

Commit

Permalink
Add "everything is disabled" test
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn committed Jan 18, 2021
1 parent 8b62b6d commit 3333caa
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@ describe("helmet", () => {
});
});

it("works with all middlewares disabled", async () => {
await check(
helmet({
contentSecurityPolicy: false,
dnsPrefetchControl: false,
expectCt: false,
frameguard: false,
hidePoweredBy: false,
hsts: false,
ieNoOpen: false,
noSniff: false,
originAgentCluster: false,
permittedCrossDomainPolicies: false,
referrerPolicy: false,
xssFilter: false,
}),
{
"content-security-policy": null,
"x-frame-options": null,
}
);
});

it("errors when `use`d directly", () => {
const fakeRequest = {
constructor: {
Expand Down

0 comments on commit 3333caa

Please sign in to comment.