mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Skips additional production-only tests. Follow-up to #56089. In this PR I went through all of `test/integration` looking for `nextBuild(` and added the skipping logic.
41 lines
849 B
TypeScript
41 lines
849 B
TypeScript
import postcss from 'postcss'
|
|
|
|
import mod from './plugin'
|
|
import css from '../noop-template'
|
|
|
|
describe('cssnano accepts plugin configuration', () => {
|
|
test('should not remove all comments', async () => {
|
|
const input = css`
|
|
p {
|
|
/*! heading */
|
|
color: yellow;
|
|
}
|
|
`
|
|
|
|
const res = await postcss([mod({ discardComments: {} })]).process(input, {
|
|
from: 'input.css',
|
|
to: 'output.css',
|
|
})
|
|
|
|
expect(res.css).not.toBe('p{color:#ff0}')
|
|
})
|
|
|
|
test('should remove all comments', async () => {
|
|
const input = css`
|
|
p {
|
|
/*! heading */
|
|
color: yellow;
|
|
}
|
|
`
|
|
|
|
const res = await postcss([
|
|
mod({ discardComments: { removeAll: true } }),
|
|
]).process(input, {
|
|
from: 'input.css',
|
|
to: 'output.css',
|
|
})
|
|
|
|
expect(res.css).toBe('p{color:#ff0}')
|
|
})
|
|
})
|