Skip to content

Commit

Permalink
Tap/Tape conversion, splitting tests, attempt instanbul coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Xotic750 committed Dec 3, 2013
1 parent 1ce32a8 commit fa2d18a
Show file tree
Hide file tree
Showing 17 changed files with 496 additions and 1,630 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ src/cldr/
src/tz/
src/cldr.zip
src/tzdata.tar.gz
src/includes/
.DS_Store
*.komodoproject
.coveralls.yml
lib-cov/
coverage/
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
language: node_js
node_js:
- "0.10"
- "0.8"
- "0.10"
- "0.8"
67 changes: 36 additions & 31 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
pkg: grunt.file.readJSON('package.json'),

clean: {
all: ['README.md', 'docs', 'lib', 'src/cldr.zip', 'src/tzdata.tar.gz', 'src/includes', 'src/cldr', 'src/tz', 'lib-cov'],
after: ['src/cldr.zip', 'src/tzdata.tar.gz', 'src/cldr', 'src/tz', 'lib-cov']
all: ['README.md', 'docs', 'lib', 'src/cldr.zip', 'src/tzdata.tar.gz', 'src/includes', 'src/cldr', 'src/tz', 'coverage'],
after: ['src/cldr.zip', 'src/tzdata.tar.gz', 'src/cldr', 'src/tz', 'coverage']
},

curl: {
Expand Down Expand Up @@ -108,23 +108,8 @@
}
},

mochaTest: {
raw: {
options: {
reporter: 'tap'
},
src: ['tests/raw/**/*.js']
},
min: {
options: {
reporter: 'tap'
},
src: ['tests/min/**/*.js']
}
},

jshint: {
grunt: ['Gruntfile.js', 'tasks/**/*.js', 'tests/!(browser)**/*.js'],
grunt: ['Gruntfile.js', 'tasks/**/*.js', 'tests/**/*.js'],
sources: ['src/*.js', 'src/includes/*.js'],
lib: ['lib/<%= pkg.name %>.js'],
options: {
Expand Down Expand Up @@ -244,27 +229,48 @@
},

shell: {
coverage: {
beautified: {
options: {
stdout: true
stdout: true,
stderr: true,
failOnError: true,
execOptions: {
maxBuffer: 1048576
}
},
command: 'node_modules/jscoverage/bin/jscoverage lib/astrodate.js lib-cov/astrodate.js'
command: 'ASTRODATE_COVERAGE=1 node_modules/tap/bin/tap.js tests/*.js'
},
coveralls: {
options: {
stdout: true
stdout: false,
stderr: true,
failOnError: true,
execOptions: {
maxBuffer: 1048576
}
},
command: 'node_modules/mocha/bin/mocha -R mocha-lcov-reporter tests/cov/create.js | ./node_modules/coveralls/bin/coveralls.js'
command: 'ASTRODATE_COVERAGE= node_modules/istanbul/lib/cli.js cover tests/*.js --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage'
},
uglified: {
options: {
stdout: true,
stderr: true,
failOnError: true,
execOptions: {
maxBuffer: 1048576
}
},
command: 'node_modules/tap/bin/tap.js tests/*.js'
}
},

watch: {
test: {
files: [
'lib/<%= pkg.name %>.js',
'tests/**/*.js'
'tests/*.js'
],
tasks: ['mochaTest']
tasks: ['shell:beautified', 'shell:coveralls', 'shell:uglified']
},

jshint: {
Expand All @@ -287,7 +293,6 @@
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-contrib-clean');
Expand All @@ -313,19 +318,19 @@
'replace:bn',
'jsbeautifier:dist2',
'jshint:lib',
'mochaTest:raw',
'shell:coverage',
'shell:beautified',
'shell:coveralls',
'uglify',
'mochaTest:min',
'shell:uglified',
'buildReadme',
'jsdoc',
'clean:after'
]);

grunt.registerTask('test', [
'mochaTest:raw',
'mochaTest:min'
'shell:beautified',
'shell:coveralls',
'shell:uglified'
]);
};
}());
2 changes: 1 addition & 1 deletion docs/AstroDate.html
Original file line number Diff line number Diff line change
Expand Up @@ -7558,7 +7558,7 @@ <h2><a href="index.html">Index</a></h2><h3>Modules</h3><ul><li><a href="module-a
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha2</a> on Mon Dec 02 2013 15:27:30 GMT+0100 (CET)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha2</a> on Tue Dec 03 2013 02:49:45 GMT+0100 (CET)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/astrodate.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -29567,7 +29567,7 @@ <h2><a href="index.html">Index</a></h2><h3>Modules</h3><ul><li><a href="module-a
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha2</a> on Mon Dec 02 2013 15:27:30 GMT+0100 (CET)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha2</a> on Tue Dec 03 2013 02:49:45 GMT+0100 (CET)
</footer>

