mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-11 22:50:06 +00:00
fix: Ignore generated Vitest reports (no-changelog) (#40498)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
n8n-cat-bot[bot]
parent
a694531a03
commit
b1ec8e525c
@@ -41,6 +41,7 @@ build.log
|
||||
tcr-dry.log
|
||||
.agent-setup/
|
||||
.agent-recordings/
|
||||
.vitest/
|
||||
.vitest-profile/
|
||||
.pi-subagents/
|
||||
sbom-source.cdx.json
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { test } from 'node:test';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const repoRoot = fileURLToPath(new URL('..', import.meta.url));
|
||||
|
||||
function ignoreRule(path) {
|
||||
const result = spawnSync('git', ['check-ignore', '-v', '--no-index', '--', path], {
|
||||
cwd: repoRoot,
|
||||
encoding: 'utf8',
|
||||
});
|
||||
assert.ifError(result.error);
|
||||
assert.equal(result.status, 0, `${path} must be ignored by Git`);
|
||||
const [rule, ignoredPath] = result.stdout.trim().split('\t');
|
||||
assert.equal(ignoredPath, path);
|
||||
return rule;
|
||||
}
|
||||
|
||||
test('ignores existing Vitest profile output', () => {
|
||||
assert.match(
|
||||
ignoreRule('packages/cli/.vitest-profile/json/output.json'),
|
||||
/^\.gitignore:\d+:\.vitest-profile\/$/,
|
||||
);
|
||||
});
|
||||
|
||||
// DEVP-1240: Vitest 5 writes JSON reports into a package-local .vitest directory.
|
||||
test('ignores Vitest JSON reports in workspace packages', () => {
|
||||
for (const path of [
|
||||
'packages/cli/.vitest/json/output.json',
|
||||
'packages/frontend/editor-ui/.vitest/json/output.json',
|
||||
]) {
|
||||
assert.match(ignoreRule(path), /^\.gitignore:\d+:\.vitest\/$/);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user