jjmschofield/github-codeowners

View on GitHub
src/commands/__snapshots__/audit.test.int.ts.snap

Summary

Maintainability
Test Coverage
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`audit csv should calculate stats when asked: stderr 1`] = `""`;

exports[`audit csv should calculate stats when asked: stdout 1`] = `
"owner,files,lines
total,10,35
loved,10,35
unloved,0,0
@doctocat,3,0
@global-owner1,4,35
@global-owner2,4,35
@js-owner,2,0
@octocat,1,0
"
`;

exports[`audit csv should do all commands in combination when asked: stderr 1`] = `""`;

exports[`audit csv should do all commands in combination when asked: stdout 1`] = `
"owner,files,lines
total,5,2
loved,5,2
unloved,0,0
@global-owner1,2,2
@global-owner2,2,2
@js-owner,2,0
@octocat,1,0
"
`;

exports[`audit csv should list ownership for all files: stderr 1`] = `""`;

exports[`audit csv should list ownership for all files: stdout 1`] = `
".github/CODEOWNERS,@global-owner1,@global-owner2
.gitignore,@global-owner1,@global-owner2
build/logs/deep/recursive-root-dir-owner.log,@doctocat
build/logs/recursive-root-dir-owner.log,@doctocat
deep/apps/recursive-deep-dir-owner.ts,@octocat
deep/nested-ignore/.gitignore,@global-owner1,@global-owner2
deep/nested-ignore/overridden-ignore.js,@js-owner
default-wildcard-owners.md,@global-owner1,@global-owner2
docs/non-recursive-dir-owner.md,@doctocat
src/ext-wildcard-owner.js,@js-owner
"
`;

exports[`audit csv should only consider files tracked in git root when asked: stderr 1`] = `""`;

exports[`audit csv should only consider files tracked in git root when asked: stdout 1`] = `
".github/CODEOWNERS,@global-owner1,@global-owner2
.gitignore,@global-owner1,@global-owner2
build/logs/deep/recursive-root-dir-owner.log,@doctocat
build/logs/recursive-root-dir-owner.log,@doctocat
deep/apps/recursive-deep-dir-owner.ts,@octocat
deep/nested-ignore/.gitignore,@global-owner1,@global-owner2
deep/nested-ignore/overridden-ignore.js,@js-owner
default-wildcard-owners.md,@global-owner1,@global-owner2
docs/non-recursive-dir-owner.md,@doctocat
src/ext-wildcard-owner.js,@js-owner
"
`;

exports[`audit csv should show only unloved files when asked: stderr 1`] = `""`;

exports[`audit csv should show only unloved files when asked: stdout 1`] = `""`;

exports[`audit csv should use a specific root when asked: stderr 1`] = `""`;

exports[`audit csv should use a specific root when asked: stdout 1`] = `
"deep/apps/recursive-deep-dir-owner.ts,@octocat
deep/nested-ignore/.gitignore,@global-owner1,@global-owner2
deep/nested-ignore/explicit-ignore.js,@js-owner
deep/nested-ignore/node_modules/ignored-by-inherited-rule.txt,@global-owner1,@global-owner2
deep/nested-ignore/overridden-ignore.js,@js-owner
"
`;

exports[`audit jsonl should calculate stats when asked: stderr 1`] = `""`;

exports[`audit jsonl should calculate stats when asked: stdout 1`] = `
"{\\"total\\":{\\"files\\":10,\\"lines\\":35},\\"unloved\\":{\\"files\\":0,\\"lines\\":0},\\"loved\\":{\\"files\\":10,\\"lines\\":35},\\"owners\\":[{\\"owner\\":\\"@global-owner1\\",\\"counters\\":{\\"files\\":4,\\"lines\\":35}},{\\"owner\\":\\"@global-owner2\\",\\"counters\\":{\\"files\\":4,\\"lines\\":35}},{\\"owner\\":\\"@doctocat\\",\\"counters\\":{\\"files\\":3,\\"lines\\":0}},{\\"owner\\":\\"@octocat\\",\\"counters\\":{\\"files\\":1,\\"lines\\":0}},{\\"owner\\":\\"@js-owner\\",\\"counters\\":{\\"files\\":2,\\"lines\\":0}}]}
"
`;

exports[`audit jsonl should do all commands in combination when asked: stderr 1`] = `""`;

