From e81afa875a52d107b20a8e21593845a4897a75fa Mon Sep 17 00:00:00 2001 From: Lexus Drumgold Date: Sun, 22 Oct 2023 20:01:13 -0400 Subject: [PATCH] chore(tests): [vitest] update reporters config logic Signed-off-by: Lexus Drumgold --- .gitignore | 2 +- package.json | 1 - vitest.config.ts | 9 ++++----- yarn.lock | 38 -------------------------------------- 4 files changed, 5 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index 3e10972..f3cf685 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,7 @@ yarn-error.log* # Testing # ------------------------------------------------------------------------------ **/*config.*.timestamp* -**/__tests__/report.json +**/__tests__/report.* **/coverage/ **/tsconfig*temp.json *.lcov diff --git a/package.json b/package.json index ed86006..a3a52b5 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,6 @@ "vite": "4.4.11", "vite-tsconfig-paths": "4.2.1", "vitest": "0.34.3", - "vitest-github-actions-reporter": "0.10.0", "yaml-eslint-parser": "1.2.2" }, "peerDependencies": { diff --git a/vitest.config.ts b/vitest.config.ts index 183c703..9d200d5 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -7,11 +7,10 @@ import { DECORATOR_REGEX } from '@flex-development/decorator-regex' import pathe from '@flex-development/pathe' import * as tscu from '@flex-development/tsconfig-utils' -import { split, type Nullable } from '@flex-development/tutils' +import { ifelse, sift, split, type Nullable } from '@flex-development/tutils' import ci from 'is-ci' import ts from 'typescript' import tsconfigpaths from 'vite-tsconfig-paths' -import GithubActionsReporter from 'vitest-github-actions-reporter' import { defineConfig, type UserConfig, @@ -129,11 +128,11 @@ const config: UserConfigExport = defineConfig((): UserConfig => { mockReset: true, outputFile: { json: './__tests__/report.json' }, passWithNoTests: true, - reporters: [ + reporters: sift([ 'json', 'verbose', - ci ? new GithubActionsReporter() : './__tests__/reporters/notifier.ts' - ], + ifelse(ci, '', './__tests__/reporters/notifier.ts') + ]), /** * Stores snapshots next to `file`'s directory. * diff --git a/yarn.lock b/yarn.lock index ae56f25..e9ff3b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,25 +12,6 @@ __metadata: languageName: node linkType: hard -"@actions/core@npm:^1.10.0": - version: 1.10.0 - resolution: "@actions/core@npm:1.10.0" - dependencies: - "@actions/http-client": "npm:^2.0.1" - uuid: "npm:^8.3.2" - checksum: 40f94a994da7b041ed35119abef9bbd19f56a75fdca08b0b7fd4af3da2c69873de5a751cf956cf1437515f4e9cf7ee94204a0c885788f6d0986841ee972ecb29 - languageName: node - linkType: hard - -"@actions/http-client@npm:^2.0.1": - version: 2.1.1 - resolution: "@actions/http-client@npm:2.1.1" - dependencies: - tunnel: "npm:^0.0.6" - checksum: 9bfc6b96c9426c8f633f227d2d781b5419a89a5bad502ed882691de29f7b9af01be4591caa6c89444b6bfc9ba1555bf7e77a121127a976de27fa5296d399eb3a - languageName: node - linkType: hard - "@ampproject/remapping@npm:^2.2.1": version: 2.2.1 resolution: "@ampproject/remapping@npm:2.2.1" @@ -1534,7 +1515,6 @@ __metadata: vite: "npm:4.4.11" vite-tsconfig-paths: "npm:4.2.1" vitest: "npm:0.34.3" - vitest-github-actions-reporter: "npm:0.10.0" yaml-eslint-parser: "npm:1.2.2" peerDependencies: "@nestjs/common": ">=10.0.0" @@ -8259,13 +8239,6 @@ __metadata: languageName: node linkType: hard -"tunnel@npm:^0.0.6": - version: 0.0.6 - resolution: "tunnel@npm:0.0.6" - checksum: cf1ffed5e67159b901a924dbf94c989f20b2b3b65649cfbbe4b6abb35955ce2cf7433b23498bdb2c5530ab185b82190fce531597b3b4a649f06a907fc8702405 - languageName: node - linkType: hard - "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -8651,17 +8624,6 @@ __metadata: languageName: node linkType: hard -"vitest-github-actions-reporter@npm:0.10.0": - version: 0.10.0 - resolution: "vitest-github-actions-reporter@npm:0.10.0" - dependencies: - "@actions/core": "npm:^1.10.0" - peerDependencies: - vitest: ">=0.28.5" - checksum: 454df415ccb5f79f8b8a598e1b37cacefd8b0125c8bdbf0216d15deb15c41661c1077adefcd3fc2ef00be6b4981e0e833197b204109f1d2bf178948010b0fcab - languageName: node - linkType: hard - "vitest@npm:0.34.3": version: 0.34.3 resolution: "vitest@npm:0.34.3"