From d97382c80136d75f35d29eddf5c8268272d47622 Mon Sep 17 00:00:00 2001 From: Patrick Hallisey Date: Wed, 23 Oct 2024 17:31:47 -0700 Subject: [PATCH] Add files and config for npm test --- .../emitter/vitest.config.ts | 20 +++++++++++++++++++ eng/packages/http-client-csharp/package.json | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 eng/packages/http-client-csharp/emitter/vitest.config.ts diff --git a/eng/packages/http-client-csharp/emitter/vitest.config.ts b/eng/packages/http-client-csharp/emitter/vitest.config.ts new file mode 100644 index 0000000000000..cf30d605a3032 --- /dev/null +++ b/eng/packages/http-client-csharp/emitter/vitest.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + environment: "node", + isolate: false, + coverage: { + reporter: ["cobertura", "json", "text"], + }, + outputFile: { + junit: "./test-results.xml", + }, + exclude: ["node_modules", "dist/test"], + }, + server: { + watch: { + ignored: [], + }, + }, +}); \ No newline at end of file diff --git a/eng/packages/http-client-csharp/package.json b/eng/packages/http-client-csharp/package.json index 19f2c42ca97d1..739d9578c8da4 100644 --- a/eng/packages/http-client-csharp/package.json +++ b/eng/packages/http-client-csharp/package.json @@ -11,7 +11,7 @@ "build:emitter": "tsc -p ./emitter/tsconfig.build.json", "build:generator": "dotnet build ./generator && copyfiles -u 5 ./node_modules/@typespec/http-client-csharp/dist/generator/Microsoft.Generator.CSharp.runtimeconfig.json ./dist/generator", "build": "npm run build:emitter && npm run build:generator", - "test:emitter": "vitest run -c ./emitter/vitest.config.ts", + "test:emitter": "vitest run -c ./emitter/vitest.config.ts --passWithNoTests", "test:generator": "dotnet test ./generator --logger \"trx;LogFileName=debug.trx\"", "test": "npm run test:generator && npm run test:emitter", "lint": "eslint . --max-warnings=0",