exports[`audit jsonl should do all commands in combination when asked: stdout 1`] = `
"{\\"total\\":{\\"files\\":5,\\"lines\\":2},\\"unloved\\":{\\"files\\":0,\\"lines\\":0},\\"loved\\":{\\"files\\":5,\\"lines\\":2},\\"owners\\":[{\\"owner\\":\\"@octocat\\",\\"counters\\":{\\"files\\":1,\\"lines\\":0}},{\\"owner\\":\\"@global-owner1\\",\\"counters\\":{\\"files\\":2,\\"lines\\":2}},{\\"owner\\":\\"@global-owner2\\",\\"counters\\":{\\"files\\":2,\\"lines\\":2}},{\\"owner\\":\\"@js-owner\\",\\"counters\\":{\\"files\\":2,\\"lines\\":0}}]}
"
`;

exports[`audit jsonl should list ownership for all files: stderr 1`] = `""`;

exports[`audit jsonl should list ownership for all files: stdout 1`] = `
"{\\"path\\":\\".github/CODEOWNERS\\",\\"owners\\":[\\"@global-owner1\\",\\"@global-owner2\\"]}
{\\"path\\":\\".gitignore\\",\\"owners\\":[\\"@global-owner1\\",\\"@global-owner2\\"]}
{\\"path\\":\\"build/logs/deep/recursive-root-dir-owner.log\\",\\"owners\\":[\\"@doctocat\\"]}
{\\"path\\":\\"build/logs/recursive-root-dir-owner.log\\",\\"owners\\":[\\"@doctocat\\"]}
{\\"path\\":\\"deep/apps/recursive-deep-dir-owner.ts\\",\\"owners\\":[\\"@octocat\\"]}
{\\"path\\":\\"deep/nested-ignore/.gitignore\\",\\"owners\\":[\\"@global-owner1\\",\\"@global-owner2\\"]}
{\\"path\\":\\"deep/nested-ignore/overridden-ignore.js\\",\\"owners\\":[\\"@js-owner\\"]}
{\\"path\\":\\"default-wildcard-owners.md\\",\\"owners\\":[\\"@global-owner1\\",\\"@global-owner2\\"]}
{\\"path\\":\\"docs/non-recursive-dir-owner.md\\",\\"owners\\":[\\"@doctocat\\"]}
{\\"path\\":\\"src/ext-wildcard-owner.js\\",\\"owners\\":[\\"@js-owner\\"]}
"
`;

exports[`audit jsonl should only consider files tracked in git root when asked: stderr 1`] = `""`;

exports[`audit jsonl should only consider files tracked in git root when asked: stdout 1`] = `
"{\\"path\\":\\".github/CODEOWNERS\\",\\"owners\\":[\\"@global-owner1\\",\\"@global-owner2\\"]}
{\\"path\\":\\".gitignore\\",\\"owners\\":[\\"@global-owner1\\",\\"@global-owner2\\"]}
{\\"path\\":\\"build/logs/deep/recursive-root-dir-owner.log\\",\\"owners\\":[\\"@doctocat\\"]}
{\\"path\\":\\"build/logs/recursive-root-dir-owner.log\\",\\"owners\\":[\\"@doctocat\\"]}
{\\"path\\":\\"deep/apps/recursive-deep-dir-owner.ts\\",\\"owners\\":[\\"@octocat\\"]}
{\\"path\\":\\"deep/nested-ignore/.gitignore\\",\\"owners\\":[\\"@global-owner1\\",\\"@global-owner2\\"]}
{\\"path\\":\\"deep/nested-ignore/overridden-ignore.js\\",\\"owners\\":[\\"@js-owner\\"]}
{\\"path\\":\\"default-wildcard-owners.md\\",\\"owners\\":[\\"@global-owner1\\",\\"@global-owner2\\"]}
{\\"path\\":\\"docs/non-recursive-dir-owner.md\\",\\"owners\\":[\\"@doctocat\\"]}
{\\"path\\":\\"src/ext-wildcard-owner.js\\",\\"owners\\":[\\"@js-owner\\"]}
"
`;

exports[`audit jsonl should show only unloved files when asked: stderr 1`] = `""`;

exports[`audit jsonl should show only unloved files when asked: stdout 1`] = `""`;

