From 015ac7d46efd666e7c13b7e464ee22a71437635a Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 1 Sep 2022 16:52:10 -0400 Subject: [PATCH] Fix test breaking due to chrome.* api --- src/utils/exporter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/exporter.ts b/src/utils/exporter.ts index 97422c9d..089ef782 100644 --- a/src/utils/exporter.ts +++ b/src/utils/exporter.ts @@ -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 {