mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-10 21:36:34 +01:00
WIP Mocha tests.
This commit is contained in:
parent
67525d5735
commit
07716fadd0
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
build/
|
||||||
|
node_modules/
|
33
grunt.js
Normal file
33
grunt.js
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
module.exports = function (grunt) {
|
||||||
|
grunt.initConfig({
|
||||||
|
coffee: {
|
||||||
|
lib: {
|
||||||
|
src: ['lib/morris.coffee'],
|
||||||
|
dest: 'build/lib',
|
||||||
|
options: { bare: false }
|
||||||
|
},
|
||||||
|
spec: {
|
||||||
|
src: ['spec/lib/*.coffee'],
|
||||||
|
dest: 'build/spec/lib',
|
||||||
|
options: { bare: false }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
concat: {
|
||||||
|
'morris.js': ['build/lib/*.js']
|
||||||
|
},
|
||||||
|
min: {
|
||||||
|
'morris.min.js': 'morris.js'
|
||||||
|
},
|
||||||
|
mocha: {
|
||||||
|
spec: {
|
||||||
|
runner: ['spec/spec_runner.html'],
|
||||||
|
specs: ['build/spec/**/*.js']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
grunt.loadNpmTasks('grunt-coffee');
|
||||||
|
grunt.loadNpmTasks('grunt-mocha');
|
||||||
|
|
||||||
|
grunt.registerTask('default', 'coffee concat min mocha');
|
||||||
|
};
|
@ -1,4 +1,3 @@
|
|||||||
// Generated by CoffeeScript 1.3.3
|
|
||||||
(function() {
|
(function() {
|
||||||
var $, Morris, minutesSpecHelper, secondsSpecHelper,
|
var $, Morris, minutesSpecHelper, secondsSpecHelper,
|
||||||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||||
|
1
morris.min.js
vendored
1
morris.min.js
vendored
File diff suppressed because one or more lines are too long
18
spec/spec_runner.html
Normal file
18
spec/spec_runner.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<script src="vendor/jquery-1.7.2.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="vendor/mocha-1.1.0.css" type="text/css" media="screen" />
|
||||||
|
<script type="text/javascript" src="vendor/mocha-1.1.0.js"></script>
|
||||||
|
<script type="text/javascript" src="vendor/chai-1.0.4.js"></script>
|
||||||
|
<script type="text/javascript" src="vendor/raphael-2.1.0.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../morris.js"></script>
|
||||||
|
<script>
|
||||||
|
should = chai.should();
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="mocha"></div>
|
||||||
|
<div id="test" style="visibility: hidden"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,29 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<script src="lib/jquery-1.7.2.min.js"></script>
|
|
||||||
<script src="lib/coffee-script-1.3.3.js"></script>
|
|
||||||
<link rel="stylesheet" href="lib/mocha-1.1.0.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript" src="lib/mocha-1.1.0.js"></script>
|
|
||||||
<script type="text/javascript" src="lib/chai-1.0.4.js"></script>
|
|
||||||
<script type="text/javascript" src="lib/raphael-2.1.0.min.js"></script>
|
|
||||||
<script type="text/javascript" src="../morris.js"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
mocha.setup('bdd')
|
|
||||||
should = chai.should()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script src="test.unit.js"></script>
|
|
||||||
<script>
|
|
||||||
$(function () {
|
|
||||||
mocha.run()
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="mocha"></div>
|
|
||||||
<div id="test" style="visibility: hidden"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in New Issue
Block a user