exports[`audit jsonl should use a specific root when asked: stderr 1`] = `""`;

exports[`audit jsonl should use a specific root when asked: stdout 1`] = `
"{\\"path\\":\\"deep/apps/recursive-deep-dir-owner.ts\\",\\"owners\\":[\\"@octocat\\"]}
{\\"path\\":\\"deep/nested-ignore/.gitignore\\",\\"owners\\":[\\"@global-owner1\\",\\"@global-owner2\\"]}
{\\"path\\":\\"deep/nested-ignore/explicit-ignore.js\\",\\"owners\\":[\\"@js-owner\\"]}
{\\"path\\":\\"deep/nested-ignore/node_modules/ignored-by-inherited-rule.txt\\",\\"owners\\":[\\"@global-owner1\\",\\"@global-owner2\\"]}
{\\"path\\":\\"deep/nested-ignore/overridden-ignore.js\\",\\"owners\\":[\\"@js-owner\\"]}
"
`;

exports[`audit simple should calculate stats when asked: stderr 1`] = `""`;

exports[`audit simple should calculate stats when asked: stdout 1`] = `
"
--- Counts ---
Total: 10 files (35 lines)
Loved: 10 files (35 lines)
Unloved: 0 files (0 lines)
--- Owners ---
@doctocat: 3 files (0 lines)
@global-owner1: 4 files (35 lines)
@global-owner2: 4 files (35 lines)
@js-owner: 2 files (0 lines)
@octocat: 1 files (0 lines)
"
`;

exports[`audit simple should do all commands in combination when asked: stderr 1`] = `""`;

exports[`audit simple should do all commands in combination when asked: stdout 1`] = `
"
--- Counts ---
Total: 5 files (2 lines)
Loved: 5 files (2 lines)
Unloved: 0 files (0 lines)
--- Owners ---
@global-owner1: 2 files (2 lines)
@global-owner2: 2 files (2 lines)
@js-owner: 2 files (0 lines)
@octocat: 1 files (0 lines)
"
`;

exports[`audit simple should list ownership for all files: stderr 1`] = `""`;

exports[`audit simple should list ownership for all files: stdout 1`] = `
".github/CODEOWNERS    @global-owner1    @global-owner2
.gitignore    @global-owner1    @global-owner2
build/logs/deep/recursive-root-dir-owner.log    @doctocat
build/logs/recursive-root-dir-owner.log    @doctocat
deep/apps/recursive-deep-dir-owner.ts    @octocat
deep/nested-ignore/.gitignore    @global-owner1    @global-owner2
deep/nested-ignore/overridden-ignore.js    @js-owner
default-wildcard-owners.md    @global-owner1    @global-owner2
docs/non-recursive-dir-owner.md    @doctocat
src/ext-wildcard-owner.js    @js-owner
"
`;

exports[`audit simple should only consider files tracked in git root when asked: stderr 1`] = `""`;

exports[`audit simple should only consider files tracked in git root when asked: stdout 1`] = `
".github/CODEOWNERS    @global-owner1    @global-owner2
.gitignore    @global-owner1    @global-owner2
build/logs/deep/recursive-root-dir-owner.log    @doctocat
build/logs/recursive-root-dir-owner.log    @doctocat
deep/apps/recursive-deep-dir-owner.ts    @octocat
deep/nested-ignore/.gitignore    @global-owner1    @global-owner2
deep/nested-ignore/overridden-ignore.js    @js-owner
default-wildcard-owners.md    @global-owner1    @global-owner2
docs/non-recursive-dir-owner.md    @doctocat
src/ext-wildcard-owner.js    @js-owner
"
`;

exports[`audit simple should show only unloved files when asked: stderr 1`] = `""`;

exports[`audit simple should show only unloved files when asked: stdout 1`] = `""`;

exports[`audit simple should use a specific root when asked: stderr 1`] = `""`;

exports[`audit simple should use a specific root when asked: stdout 1`] = `
"deep/apps/recursive-deep-dir-owner.ts    @octocat
deep/nested-ignore/.gitignore    @global-owner1    @global-owner2
deep/nested-ignore/explicit-ignore.js    @js-owner
deep/nested-ignore/node_modules/ignored-by-inherited-rule.txt    @global-owner1    @global-owner2
deep/nested-ignore/overridden-ignore.js    @js-owner
"
`;