Fix test breaking due to chrome.* api

This commit is contained in:
Ajay 2022-09-01 16:52:10 -04:00
parent 6631dfdea3
commit 015ac7d46e

View file

@ -3,10 +3,12 @@ import { shortCategoryName } from "./categoryUtils";
import { GenericUtils } from "./genericUtils";
import * as CompileConfig from "../../config.json";
const inTest = typeof chrome === "undefined";
const chapterNames = CompileConfig.categoryList.filter((code) => code !== "chapter")
.map((code) => ({
code,
name: chrome.i18n.getMessage("category_" + code)
name: !inTest ? chrome.i18n.getMessage("category_" + code) : code
}));
export function exportTimes(segments: SponsorTime[]): string {