Open rudyflores opened 2 months ago
I am experiencing the same behavior. Files are not excluded from coverage report (they are when c8 is called from command line instead)
@g-arjones I found doing this produced a better coverage report! But I wish there was a simpler way to have this setup since it still doesn't provide all the proper files:
import { defineConfig } from "@vscode/test-cli";
import { fileURLToPath } from "url";
import { dirname } from "path";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
/** @type {import('@vscode/test-cli').IConfigurationWithGlobalOptions} */
export default defineConfig({
/** @type {import('@vscode/test-cli').TestConfiguration[]} */
tests: [
{
files: "./__tests__/__integration__/out/**/*.test.js",
version: "stable",
extensionDevelopmentPath: __dirname,
workspaceFolder: `${__dirname}/__tests__/__integration__/resources`,
srcDir: "./__tests__/__integration__/out/src",
mocha: {
timeout: 5000,
},
},
],
coverage: {
exclude: [
`${__dirname}/out`,
`${__dirname}/__tests__/__integration__/out/__tests__`,
],
},
});
Yep. That does work indeed.
is there any update?
Any update on this?
I have a extension that is packed with webpack and it gives me the dist
folder in my coverage, even if I try to exclude the folder via any of the following dist
patterns
import { defineConfig } from "@vscode/test-cli";
export default defineConfig({
files: ["out/test/suite/**/*.test.js"],
version: "insiders",
workspaceFolder: "./out/temp/workspace",
launchArgs: ["--disable-extensions", "--profile-temp"],
coverage: {
exclude: ["dist", "**/dist/**", /dist/],
},
});
used vscode-test-cli version: 0.0.10
I have the following configuration file:
And I am unable to generate a coverage report that excludes my node_modules event though I specifically mention to exclude those in
coverage.exclude
any idea if i'm missing something in my configuration?