<script> prettyPrint(); </script>
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h3> </h3>
<p><a href="https://coveralls.io/r/Xotic750/astrodate?branch=master" title="Coverage status on Coveralls"><img src="https://coveralls.io/repos/Xotic750/astrodate/badge.png?branch=master" alt="Coverage Status"></a></p>
<p><a href="https://ci.testling.com/Xotic750/astrodate" title="Browser support on Testling CI"><img src="https://ci.testling.com/Xotic750/astrodate.png" alt="browser support"></a></p>
<h1><a href="http://xotic750.github.io/astrodate/">AstroDate 0.6.1</a></h1>
<h6>Graham Fairweather <a href="&#109;&#x61;&#105;&#x6c;&#116;&#x6f;&#x3a;&#120;&#111;&#x74;&#x69;&#99;&#55;&#x35;&#x30;&#x40;&#x67;&#109;&#x61;&#x69;&#x6c;&#x2e;&#x63;&#111;&#x6d;">&#120;&#111;&#x74;&#x69;&#99;&#55;&#x35;&#x30;&#x40;&#x67;&#109;&#x61;&#x69;&#x6c;&#x2e;&#x63;&#111;&#x6d;</a></h6>
<h6>Graham Fairweather <a href="&#x6d;&#x61;&#105;&#108;&#x74;&#111;&#x3a;&#x78;&#x6f;&#116;&#105;&#99;&#x37;&#53;&#48;&#64;&#x67;&#x6d;&#97;&#x69;&#x6c;&#46;&#x63;&#111;&#x6d;">&#x78;&#x6f;&#116;&#105;&#99;&#x37;&#53;&#48;&#64;&#x67;&#x6d;&#97;&#x69;&#x6c;&#46;&#x63;&#111;&#x6d;</a></h6>
<p>Still very much work in progress, so there are <a href="https://github.com/Xotic750/astrodate/issues" title="Issues">bugs</a> and the API has not been fully defined (or documented) and is subject to major changes.</p>
<p>The idea behind the project is to not rely on Javascript's rather flaky <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date" title="Date Object reference"><code>Date</code></a> object, give better accuracy, flexibility and be cross-browser.</p>
<p>Besides the standard <a href="http://en.wikipedia.org/wiki/Gregorian_calendar" title="Wikipedia">Gregorian calendar</a>, the <a href="http://en.wikipedia.org/wiki/Julian_calendar" title="Wikipedia">Julian calendar</a> is also available. This allows for AstroDate to be used in astronomical calculations.
Expand Down Expand Up @@ -135,7 +135,7 @@ <h2><a href="index.html">Index</a></h2><h3>Modules</h3><ul><li><a href="module-a
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha2</a> on Mon Dec 02 2013 15:27:30 GMT+0100 (CET)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha2</a> on Tue Dec 03 2013 02:49:45 GMT+0100 (CET)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-astrodate.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ <h2><a href="index.html">Index</a></h2><h3>Modules</h3><ul><li><a href="module-a
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha2</a> on Mon Dec 02 2013 15:27:30 GMT+0100 (CET)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha2</a> on Tue Dec 03 2013 02:49:45 GMT+0100 (CET)
</footer>

<script> prettyPrint(); </script>
Expand Down
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*global require, module, process */
(function () {
'use strict';

switch (process.env.ASTRODATE_COVERAGE) {
case 1:
module.exports = require('../lib/astrodate');
break;
default:
module.exports = require('../lib/astrodate.min');
}
}());
23 changes: 9 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
"uglify-js": "latest",
"grunt": "latest",
"bignumber.js": "latest",
"chai": "latest",
"js-beautify": "latest",
"jsdoc": "latest",
"tar.gz": "latest",
"mocha": "latest",
"tape": "latest",
"tap": "latest",
"grunt-cli": "latest",
"grunt-contrib-jshint": "latest",
"grunt-contrib-concat": "latest",
Expand All @@ -63,25 +63,23 @@
"grunt-lib-legacyhelpers": "latest",
"grunt-contrib-clean": "latest",
"grunt-jsdoc": "latest",
"grunt-mocha-test": "0.8.0",
"grunt-jsbeautifier": "latest",
"grunt-replace": "latest",
"grunt-curl": "latest",
"grunt-zip": "latest",
"coveralls": "latest",
"mocha-lcov-reporter": "latest",
"jscoverage": "latest",
"grunt-shell": "latest"
"grunt-shell": "latest",
"istanbul": "latest"
},
"optionalDependencies": {
"uglify-js": "latest",
"grunt": "latest",
"bignumber.js": "latest",
"chai": "latest",
"js-beautify": "latest",
"jsdoc": "latest",
"tar.gz": "latest",
"mocha": "latest",
"tape": "latest",
"tap": "latest",
"grunt-cli": "latest",
"grunt-contrib-jshint": "latest",
"grunt-contrib-concat": "latest",
Expand All @@ -90,15 +88,13 @@
"grunt-lib-legacyhelpers": "latest",
"grunt-contrib-clean": "latest",
"grunt-jsdoc": "latest",
"grunt-mocha-test": "0.8.0",
"grunt-jsbeautifier": "latest",
"grunt-replace": "latest",
"grunt-curl": "latest",
"grunt-zip": "latest",
"coveralls": "latest",
"mocha-lcov-reporter": "latest",
"jscoverage": "latest",
"grunt-shell": "latest"
"grunt-shell": "latest",
"istanbul": "latest"
},
"sources": {
"cldr": "http://unicode.org/Public/cldr/24/json.zip",
Expand All @@ -108,8 +104,7 @@
"test": "grunt test"
},
"testling": {
"harness": "mocha",
"files": "tests/min/*.js",
"files": "tests/*.js",
"browsers": [
"iexplore/6.0..latest",
"firefox/17..latest",
Expand Down

0 comments on commit fa2d18a

Please sign in to comment.