diff --git a/test/fixtures/custom-data-test.js b/test/fixtures/custom-data-test.js deleted file mode 100644 index be2cd14c53..0000000000 --- a/test/fixtures/custom-data-test.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2023 Yomitan Authors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -import {test} from 'vitest'; - -/** - * @template [TCustomData=unknown] - * @param {() => (TCustomData|Promise)} createCustomData - * @param {(data: TCustomData) => (void|Promise)} [disposeCustomData] - * @returns {import('vitest').TestAPI<{custom: {data: TCustomData}}>} - */ -export function createCustomDataTest(createCustomData, disposeCustomData) { - return test.extend({ - // eslint-disable-next-line no-empty-pattern - custom: async ({}, use) => { - const data = await createCustomData(); - await use({data}); - if (typeof disposeCustomData === 'function') { - disposeCustomData(data); - } - } - }); -}