Media query test fails on Windows
- Dominant language
- JavaScript
- Stars
- 438
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
I grabbed a copy of the project and ran `gulp test` and one test failed. It seems to be because of how Windows handles line breaks because the CSS is the same. I ran the same code and tests on a Mac and all tests passed. Maybe the issue is upstream but I'll start here.
```
[08:05:51] Using gulpfile C:\src\inline-css-master\gulpfile.js
[08:05:51] Starting 'test'...
....................................
35 passing (404ms)
1 failing
1) inline-css Should inline css and preserve media queries:
AssertionError: expected '\n\n \r\n@media screen {\r\n a {\r\n color: blue !important;\r\n background: red;\r\n }\r\n @font-face {\r\n font-family: \'Arial2\';\r\n }\r\n}\r\n\n\n\n
hi
\n\n\n' to be '\n\n \n@media screen {\n a {\n color: blue !important;\n background: red;\n }\n@font-face {\n font-family: \'Arial2\';\n }\n}\n\n\n\n
hi
\n\n\n'+ expected - actual
-
-@media screen {
- a {
- color: blue !important;
- background: red;
- }
- @font-face {
- font-family: 'Arial2';
- }
-}
+ <style>
+@media screen {
+ a {
+ color: blue !important;
+ background: red;
+ }
+ @font-face {
+ font-family: 'Arial2';
+ }
+}
hi
at Assertion.fail (C:\src\inline-css-master\node_modules\should\lib\assertion.js:196:17)
at Assertion.prop.(anonymous function) (C:\src\inline-css-master\node_modules\should\lib\assertion.js:81:17)
at C:\src\inline-css-master\test\main.js:28:24
at bound (domain.js:250:14)
at runBound (domain.js:263:12)
at tryCatcher (C:\src\inline-css-master\node_modules\bluebird\js\main\util.js:26:23)
at Promise._settlePromiseFromHandler (C:\src\inline-css-master\node_modules\bluebird\js\main\promise.js:507:31)
at Promise._settlePromiseAt (C:\src\inline-css-master\node_modules\bluebird\js\main\promise.js:581:18)
at Promise._settlePromises (C:\src\inline-css-master\node_modules\bluebird\js\main\promise.js:697:14)
at Async._drainQueue (C:\src\inline-css-master\node_modules\bluebird\js\main\async.js:123:16)
at Async._drainQueues (C:\src\inline-css-master\node_modules\bluebird\js\main\async.js:133:10)
at Immediate.Async.drainQueues [as _onImmediate] (C:\src\inline-css-master\node_modules\bluebird\js\main\async.js:15:14)
[08:05:51] 'test' errored after 681 ms
[08:05:51] Error in plugin 'gulp-mocha'
Message:
1 test failed.
```
Contributor guide
Assessment
This issue has not been assessed yet.