( css: string, opts?: Pick<ProcessOptions, 'from' | 'map'> )
| 31 | } |
| 32 | |
| 33 | function parseError( |
| 34 | css: string, |
| 35 | opts?: Pick<ProcessOptions, 'from' | 'map'> |
| 36 | ): CssSyntaxError { |
| 37 | try { |
| 38 | postcss.parse(css, opts) |
| 39 | } catch (e) { |
| 40 | if (isSyntaxError(e)) { |
| 41 | return e |
| 42 | } else { |
| 43 | throw e |
| 44 | } |
| 45 | } |
| 46 | throw new Error('Error was not thrown') |
| 47 | } |
| 48 | |
| 49 | test('saves source', () => { |
| 50 | let error = parseError('a {\n content: "\n}') |
no test coverage detected
searching dependent graphs…