Skip to content

Commit

Permalink
tests: widgets-loader: Fix T type
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Apr 7, 2024
1 parent e3030ed commit d74584b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tests/libs/widgets-loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ test('Test mini-widgets exist', async () => {
* @param {T} enum_type Enum type with values as filenames
* @param {string} path_template Path template as string, where name should be used as filename
*/
async function enum_to_files_checker<T>(enum_type: T, path_template: string): Promise<void> {
async function enum_to_files_checker<T extends ArrayLike<unknown> | { [s: string]: unknown }>(
enum_type: T,
path_template: string
): Promise<void> {
const loader = await Promise.allSettled(
/* eslint-disable @typescript-eslint/no-unused-vars */
Object.values(enum_type).map((name) => import(eval('`' + path_template + '`'))) // Please, have marcy of my soul
Expand Down

0 comments on commit d74584b

Please sign in to comment.