Permalink
Browse files

Compress test.js for browser

Also generate source map
  • Loading branch information...
curvedmark committed Mar 26, 2013
1 parent 42f72e7 commit 8f05255803b69eb3ec47b97df6c6928cf8ce883f
Showing with 21 additions and 10 deletions.
  1. +4 −1 .gitignore
  2. +14 −6 Makefile
  3. +3 −3 test/index.html
View
@@ -4,4 +4,7 @@ components
/dist/roole.js
/dist/roole.min.js
/dist/roole.min.js.map
-/test/test.js
+/test/vendor
+/test/test.js
+/test/test.min.js
+/test/test.min.js.map
View
@@ -131,9 +131,6 @@ coverage/lib/%: node_modules/.bin/jscoverage lib/%
coverage/test/%: test/% | coverage/test/unit
cp $< $@
-coverage/test/unit:
- mkdir -p $@
-
coverage/package.json: package.json
cp $< $@
@@ -166,7 +163,11 @@ dist/roole.min.js: \
../build/json version=$(VERSION) content=- | \
../build/mustache roole.min.js.mustache >roole.min.js
-browser-test: parser roole test/test.js
+browser-test: parser roole test/test.min.js test/vendor/mocha.js test/vendor/mocha.css
+
+test/test.min.js: node_modules/.bin/uglifyjs test/test.js
+ cd test && \
+ ../$< test.js -cm -o test.min.js --source-map test.min.js.map
test/test.js: \
build/commonjs-stripper \
@@ -179,6 +180,12 @@ test/test.js: \
echo >> $@
$< $(TEST_FILES) >>$@
+test/vendor/mocha.js: node_modules/mocha/mocha.js | test/vendor
+ cp $< $@
+
+test/vendor/mocha.css: node_modules/mocha/mocha.css | test/vendor
+ cp $< $@
+
node_modules/%:
npm install
@@ -187,8 +194,9 @@ lint: node_modules/.bin/jshint
@$< bin/roole test/assert.js build/* $(JS_FILES)
@$< --config test/unit/.jshintrc test/unit
-publish: lib/parser/generatedParser.js
- npm publish
+test/vendor \
+coverage/test/unit:
+ mkdir -p $@
clean:
rm -rf \
View
@@ -3,15 +3,15 @@
<head>
<meta charset="utf-8">
<title>Roole Unit Tests</title>
- <link rel="stylesheet" href="../node_modules/mocha/mocha.css">
+ <link rel="stylesheet" href="vendor/mocha.css">
</head>
<body>
<div id="mocha"></div>
- <script src="../node_modules/mocha/mocha.js"></script>
+ <script src="vendor/mocha.js"></script>
<script>mocha.setup({ui: 'qunit', ignoreLeaks: true})</script>
<script src="../dist/roole.js"></script>
- <script src="test.js"></script>
+ <script src="test.min.js"></script>
<script>mocha.run()</script>
</body>

0 comments on commit 8f05255

Please sign in to comment.