···11+// eslint-disable-next-line ts/ban-ts-comment -- so that typecheck doesn't include it
22+// @ts-nocheck
33+export class DecoratorsTester {
44+ method(@SomeDecorator parameter: Something) {
55+ if (parameter) {
66+ // Covered line
77+ noop(parameter)
88+ }
99+1010+ if (parameter === 'uncovered') {
1111+ // Uncovered line
1212+ noop(parameter)
1313+ }
1414+ }
1515+}
1616+1717+function SomeDecorator(
1818+ _target: Object,
1919+ _propertyKey: string | symbol,
2020+ _parameterIndex: number,
2121+) {}
2222+2323+type Something = unknown
2424+2525+function noop(..._args: unknown[]) {
2626+2727+}
+5
test/coverage-test/test/coverage.test.ts
···77import { useImportEnv } from '../src/importEnv'
88import { second } from '../src/function-count'
99import MultiSuite from '../src/multi-suite'
1010+import { DecoratorsTester } from '../src/decorators'
10111112// @ts-expect-error -- untyped virtual file provided by custom plugin
1213import virtualFile2 from '\0vitest-custom-virtual-file-2'
···7172 expect(virtualFile1).toBe('This file should be excluded from coverage report #1')
7273 expect(virtualFile2).toBe('This file should be excluded from coverage report #2')
7374})
7575+7676+test('decorators', () => {
7777+ new DecoratorsTester().method('cover line')
7878+})
+2-2
test/coverage-test/testing.mjs
···88const isCI = process.env.GITHUB_ACTIONS
99process.env.COVERAGE_PROVIDER = provider
10101111-// TODO: Fix flakiness and enable on CI -- browser picks test files that don't exist and fails, some tests fail because of the multi environment mismatch
1212-if (isCI)
1111+// TODO: Fix flakiness and enable on CI -- browser picks test files that don't exist and fails, issue #5165
1212+if (isCI && isBrowser)
1313 process.exit(0)
14141515const poolConfigs = [