Skip to content

Commit

Permalink
Fix warnings from nodes without source
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Oct 14, 2015
1 parent b25f26f commit 34223b2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/css-syntax-error.es6
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,19 @@ describe('CssSyntaxError', () => {
'^');
});

it('misses highlights without source', () => {
it('misses highlights without source content', () => {
let error = parseError('a {');
error.source = null;
expect(error.toString()).to.eql(
'CssSyntaxError: <css input>:1:1: Unclosed block');
});

it('misses position without source', () => {
let decl = postcss.decl({ prop: 'color', value: 'black' });
let error = decl.error('Test');
expect(error.toString()).to.eql('CssSyntaxError: <css input>: Test');
});

it('uses source map', () => {
let concat = new Concat(true, 'all.css');
concat.add('a.css', 'a { }\n');
Expand Down

0 comments on commit 34223b2

Please sign in to comment.