Skip to content

Commit

Permalink
test: filter ident (options.ident) (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
solcik authored and michael-ciniawsky committed Nov 24, 2017
1 parent 31a25e8 commit f33131c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/options/__snapshots__/config.test.js.snap
Expand Up @@ -2,6 +2,8 @@

exports[`Options Config - {Object} 1`] = `"module.exports = \\"a { color: rgba(255, 0, 0, 1.0) }\\\\n\\""`;

exports[`Options Config - Context - {Object} - with ident 1`] = `"module.exports = \\"a { color: rgba(255, 0, 0, 1.0) }\\\\n\\""`;

exports[`Options Config - Context - {Object} 1`] = `"module.exports = \\"a { color: rgba(255, 0, 0, 1.0) }\\\\n\\""`;

exports[`Options Config - Path - {String} 1`] = `"module.exports = \\"a { color: black }\\\\n\\""`;
22 changes: 22 additions & 0 deletions test/options/config.test.js
Expand Up @@ -53,4 +53,26 @@ describe('Options', () => {
expect(src).toMatchSnapshot()
})
})


test('Config - Context - {Object} - with ident', () => {
const config = {
loader: {
options: {
ident: 'postcss',
config: {
path: 'test/fixtures/config/postcss.config.js',
ctx: { plugin: true }
}
}
}
}

return webpack('css/index.js', config).then((stats) => {
const src = loader(stats).src

expect(src).toEqual("module.exports = \"a { color: rgba(255, 0, 0, 1.0) }\\n\"")
expect(src).toMatchSnapshot()
})
})
})

0 comments on commit f33131c

Please sign in to comment.