Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding grunt and tasks for qunit and code coverage

  • Loading branch information...
commit 67a3be6d11da962b136799dbc03df5b89f8a6907 1 parent 0ccc240
@weikinhuang authored
View
3  .gitmodules
@@ -1,3 +1,6 @@
[submodule "build"]
path = build
url = git://github.com/weikinhuang/jsbuild-base.git
+[submodule "test/qunit"]
+ path = test/qunit
+ url = https://github.com/jquery/qunit.git
View
18 Gruntfile.js
@@ -46,6 +46,20 @@ module.exports = function(grunt) {
mangle : true
}
}
+ },
+
+ qunit : {
+ all : [ 'test/*.html' ]
+ },
+
+ "qunit-cov" : {
+ test : {
+ minimum : 0.95,
+ srcDir : "src",
+ depDirs : [ "test" ],
+ outDir : "coverage",
+ testFiles : [ "test/*.html" ]
+ }
}
});
@@ -53,7 +67,9 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks("grunt-contrib-uglify");
+ grunt.loadNpmTasks("grunt-contrib-qunit");
+ grunt.loadNpmTasks("grunt-qunit-cov");
// Default grunt
- grunt.registerTask("default", [ "concat", "jshint", "uglify" ]);
+ grunt.registerTask("default", [ "concat", "jshint", "uglify", "qunit", "qunit-cov" ]);
};
View
4 package.json
@@ -39,6 +39,8 @@
"grunt-contrib-uglify": "~0.1.1",
"grunt-contrib-concat": "~0.1.3",
"grunt-compare-size": "0.3.1",
- "grunt-benchmark": "~0.1.3"
+ "grunt-benchmark": "~0.1.3",
+ "grunt-qunit-cov": "~0.3.2",
+ "grunt-lib-phantomjs": "~0.2.0"
}
}
View
42 test/index.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <title>Classify Test Suite</title>
+ <link rel="Stylesheet" media="screen" href="qunit/qunit/qunit.css" />
+ <!-- Includes -->
+
+ <script src="qunit/qunit/qunit.js"></script>
+
+ <script>
+ var root = this;
+ </script>
+
+ <script src="../src/core.js"></script>
+ <script src="../src/create.js"></script>
+ <script src="../src/mutator.static.js"></script>
+ <script src="../src/mutator.nowrap.js"></script>
+ <script src="../src/mutator.alias.js"></script>
+ <script src="../src/mutator.bind.js"></script>
+ <script src="../src/observer.js"></script>
+ <script src="../src/mutator.observable.js"></script>
+ <script src="../src/namespace.js"></script>
+ <script src="../src/export.js"></script>
+
+ <script src="core.js"></script>
+ <script src="create.js"></script>
+ <script src="mutator.static.js"></script>
+ <script src="mutator.nowrap.js"></script>
+ <script src="mutator.alias.js"></script>
+ <script src="mutator.bind.js"></script>
+ <script src="observer.js"></script>
+ <script src="mutator.observable.js"></script>
+ <script src="namespace.js"></script>
+ <script src="export.js"></script>
+</head>
+
+<body id="body">
+ <div id="qunit"></div>
+</body>
+</html>
1  test/qunit
@@ -0,0 +1 @@
+Subproject commit 00dea8ed5a33032a629d62ac23a8ac36463838fd
Please sign in to comment.
Something went wrong with that request. Please try again.