Created
November 20, 2013 07:19
-
-
Save gdoteof/7559033 to your computer and use it in GitHub Desktop.
tryinatest
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
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
// Metadata. | |
pkg: grunt.file.readJSON('package.json'), | |
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + | |
'<%= grunt.template.today("yyyy-mm-dd") %>\n' + | |
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + | |
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + | |
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n', | |
// Task configuration. | |
env:{ | |
dev: { | |
NODE_ENV: 'DEVELOPMENT' | |
}, | |
production: { | |
NODE_ENV: 'PRODUCTION' | |
} | |
}, | |
concat: { | |
options: { | |
banner: '<%= banner %>', | |
stripBanners: true | |
}, | |
dist: { | |
src: ['js/vmx.js', 'js/vmx-*.js'], | |
dest: 'dist/<%= pkg.name %>.js' | |
} | |
}, | |
uglify: { | |
options: { | |
banner: '<%= banner %>' | |
}, | |
dist: { | |
src: '<%= concat.dist.dest %>', | |
dest: 'dist/<%= pkg.name %>.min.js' | |
} | |
}, | |
preprocess : { | |
dev: { | |
src : './tmpl/index.html', | |
dest : './index.html' | |
}, | |
production: { | |
src : './tmpl/index.html', | |
dest : './index-prod.html', | |
} | |
}, | |
jasmine : { | |
src : [ | |
'js/vmx.js', | |
'js/vmx-directives.js', | |
'js/vmx-services.js', | |
'js/vmx-controllers.js', | |
'js/vmx-functional.js' | |
], | |
options : { | |
specs : 'spec/server*.js', | |
keepRunner : true, | |
vendor : [ | |
'js/jquery-1.10.2.js', | |
'js/jquery-ui.js', | |
'js/angular.js', | |
'js/angular*.js', | |
'js/ui-ace.js', | |
'js/ui-bootstrap*SNAPSHOT.js', | |
'js/dat.gui.min.js', | |
'js/tracker.js', | |
'js/glider/glider.js', | |
'js/vmx-api/src/vmxApi.js', | |
], | |
} | |
}, | |
jshint: { | |
options: { | |
lastsemic: true, | |
curly: true, | |
eqeqeq: true, | |
immed: true, | |
latedef: true, | |
newcap: true, | |
nonstandard: true, | |
noarg: true, | |
sub: true, | |
undef: true, | |
unused: 'strict', | |
boss: true, | |
eqnull: true, | |
browser: true, | |
/* NOTE: probably should remove devel for producution */ | |
devel: true, | |
globals: { | |
_: true, | |
angular: true, | |
VMX_SERVER: true, | |
jQuery: true, | |
$: true | |
} | |
}, | |
gruntfile: { | |
src: 'Gruntfile.js' | |
}, | |
lib_test: { | |
src: ['js/vmx.js','js/vmx-*.js', 'js/tracker.js'] | |
}, | |
spec_test: { | |
src: ['spec/*.js'] | |
} | |
}, | |
watch: { | |
gruntfile: { | |
files: '<%= jshint.gruntfile.src %>', | |
tasks: ['jshint:gruntfile'] | |
}, | |
lib_test: { | |
files: '<%= jshint.lib_test.src %>', | |
tasks: ['jshint:lib_test','jasmine'] | |
}, | |
spec_test: { | |
files: '<%= jshint.spec_test.src %>', | |
tasks: ['jshint:spec_test','jasmine'] | |
}, | |
}, | |
shell: { | |
top_lint_errors: { | |
options: { | |
stdout: true | |
}, | |
command: "grunt jshint:lib_test | sed -n '1,10p'" | |
} | |
} | |
}); | |
// These plugins provide necessary tasks. | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-jasmine'); | |
grunt.loadNpmTasks('grunt-shell'); | |
grunt.loadNpmTasks('grunt-env'); | |
grunt.loadNpmTasks('grunt-preprocess'); | |
// Default task. | |
grunt.registerTask('default', ['jshint','jasmine']); | |
grunt.registerTask('dev', ['env:dev','jshint', 'preprocess:dev']); | |
grunt.registerTask('prod', ['env:production', 'jshint', 'concat', 'uglify', 'preprocess:production']); | |
}; |
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
/*globals beforeEach: true, it: true, describe: true, expect:true, module:true, inject:true */ | |
describe("serverCommunication", function() { | |
'use strict'; | |
var vmxconnections; | |
beforeEach(function() { | |
module('vmx.services'); | |
}); | |
beforeEach(inject(function($injector) { | |
console.log($injector); | |
vmxconnections = $injector.get('vmxconnections'); | |
})); | |
it("should not reject tautologies", function() { | |
expect(3).toEqual(3); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment