Skip to content

Commit

Permalink
Add additional reset test
Browse files Browse the repository at this point in the history
  • Loading branch information
colepeters committed Mar 20, 2024
1 parent d7c199f commit 6f57727
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion reset.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function reset({ config }) {
export default function reset({ config = {} } = {}) {
const { reset = true } = config
return reset ? /*css*/`
/*** Reset ***/
Expand Down
5 changes: 3 additions & 2 deletions test/reset.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import test from 'tape'

import reset from '../reset.mjs'

const config = {
const optOut = {
reset: false
}

test('reset', t => {
t.equal(reset({ config }), '', 'should return an empty string when `config.reset` is `false`')
t.notEqual(reset(), '', 'should emit reset styles by default')
t.equal(reset({ config: optOut }), '', 'should return an empty string when `config.reset` is `false`')
t.end()
})

0 comments on commit 6f57727

Please sign in to comment.