Skip to content

Commit 5fc3879

Browse files
committed
update little types
1 parent 6c8f4ea commit 5fc3879

File tree

2 files changed

+4
-6
lines changed
  • packages/sv/lib
    • cli/tests/snapshots/@my-org/sv/tests/setup
    • create/templates/addon/tests/setup

2 files changed

+4
-6
lines changed

packages/sv/lib/cli/tests/snapshots/@my-org/sv/tests/setup/suite.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ const variants = vitest.inject('variants');
1717
* @param {object} addons - The addons to test
1818
* @param {object} [options] - Configuration options for test setup
1919
* @param {Array<object>} [options.kinds] - Array of addon test case kinds to generate. Each kind has `type` (string) and `options` (Object) properties.
20-
* @param {Function} [options.filter] - Optional filter function to exclude certain test cases. Receives an object with `variant` (string) and `kind` (Object) properties, returns boolean.
20+
* @param {(addonTestCase: { variant: string; kind: { type: string; options?: object } }) => boolean} [options.filter] - Optional filter function to exclude certain test cases. Receives an object with `variant` (string) and `kind` (Object) properties, returns boolean.
2121
* @param {boolean} [options.browser=true] - Whether to enable browser testing with Playwright
2222
* @param {Function} [options.preAdd] - Optional hook called before adding addons to each test case. Receives an object with `addonTestCase` (Object with `variant` and `kind`) and `cwd` (string) properties. May return Promise or void.
23-
* @returns {object} Object containing: `test` (Function) - The extended Vitest test function with fixtures; `testCases` (Array<object>) - Array of test cases, each with `variant` (string) and `kind` (Object) properties; `prepareServer` (Function) - Function to build and start preview server
23+
* @returns {{ test: import('vitest').TestAPI<{}>; testCases: Array<{ variant: string; kind: { type: string; options?: object } }>; prepareServer: (options: { cwd: string; page: import('@playwright/test').Page; buildCommand?: string; previewCommand?: string }) => Promise<{ url: string; close: Function }> }} Object containing: `test` - The extended Vitest test function with fixtures; `testCases` - Array of test cases, each with `variant` (string) and `kind` (Object) properties; `prepareServer` - Function to build and start preview server
2424
*/
2525
export function setupTest(addons, options) {
26-
/** @type {Function} */
2726
const test = vitest.test.extend({});
2827

2928
const withBrowser = options?.browser ?? true;

packages/sv/lib/create/templates/addon/tests/setup/suite.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ const variants = vitest.inject('variants');
1717
* @param {object} addons - The addons to test
1818
* @param {object} [options] - Configuration options for test setup
1919
* @param {Array<object>} [options.kinds] - Array of addon test case kinds to generate. Each kind has `type` (string) and `options` (Object) properties.
20-
* @param {Function} [options.filter] - Optional filter function to exclude certain test cases. Receives an object with `variant` (string) and `kind` (Object) properties, returns boolean.
20+
* @param {(addonTestCase: { variant: string; kind: { type: string; options?: object } }) => boolean} [options.filter] - Optional filter function to exclude certain test cases. Receives an object with `variant` (string) and `kind` (Object) properties, returns boolean.
2121
* @param {boolean} [options.browser=true] - Whether to enable browser testing with Playwright
2222
* @param {Function} [options.preAdd] - Optional hook called before adding addons to each test case. Receives an object with `addonTestCase` (Object with `variant` and `kind`) and `cwd` (string) properties. May return Promise or void.
23-
* @returns {object} Object containing: `test` (Function) - The extended Vitest test function with fixtures; `testCases` (Array<object>) - Array of test cases, each with `variant` (string) and `kind` (Object) properties; `prepareServer` (Function) - Function to build and start preview server
23+
* @returns {{ test: import('vitest').TestAPI<{}>; testCases: Array<{ variant: string; kind: { type: string; options?: object } }>; prepareServer: (options: { cwd: string; page: import('@playwright/test').Page; buildCommand?: string; previewCommand?: string }) => Promise<{ url: string; close: Function }> }} Object containing: `test` - The extended Vitest test function with fixtures; `testCases` - Array of test cases, each with `variant` (string) and `kind` (Object) properties; `prepareServer` - Function to build and start preview server
2424
*/
2525
export function setupTest(addons, options) {
26-
/** @type {Function} */
2726
const test = vitest.test.extend({});
2827

2928
const withBrowser = options?.browser ?? true;

0 commit comments

Comments
 (0)