mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-20 15:26:15 +08:00
added test that verified pb funbox check is working
This commit is contained in:
parent
985ef5959e
commit
895c6738cb
35
backend/__tests__/utils/pb.spec.ts
Normal file
35
backend/__tests__/utils/pb.spec.ts
Normal file
|
@ -0,0 +1,35 @@
|
|||
import _ from "lodash";
|
||||
import * as pb from "../../src/utils/pb";
|
||||
|
||||
describe("Pb Utils", () => {
|
||||
it("funboxCatGetPb", () => {
|
||||
const testCases = [
|
||||
{
|
||||
funbox: "plus_one",
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
funbox: "none",
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
funbox: "nausea#plus_one",
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
funbox: "arrows",
|
||||
expected: false,
|
||||
},
|
||||
];
|
||||
|
||||
_.each(testCases, (testCase) => {
|
||||
const { funbox, expected } = testCase;
|
||||
//@ts-ignore ignore because this expects a whole result object
|
||||
const result = pb.canFunboxGetPb({
|
||||
funbox,
|
||||
});
|
||||
|
||||
expect(result).toBe(expected);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -9,7 +9,7 @@ export default {
|
|||
global: {
|
||||
// These percentages should never decrease
|
||||
statements: 40,
|
||||
branches: 39,
|
||||
branches: 38,
|
||||
functions: 25,
|
||||
lines: 43,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue