Skip to content

Commit f33131c

Browse files
solcikmichael-ciniawsky
authored andcommittedNov 24, 2017
test: filter ident (options.ident) (#314)
1 parent 31a25e8 commit f33131c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
 

‎test/options/__snapshots__/config.test.js.snap

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

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

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

79
exports[`Options Config - Path - {String} 1`] = `"module.exports = \\"a { color: black }\\\\n\\""`;

‎test/options/config.test.js

+22
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,26 @@ describe('Options', () => {
5353
expect(src).toMatchSnapshot()
5454
})
5555
})
56+
57+
58+
test('Config - Context - {Object} - with ident', () => {
59+
const config = {
60+
loader: {
61+
options: {
62+
ident: 'postcss',
63+
config: {
64+
path: 'test/fixtures/config/postcss.config.js',
65+
ctx: { plugin: true }
66+
}
67+
}
68+
}
69+
}
70+
71+
return webpack('css/index.js', config).then((stats) => {
72+
const src = loader(stats).src
73+
74+
expect(src).toEqual("module.exports = \"a { color: rgba(255, 0, 0, 1.0) }\\n\"")
75+
expect(src).toMatchSnapshot()
76+
})
77+
})
5678
})

0 commit comments

Comments
 (0)
Please sign in to comment.