Skip to content

Commit 1c1b3db

Browse files
committed
test: when plugins array
1 parent 2a7130c commit 1c1b3db

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
11+
</body>
12+
</html>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
input: 'test/fixtures/by-config/one-io-and-plugins-array/input.html',
3+
output: 'test/expected/by-config/one-io-and-plugins-array/output.html',
4+
plugins: [
5+
require('posthtml-custom-elements')()
6+
]
7+
};

test/test-cli.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,16 @@ test('Transform html stdin options only config one-io-by-pattern', async t => {
188188
(await read('test/fixtures/by-config/one-io-by-pattern/input-1.html'))
189189
);
190190
});
191+
192+
test('Transform html stdin options only config one-io anf plugins array', async t => {
193+
t.plan(2);
194+
await execa(cli, [
195+
'-c',
196+
'test/fixtures/by-config/one-io-and-plugins-array/posthtml.config.js'
197+
]);
198+
t.true(await pathExists('test/expected/by-config/one-io-and-plugins-array/output.html'));
199+
t.is(
200+
(await read('test/expected/by-config/one-io-and-plugins-array/output.html')),
201+
(await read('test/fixtures/by-config/one-io-and-plugins-array/input.html'))
202+
);
203+
});

0 commit comments

Comments
 (0)