Skip to content

Commit

Permalink
Added the files needed to be able to run a simple even/odd unit test …
Browse files Browse the repository at this point in the history
…to exec jenkins step against
  • Loading branch information
brandoncox committed Aug 14, 2016
1 parent 07f5c67 commit 8d25963
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
55 changes: 55 additions & 0 deletions dc-metro-map/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

/*global module:false*/
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
// Task configuration.
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: true,
boss: true,
eqnull: true,
globals: {
jQuery: true
}
},
gruntfile: {
src: 'Gruntfile.js'
},
lib_test: {
src: ['lib/**/*.js', 'test/**/*.js']
}
},
nodeunit: {
files: ['test/**/*_test.js']
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
lib_test: {
files: '<%= jshint.lib_test.src %>',
tasks: ['jshint:lib_test', 'nodeunit']
}
}
});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');

// Default task.
grunt.registerTask('default', ['jshint', 'nodeunit']);

};
6 changes: 6 additions & 0 deletions dc-metro-map/README-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ You can see the results of a full query in the file exampledata.json
### Environment Variables
You can have some fun by setting a couple different environment variables. Try BEERME=true and/or RAINBOW=true.

### Usage
npm install; npm start

### Run nodeunit tests
grunt nodeunit

Thanks for reading!
- Dudash

Expand Down
6 changes: 6 additions & 0 deletions dc-metro-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@
"morgan": "~1.6.1",
"restler": "~3.4.0",
"serve-favicon": "~2.3.0"
},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-uglify": "~0.5.0"
}
}
9 changes: 9 additions & 0 deletions dc-metro-map/test/dc-metro-map_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This test only passes if the current system time is a odd minute
exports.passOnOddMinute = function(test) {

var date = new Date();
var minutes = date.getMinutes();

test.ok(minutes % 2 === 1, "this assertion should pass");
test.done();
};

0 comments on commit 8d25963

Please sign in to comment.