Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
fixed a bug where the first @import in friendlycode.css wasn't being …
Browse files Browse the repository at this point in the history
…inlined.
  • Loading branch information
toolness committed Jan 18, 2013
1 parent 9a3e790 commit fb5f22b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions css/friendlycode.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This stylesheet is only intended for development purposes,
* due to the inefficiency of @import [1]. For production use, this
* file should be a raw concatenation of all the @import rules below.
* due to the inefficiency of import [1]. For production use, this
* file should be a raw concatenation of all the import at-rules below.
*
* [1] http://www.stevesouders.com/blog/2009/04/09/dont-use-import/
*/
Expand Down
6 changes: 6 additions & 0 deletions test/node-tap/test-qunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ test("unoptimized test suite works", function(t) {
runQUnitTests("/test/index.html", t);
});

function ensureCssHasNoImports(t, builtCss) {
var css = fs.readFileSync(path.resolve(rootDir, builtCss), 'utf-8');
t.ok(!/@import/.test(css), builtCss + " has no @import rules");
}

test("optimized build and test suite work", function(t) {
var optimize;
var builtJs = 'js/friendlycode-built.js';
Expand All @@ -62,6 +67,7 @@ test("optimized build and test suite work", function(t) {
t.equal(status, 0, "build-require.js should exit with no errors");
t.ok(exists(builtJs), builtJs + " was created");
t.ok(exists(builtCss), builtCss + " was created");
ensureCssHasNoImports(t, builtCss);
runQUnitTests("/test/index-optimized.html", t);
});
});

0 comments on commit fb5f22b

Please sign in to comment.