Skip to content

Commit bccadac

Browse files
committed
lint tests too
1 parent bfb7a2c commit bccadac

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"tape": "^2.13.4"
3131
},
3232
"scripts": {
33-
"jscc": "jscs *.js",
34-
"jshint": "jshint *.js --reporter node_modules/jshint-stylish/stylish.js",
33+
"jscc": "jscs **/*.js",
34+
"jshint": "jshint **/*.js --reporter node_modules/jshint-stylish/stylish.js",
3535
"test": "npm run jscs && npm run jshint && tape test | tap-colorize"
3636
}
3737
}

test/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
var test = require("tape")
22
var reduceCssCalc = require("..")
33

4-
test("throws an syntax error if a parenthese is missing", function (t) {
4+
test("throws an syntax error if a parenthese is missing", function(t) {
55
t.throws(function() { reduceCssCalc("calc(")}, SyntaxError)
66
t.throws(function() { reduceCssCalc("calc((2 + 1)")}, SyntaxError)
77
t.throws(function() { reduceCssCalc("a calc(calc(2 + 1) b()")}, SyntaxError)
88
t.end()
99
})
1010

11-
test("throws an error if a calc() is empty", function (t) {
11+
test("throws an error if a calc() is empty", function(t) {
1212
t.throws(function() { reduceCssCalc("calc()")}, Error)
1313
t.throws(function() { reduceCssCalc("calc(2 + ())")}, SyntaxError)
1414
t.throws(function() { reduceCssCalc("calc(2 + calc())")}, SyntaxError)
1515
t.end()
1616
})
1717

18-
test("complete reduce for simple css calc()", function (t) {
18+
test("complete reduce for simple css calc()", function(t) {
1919
t.equal(reduceCssCalc("calc(1 + 1)"), "2", "addition")
2020
t.equal(reduceCssCalc("calc(1 - 1)"), "0", "substraction")
2121
t.equal(reduceCssCalc("calc(2 * 2)"), "4", "multiplication")
@@ -24,7 +24,7 @@ test("complete reduce for simple css calc()", function (t) {
2424
t.end()
2525
})
2626

27-
test("complete reduce for css calc() with a single unit", function (t) {
27+
test("complete reduce for css calc() with a single unit", function(t) {
2828
t.equal(reduceCssCalc("calc(3px * 2 - 1px)"), "5px", "px")
2929
t.equal(reduceCssCalc("calc(3rem * 2 - 1rem)"), "5rem", "rem")
3030
t.equal(reduceCssCalc("calc(3em * 2 - 1em)"), "5em", "em")
@@ -33,13 +33,13 @@ test("complete reduce for css calc() with a single unit", function (t) {
3333
t.end()
3434
})
3535

36-
test("complete & accurate reduce for css calc() with percentages", function (t) {
36+
test("complete & accurate reduce for css calc() with percentages", function(t) {
3737
t.equal(reduceCssCalc("calc(2 * 50%)"), "100%", "integer * percentage")
3838
t.equal(reduceCssCalc("calc(120% * 50%)"), "60%", "percentage * percentage")
3939
t.end()
4040
})
4141

42-
test("ignore value around css calc() functions ", function (t) {
42+
test("ignore value around css calc() functions ", function(t) {
4343
t.equal(reduceCssCalc("calc(1 + 1) a"), "2 a", "value after")
4444
t.equal(reduceCssCalc("a calc(1 + 1)"), "a 2", "value before")
4545
t.equal(reduceCssCalc("calc(1 + 1) a calc(1 - 1)"), "2 a 0", "value between 2 calc()")
@@ -48,14 +48,14 @@ test("ignore value around css calc() functions ", function (t) {
4848
t.end()
4949
})
5050

51-
test("reduce complexe css calc()", function (t) {
51+
test("reduce complexe css calc()", function(t) {
5252
t.equal(reduceCssCalc("calc(calc(100 + 10) + 1)"), "111", "integer")
5353
t.equal(reduceCssCalc("calc(calc(calc(1rem * 0.75) * 1.5) - 1rem)"), "0.125rem", "with a single unit")
5454
t.equal(reduceCssCalc("calc(calc(calc(1rem * 0.75) * 1.5) - 1px)"), "calc(1.125rem - 1px)", "multiple units")
5555
t.end()
5656
})
5757

58-
test("reduce prefixed css calc()", function (t) {
58+
test("reduce prefixed css calc()", function(t) {
5959
t.equal(reduceCssCalc("-webkit-calc(120% * 50%)"), "60%", "-webkit, complete reduce")
6060
t.equal(reduceCssCalc("-webkit-calc(100% - 2em)"), "-webkit-calc(100% - 2em)", "-webkit, multiple unit")
6161

0 commit comments

Comments
 (0)