import { TestSuite } from '../test-suite'; type CommonOptions = { only?: boolean; skip?: boolean; concurrent?: boolean; timeout?: number; todo?: boolean; }; type ArgumentPassOptions = { each: Arguments; name: string; } | { name?: string; each?: never; }; export type MethodName = string | symbol; export type Options = ArgumentPassOptions & CommonOptions; export type Method = (...args: Arguments) => Promise | void; export function Test(options: Options = {}): MethodDecorator { return ( target: Object, propertyKey: MethodName, ): void => { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition const map = (target as TestSuite).testsMap || new Map(); map.set(propertyKey, options); (target as TestSuite).testsMap = map; }; }