Skip to content

Commit fe9e332

Browse files
committed
test: for posthtml options, issue #124
1 parent 8024ec7 commit fe9e332

4 files changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php echo $myVar; ?>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import html from './fixture.html' // eslint-disable-line
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Options directives {Array} 1`] = `"export default \`<?php echo $myVar; ?>\`"`;

test/options/directives.test.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict'
2+
3+
const webpack = require('../helpers/compiler')
4+
5+
describe('Options', () => {
6+
describe('directives', () => {
7+
test('{Array}', () => {
8+
const config = {
9+
loader: {
10+
test: /\.html$/,
11+
options: {
12+
directives: [{
13+
name: '?php',
14+
start: '<',
15+
end: '>',
16+
}]
17+
}
18+
}
19+
}
20+
21+
return webpack('options/directives/fixture.js', config)
22+
.then((stats) => {
23+
const [module] = stats.toJson().modules
24+
25+
expect(module.source).toMatchSnapshot()
26+
})
27+
.catch((err) => err)
28+
})
29+
})
30+
})

0 commit comments

Comments
 (0)