mirror of
https://github.com/System-End/github-readme-stats.git
synced 2026-04-19 22:15:15 +00:00
test: add cache on error test
This commit is contained in:
parent
4df8094e52
commit
f0f92c2635
1 changed files with 10 additions and 0 deletions
|
|
@ -174,6 +174,16 @@ describe("Test /api/", () => {
|
|||
]);
|
||||
});
|
||||
|
||||
it("should not store cache when error", async () => {
|
||||
const { req, res } = faker({}, error);
|
||||
await api(req, res);
|
||||
|
||||
expect(res.setHeader.mock.calls).toEqual([
|
||||
["Content-Type", "image/svg+xml"],
|
||||
["Cache-Control", `no-store`],
|
||||
]);
|
||||
});
|
||||
|
||||
it("should set proper cache with clamped values", async () => {
|
||||
{
|
||||
let { req, res } = faker({ cache_seconds: 200000 }, data);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue