forked from dudash/openshift-workshops
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the files needed to be able to run a simple even/odd unit test …
…to exec jenkins step against
- Loading branch information
1 parent
07f5c67
commit 8d25963
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}; |