mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
Fix test breaking due to chrome.* api
This commit is contained in:
@@ -3,10 +3,12 @@ import { shortCategoryName } from "./categoryUtils";
|
|||||||
import { GenericUtils } from "./genericUtils";
|
import { GenericUtils } from "./genericUtils";
|
||||||
import * as CompileConfig from "../../config.json";
|
import * as CompileConfig from "../../config.json";
|
||||||
|
|
||||||
|
const inTest = typeof chrome === "undefined";
|
||||||
|
|
||||||
const chapterNames = CompileConfig.categoryList.filter((code) => code !== "chapter")
|
const chapterNames = CompileConfig.categoryList.filter((code) => code !== "chapter")
|
||||||
.map((code) => ({
|
.map((code) => ({
|
||||||
code,
|
code,
|
||||||
name: chrome.i18n.getMessage("category_" + code)
|
name: !inTest ? chrome.i18n.getMessage("category_" + code) : code
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export function exportTimes(segments: SponsorTime[]): string {
|
export function exportTimes(segments: SponsorTime[]): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user