Skip to content

Commit

Permalink
Fix coverage reporting for dynamic import
Browse files Browse the repository at this point in the history
Not sure why this works, but it does.
  • Loading branch information
caleb531 committed Jan 10, 2024
1 parent 05e415f commit 8fe3d8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ export function buildBibleReferenceFromID(
}

export async function getBibleData(language = 'eng'): Promise<BibleData> {
return import(`./data/bible/bible-${language}.json`);
// Apparently, using string concatenation (instead of a template literal)
// fixes the ability for the coverage reporter to see this dynamic import as
// properly covered
return import('./data/bible/bible-' + language + '.json');
}

export async function getBibleBookMetadata(): Promise<Record<string, BibleBookMetadata>> {
Expand Down

0 comments on commit 8fe3d8c

Please sign in to comment.