Skip to content

Commit 114d867

Browse files
author
Erasmo Marín
committed
fix tests
1 parent 88ce273 commit 114d867

File tree

5 files changed

+70
-14
lines changed

5 files changed

+70
-14
lines changed
File renamed without changes.

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ module.exports = (css, settings) => {
2222

2323
less.render(cssWithPlaceholders, settings).then(function(output) {
2424
resolved(output.css);
25+
}).catch(function(error) {
26+
resolved("");
27+
console.log(error);
2528
});
2629

2730
loopWhile(() => wait);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"less": "^2.3.1"
2626
},
2727
"devDependencies": {
28+
"less": "^3.0.0-alpha.3",
2829
"mocha": "^4.0.1",
2930
"strip-indent": "^2.0.0"
3031
},

test.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ const plugin = require('./')
44

55
const cleanup = str => stripIndent(str).trim()
66

7-
describe('styled-jsx-plugin-sass', () => {
8-
it('applies plugins', () => {
7+
describe('styled-jsx-plugin-less', () => {
8+
it('applies variables', () => {
99
assert.equal(
10-
plugin('p { img { display: block} color: color(red a(90%)) }').trim(),
10+
plugin('@red: #fff; p { img { display: block} color: @red }').trim(),
1111
cleanup(`
1212
p {
13-
color: color(red a(90%)); }
14-
p img {
15-
display: block; }
13+
color: #fff;
14+
}
15+
p img {
16+
display: block;
17+
}
1618
`)
1719
)
1820
})
@@ -22,10 +24,11 @@ describe('styled-jsx-plugin-sass', () => {
2224
plugin('p { img { display: block } color: %%styled-jsx-expression-1%%; } %%styled-jsx-expression-1%%').trim(),
2325
cleanup(`
2426
p {
25-
color: %%styled-jsx-expression-1%%; }
26-
p img {
27-
display: block; }
28-
27+
color: %%styled-jsx-expression-1%%;
28+
}
29+
p img {
30+
display: block;
31+
}
2932
%%styled-jsx-expression-1%%
3033
`)
3134
)
@@ -36,10 +39,11 @@ describe('styled-jsx-plugin-sass', () => {
3639
plugin('@import "fixture"; p { color: red }').trim(),
3740
cleanup(`
3841
div {
39-
color: red; }
40-
42+
color: red;
43+
}
4144
p {
42-
color: red; }
45+
color: red;
46+
}
4347
`)
4448
)
4549
})

yarn.lock

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# yarn lockfile v1
33

44

5+
asap@~2.0.3:
6+
version "2.0.6"
7+
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
8+
59
balanced-match@^1.0.0:
610
version "1.0.0"
711
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
@@ -46,6 +50,12 @@ [email protected]:
4650
version "3.3.1"
4751
resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75"
4852

53+
errno@^0.1.1:
54+
version "0.1.4"
55+
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d"
56+
dependencies:
57+
prr "~0.0.0"
58+
4959
5060
version "1.0.5"
5161
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
@@ -65,6 +75,10 @@ [email protected]:
6575
once "^1.3.0"
6676
path-is-absolute "^1.0.0"
6777

78+
graceful-fs@^4.1.2:
79+
version "4.1.11"
80+
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
81+
6882
6983
version "1.10.3"
7084
resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f"
@@ -77,6 +91,10 @@ [email protected]:
7791
version "1.1.1"
7892
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
7993

94+
image-size@~0.5.0:
95+
version "0.5.5"
96+
resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c"
97+
8098
inflight@^1.0.4:
8199
version "1.0.6"
82100
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
@@ -88,6 +106,22 @@ inherits@2:
88106
version "2.0.3"
89107
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
90108

109+
less@^3.0.0-alpha.3:
110+
version "3.0.0-alpha.3"
111+
resolved "https://registry.yarnpkg.com/less/-/less-3.0.0-alpha.3.tgz#d3da9234fd16e60a47d6291e772e65a841ec8410"
112+
optionalDependencies:
113+
errno "^0.1.1"
114+
graceful-fs "^4.1.2"
115+
image-size "~0.5.0"
116+
mime "^1.2.11"
117+
mkdirp "^0.5.0"
118+
promise "^7.1.1"
119+
source-map "^0.5.3"
120+
121+
mime@^1.2.11:
122+
version "1.4.1"
123+
resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
124+
91125
minimatch@^3.0.4:
92126
version "3.0.4"
93127
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
@@ -98,7 +132,7 @@ [email protected]:
98132
version "0.0.8"
99133
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
100134

101-
135+
[email protected], mkdirp@^0.5.0:
102136
version "0.5.1"
103137
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
104138
dependencies:
@@ -137,6 +171,20 @@ path-is-absolute@^1.0.0:
137171
version "1.0.1"
138172
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
139173

174+
promise@^7.1.1:
175+
version "7.3.1"
176+
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
177+
dependencies:
178+
asap "~2.0.3"
179+
180+
prr@~0.0.0:
181+
version "0.0.0"
182+
resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a"
183+
184+
source-map@^0.5.3:
185+
version "0.5.7"
186+
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
187+
140188
strip-indent@^2.0.0:
141189
version "2.0.0"
142190
resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68"

0 commit comments

Comments
 (0)