Skip to content

Commit 1a5a02e

Browse files
committed
test: for boolean attributes, issue #85
1 parent d73ecff commit 1a5a02e

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

test/expect/boolean_attr.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<details open></details>

test/fixtures/boolean_attr.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<details open></details>

test/test-core.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const join = require('path').join
44
const readSync = require('fs').readFileSync
55

66
const posthtml = require('posthtml')
7+
const beautify = require('posthtml-beautify')
78
const expressions = require('../lib')
89

910
const fixture = (file) => {
@@ -14,8 +15,8 @@ const expect = (file) => {
1415
return readSync(join(__dirname, 'expect', `${file}.html`), 'utf8')
1516
}
1617

17-
function process (t, name, options, log = false) {
18-
return posthtml([expressions(options)])
18+
function process (t, name, options, log = false, plugins = [expressions(options)]) {
19+
return posthtml(plugins)
1920
.process(fixture(name))
2021
.then((result) => {
2122
log && console.log(result.html)
@@ -80,3 +81,7 @@ test('Raw output', (t) => {
8081
test('Raw output - custom tag', (t) => {
8182
return process(t, 'raw_custom', { ignoredTag: 'verbatim', locals: { foo: 'bar' } })
8283
})
84+
85+
test('Boolean attribute', (t) => {
86+
return process(t, 'boolean_attr', null, false, [beautify(), expressions()])
87+
})

0 commit comments

Comments
 (0)