Skip to content

Commit

Permalink
improve warnings count testing
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed May 13, 2022
1 parent 2295e28 commit 7cd8e27
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/postcss.test.ts
Expand Up @@ -122,17 +122,19 @@ test('has deprecated method to creat plugins', () => {
}
})

equal(warn.callCount, 0)

let func1: any = postcss(plugin).plugins[0]
is(func1.postcssPlugin, 'test')
match(func1.postcssVersion, /\d+.\d+.\d+/)
equal(warn.callCount, 1)

let func2: any = postcss(plugin()).plugins[0]
equal(func2.postcssPlugin, func1.postcssPlugin)
equal(func2.postcssVersion, func1.postcssVersion)

let result1 = postcss(plugin('one')).process('a{ one: 1; two: 2 }')
is(result1.css, 'a{ two: 2 }')
equal(warn.callCount, 1)

let result2 = postcss(plugin).process('a{ one: 1; two: 2 }')
is(result2.css, 'a{ one: 1 }')
Expand Down

0 comments on commit 7cd8e27

Please sign in to comment.