Skip to content

Commit

Permalink
Revert "adds keepChildren ability from whitelistPatterns Object[]"
Browse files Browse the repository at this point in the history
This reverts commit 9503c17.
  • Loading branch information
Cyril Mizzi committed Mar 14, 2018
1 parent 2213be6 commit c52c81b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 98 deletions.
42 changes: 0 additions & 42 deletions __tests__/purgecssDefault.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,45 +335,3 @@ describe('purge methods with raw content and default extractor', () => {
expect(purgecssResult.includes('double-class')).toBe(true)
})
})

describe('purge methods with raw content and default extractor with whitelisted patterns object', () => {
let purgecssResult

beforeAll(() => {
purgecssResult = new Purgecss({
content: [
{
raw: '<span class="double-class"><i class="first-class"></i></span>',
extension: 'html'
}
],
css: [
{
raw: `.single {color: black;}
.double-class test {color: red;}
.double-class.red {color: red;}
.double-class > .first-class {color: red;}
.double-class--black { background-color : black }
.double-class {color: black;}`
}
],
whitelistPatterns : [
{
pattern : /^double-class$/,
keepChildren : true
},
]
}).purge()[0].css
})

it ('keeps double-class children', () => {
expect(purgecssResult.includes('.double-class test')).toBe(true)
expect(purgecssResult.includes('.double-class.red')).toBe(true)
expect(purgecssResult.includes('.double-class > .first-class')).toBe(true)
})

it ('removes double-class--black class because of $', () => {
expect(purgecssResult.includes('.double-class--black')).toBe(false)
})
})

Loading

0 comments on commit c52c81b

Please sign in to comment.