Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: JustinBeckwith/linkinator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.13.5
Choose a base ref
...
head repository: JustinBeckwith/linkinator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.13.6
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Feb 21, 2021

  1. Copy the full SHA
    ea89b42 View commit details
Showing with 8 additions and 4 deletions.
  1. +3 −3 src/cli.ts
  2. +5 −1 test/test.cli.ts
6 changes: 3 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -246,15 +246,15 @@ async function main() {
}

const total = (Date.now() - start) / 1000;

const scannedLinks = result.links.filter(x => x.state !== LinkState.SKIPPED);
if (!result.passed) {
const borked = result.links.filter(x => x.state === LinkState.BROKEN);
logger.error(
chalk.bold(
`${chalk.red('ERROR')}: Detected ${
borked.length
} broken links. Scanned ${chalk.yellow(
result.links.length.toString()
scannedLinks.length.toString()
)} links in ${chalk.cyan(total.toString())} seconds.`
)
);
@@ -264,7 +264,7 @@ async function main() {
logger.error(
chalk.bold(
`🤖 Successfully scanned ${chalk.green(
result.links.length.toString()
scannedLinks.length.toString()
)} links in ${chalk.cyan(total.toString())} seconds.`
)
);
6 changes: 5 additions & 1 deletion test/test.cli.ts
Original file line number Diff line number Diff line change
@@ -62,7 +62,11 @@ describe('cli', function () {
'"LICENSE.md, unlinked.md"',
'test/fixtures/markdown/README.md',
]);
assert.match(stripAnsi(res.stdout), /\[SKP\]/);
const stdout = stripAnsi(res.stdout);
const stderr = stripAnsi(res.stderr);
assert.match(stdout, /\[SKP\]/);
// make sure we don't report skipped links in the count
assert.match(stderr, /scanned 2 links/);
});

it('should provide CSV if asked nicely', async () => {