From dbcf8d56fb0b20d5abb58e20944ee3a79c052f14 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Mon, 6 Jan 2014 13:55:04 -0800 Subject: Creates test suite for Wikipedia guidelines --- guidelines/wikipedia/Gruntfile.js | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 guidelines/wikipedia/Gruntfile.js (limited to 'guidelines/wikipedia/Gruntfile.js') diff --git a/guidelines/wikipedia/Gruntfile.js b/guidelines/wikipedia/Gruntfile.js new file mode 100644 index 0000000..69f1954 --- /dev/null +++ b/guidelines/wikipedia/Gruntfile.js @@ -0,0 +1,67 @@ +/*global module:false*/ +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + // Metadata. + pkg: grunt.file.readJSON('package.json'), + jshint: { + gruntfile: { + jshintrc: true, + src: 'Gruntfile.js' + }, + src_specs: { + jshintrc: true, + src: ['src/**/*.js', 'test/**/*.js'] + } + }, + jasmine: { + guidelines: { + src: 'src/**/*.js', + options: { + vendor: [ + '../../src/js/lib/underscore.js', + '../../src/js/lib/jquery/jquery-1.8.3.js', + '../../src/js/lib/md5.js', + '../../src/js/fiveui/injected/prelude.js', + '../../src/js/lib/injected/jquery-plugins.js', + '../../src/js/lib/injected/compute.js' + ], + helpers: ['specs/exports.js', 'specs/*_helper.js'], + specs: 'specs/*_spec.js', + host: 'http://localhost:<%= connect.server.options.port %>/guidelines/wikipedia' + } + } + }, + connect: { + server: { + options: { + port: 9867, + base: '../..' + } + } + }, + watch: { + gruntfile: { + files: '<%= jshint.gruntfile.src %>', + tasks: ['jshint:gruntfile'] + }, + src_specs: { + files: '<%= jshint.src_specs.src %>', + tasks: ['jshint:src_specs', 'test'] + } + } + }); + + // These plugins provide necessary tasks. + grunt.loadNpmTasks('grunt-contrib-connect'); + grunt.loadNpmTasks('grunt-contrib-jasmine'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + + // Default task. + grunt.registerTask('default', ['jshint', 'test']); + + grunt.registerTask('test', ['connect:server', 'jasmine:guidelines']); + +}; -- cgit v1.2.3