Skip to content

Commit

Permalink
Refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed May 30, 2019
1 parent 829db1a commit 3f8e58c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ test('statistics()', function(t) {
var other = vfile()

t.deepEqual(statistics(), {fatal: 0, nonfatal: 0, warn: 0, info: 0, total: 0})

t.deepEqual(statistics(file), {
fatal: 0,
nonfatal: 0,
warn: 0,
info: 0,
total: 0
})

t.deepEqual(statistics([file, other]), {
fatal: 0,
nonfatal: 0,
Expand All @@ -25,20 +27,23 @@ test('statistics()', function(t) {
})

file.message('This')

t.deepEqual(statistics(file.messages), {
fatal: 0,
nonfatal: 1,
warn: 1,
info: 0,
total: 1
})

t.deepEqual(statistics(file), {
fatal: 0,
nonfatal: 1,
warn: 1,
info: 0,
total: 1
})

t.deepEqual(statistics([file, other]), {
fatal: 0,
nonfatal: 1,
Expand All @@ -48,6 +53,7 @@ test('statistics()', function(t) {
})

file.message('That')

t.deepEqual(statistics(file), {
fatal: 0,
nonfatal: 2,
Expand All @@ -56,8 +62,8 @@ test('statistics()', function(t) {
total: 2
})

var message = file.message('Info')
message.fatal = null
file.info('Info')

t.deepEqual(statistics(file), {
fatal: 0,
nonfatal: 3,
Expand Down

0 comments on commit 3f8e58c

Please sign in to comment.