-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: for posthtml options, issue #124
- Loading branch information
Showing
4 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php echo $myVar; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import html from './fixture.html' // eslint-disable-line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Options directives {Array} 1`] = `"export default \`<?php echo $myVar; ?>\`"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict' | ||
|
||
const webpack = require('../helpers/compiler') | ||
|
||
describe('Options', () => { | ||
describe('directives', () => { | ||
test('{Array}', () => { | ||
const config = { | ||
loader: { | ||
test: /\.html$/, | ||
options: { | ||
directives: [{ | ||
name: '?php', | ||
start: '<', | ||
end: '>', | ||
}] | ||
} | ||
} | ||
} | ||
|
||
return webpack('options/directives/fixture.js', config) | ||
.then((stats) => { | ||
const [module] = stats.toJson().modules | ||
|
||
expect(module.source).toMatchSnapshot() | ||
}) | ||
.catch((err) => err) | ||
}) | ||
}) | ||
}) |