diff --git a/test/errors.js b/test/errors.js index ec4073d4a..530462793 100644 --- a/test/errors.js +++ b/test/errors.js @@ -45,8 +45,23 @@ describe("errors", function(){ done() }) }) + + it("should get error when import is not there", function(done){ + poly.render("less/noimport.less", function(error, body){ + should.not.exist(body) + should.exist(error) + error.should.have.property('source') + error.should.have.property('dest') + error.should.have.property('lineno', 1) + error.should.have.property('filename') + error.should.have.property('message') + error.should.have.property('stack', '@import \\"missing\\";', 'must escape quotes for CSS content') + done() + }) + }) }) + describe(".ejs", function(){ it("should get error if var missing var", function(done){ poly.render("ejs/novar.ejs", function(error, body){ @@ -182,6 +197,21 @@ describe("errors", function(){ done() }) }) + + it("should get error when import is not there", function(done){ + poly.render("styl/noimport.styl", function(error, body){ + console.log(error) + should.not.exist(body) + should.exist(error) + error.should.have.property('source', "Stylus") + error.should.have.property('dest', "CSS") + error.should.have.property('lineno', 1) + error.should.have.property('filename') + error.should.have.property('message') + error.should.have.property('stack', '@import \\"missing\\";', 'must escape quotes for CSS content') + done() + }) + }) }) describe(".coffee", function(){ diff --git a/test/fixtures/errors/less/noimport.less b/test/fixtures/errors/less/noimport.less new file mode 100644 index 000000000..d43f7f202 --- /dev/null +++ b/test/fixtures/errors/less/noimport.less @@ -0,0 +1 @@ +@import "missing"; \ No newline at end of file diff --git a/test/fixtures/errors/styl/noimport.styl b/test/fixtures/errors/styl/noimport.styl new file mode 100644 index 000000000..d43f7f202 --- /dev/null +++ b/test/fixtures/errors/styl/noimport.styl @@ -0,0 +1 @@ +@import "missing"; \ No newline at end of file