Skip to content

Commit

Permalink
Don't fail dependent tests on markdown changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Aug 22, 2020
1 parent 6a3923e commit f4e0d8d
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ for (const repo of dependents) {
const url = `https://github.com/${repo}.git`

test(`smoke test ${repo}`, function (t) {
t.plan(5)

pull(url, cwd, (err) => {
t.ifError(err, 'no git error')

Expand All @@ -49,17 +47,28 @@ for (const repo of dependents) {
t.is(code, 0, 'hallmark fixer exited with code 0')

cp.execFile('git', ['diff', '--color'], { cwd }, function (err, stdout) {
t.ifError(err, 'no git error')

const diff = (stdout || '').trim()

t.ifError(err, 'no git error')
t.ok(diff === '', 'no diff')
if (diff === '') {
t.end()
return
}

// Just print the diff for debugging; don't make assertions
console.error(diff)

if (diff !== '') {
console.error(diff)
// Check that fixed markdown is still valid
cp.fork(cli, { cwd, stdio }).on('exit', function (code) {
t.is(code, 0, 'hallmark linter on fixed markdown exited with code 0')

// Start fresh on the next test run
rimraf.sync(cwd, { glob: false })
}
rimraf(cwd, { glob: false }, function (err) {
if (err) throw err
t.end()
})
})
})
})
})
Expand Down

0 comments on commit f4e0d8d

Please sign in to comment.