From 12d1026ac5132f9a7ca949f919d6540ae2a8e3ae Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Tue, 12 Mar 2024 21:45:32 +0900 Subject: [PATCH] feat: add `vitest-dev/vscode` (#12) --- .github/workflows/ecosystem-ci-from-pr.yml | 2 ++ .github/workflows/ecosystem-ci-selected.yml | 1 + .github/workflows/ecosystem-ci.yml | 1 + tests/vitest-vscode.ts | 20 ++++++++++++++++++++ 4 files changed, 24 insertions(+) create mode 100644 tests/vitest-vscode.ts diff --git a/.github/workflows/ecosystem-ci-from-pr.yml b/.github/workflows/ecosystem-ci-from-pr.yml index 88989bd..a2541dd 100644 --- a/.github/workflows/ecosystem-ci-from-pr.yml +++ b/.github/workflows/ecosystem-ci-from-pr.yml @@ -32,6 +32,7 @@ on: - nuxt - nuxt-test-utils - vite + - vitest-vscode - vitest-sonar-reporter - vitest-github-actions-reporter - vitest-browser-simple @@ -100,6 +101,7 @@ jobs: - nuxt - nuxt-test-utils - vite + - vitest-vscode - vitest-sonar-reporter - vitest-github-actions-reporter - vitest-browser-simple diff --git a/.github/workflows/ecosystem-ci-selected.yml b/.github/workflows/ecosystem-ci-selected.yml index bcf9ff8..acbb0b0 100644 --- a/.github/workflows/ecosystem-ci-selected.yml +++ b/.github/workflows/ecosystem-ci-selected.yml @@ -37,6 +37,7 @@ on: - nuxt - nuxt-test-utils - vite + - vitest-vscode - vitest-sonar-reporter - vitest-github-actions-reporter - vitest-browser-simple diff --git a/.github/workflows/ecosystem-ci.yml b/.github/workflows/ecosystem-ci.yml index 753121d..6aa71fa 100644 --- a/.github/workflows/ecosystem-ci.yml +++ b/.github/workflows/ecosystem-ci.yml @@ -43,6 +43,7 @@ jobs: - nuxt - nuxt-test-utils - vite + - vitest-vscode - vitest-sonar-reporter - vitest-github-actions-reporter - vitest-browser-simple diff --git a/tests/vitest-vscode.ts b/tests/vitest-vscode.ts new file mode 100644 index 0000000..8ff957f --- /dev/null +++ b/tests/vitest-vscode.ts @@ -0,0 +1,20 @@ +import { runInRepo, $ } from '../utils' +import { RunOptions } from '../types' +import process from 'node:process' + +export async function test(options: RunOptions) { + await runInRepo({ + ...options, + repo: 'vitest-dev/vscode', + build: 'compile', + test: async () => { + if (process.env.CI === 'true' && process.platform === 'linux') { + await $`xvfb-run --auto-servernum --server-args=-screen\\ 0\\ 1024x768x24 pnpm test` + await $`xvfb-run --auto-servernum --server-args=-screen\\ 0\\ 1024x768x24 pnpm test-e2e --retry 2` + } else { + await $`pnpm test` + await $`pnpm test-e2e` + } + }, + }) +}