inline-css icon indicating copy to clipboard operation
inline-css copied to clipboard

Media query test fails on Windows

Open seriema opened this issue 10 years ago • 0 comments

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 '<html>\n<head>\n    <style>\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</style>\n</head>\n<body>\n    <p style="color: blue;">hi</p>\n</body>\n</html>\n' to be '<html>\n<head>\n    <style>\n@media screen {\n  a {\n    color: blue !important;\n    background: red;\n  }\n
  @font-face {\n    font-family: \'Arial2\';\n  }\n}\n</style>\n</head>\n<body>\n    <p style="color: blue;">hi</p>\n</body>\n</html>\n'
      + expected - actual

       <html>
       <head>
      -    <style>
      -@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';
      +  }
      +}
       </style>
       </head>
       <body>
           <p style="color: blue;">hi</p>

      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.

seriema avatar Oct 07 '15 06:10 seriema