Skip to content

Commit

Permalink
test coverage for issue bitburner-official#1693 - API: skillMaxUpgrad…
Browse files Browse the repository at this point in the history
…eCount returns 1 when SP is too small and current level is too high
  • Loading branch information
Alpheus committed Oct 23, 2024
1 parent b72c03a commit b63c07d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/jest/Netscript/Bladeburner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BladeburnerSkillName } from "../../../src/Enums";
import { PositiveInteger, isPositiveInteger, isPositiveNumber } from "../../../src/types";
import { randomInRange } from "../../../src/utils/helpers/randomInRange";
import { getRandomIntInclusive } from "../../../src/utils/helpers/getRandomIntInclusive";
import { Skills } from "../../../src/Bladeburner/data/Skills";

const skill = new Skill({
name: BladeburnerSkillName.Hyperdrive,
Expand All @@ -14,6 +15,18 @@ const skill = new Skill({
});

describe("Test calculateMaxUpgradeCount", function () {
it.failing("Bug: Returns 1 when SP is too small and current level is too high", () => {
expect(Skills.Hyperdrive.calculateMaxUpgradeCount(1e50, 1)).toBe(0);
});

it.failing("Bug: Returns 1 when SP is too small and current level is too high", () => {
expect(Skills.Hyperdrive.calculateMaxUpgradeCount(1e50, Number.MAX_SAFE_INTEGER)).toBe(0);
});

it.failing("Bug: Returns Infinity when SP is large enough and current level is too high", () => {
expect(Number.isFinite(Skills.Hyperdrive.calculateMaxUpgradeCount(1e50, Number.MAX_VALUE))).toBeTruthy();
});

test("errorCount", () => {
let testCaseCount = 0;
let errorCount = 0;
Expand Down

0 comments on commit b63c07d

Please sign in to comment.