Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds failing test for escaping CSS error messages #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions test/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down Expand Up @@ -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(){
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/errors/less/noimport.less
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "missing";
1 change: 1 addition & 0 deletions test/fixtures/errors/styl/noimport.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "missing";