This file contains hidden or 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
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| jshint: ... | |
| watch: ... | |
| jasmine: ... | |
| sass: ... | |
| requirejs: ... | |
| }); | |
| grunt.registerTask('jslint', [], function() { |
This file contains hidden or 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
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| jshint: ... | |
| watch: ... | |
| jasmine: ... | |
| sass: ... | |
| requirejs: ... | |
| }); | |
| grunt.loadNpmTasks('grunt-contrib-jshint'); |
This file contains hidden or 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
| module.exports = function(grunt) { | |
| // Project configuration. | |
| grunt.initConfig({ | |
| // Metadata. | |
| pkg: grunt.file.readJSON('package.json'), | |
| // Task configuration. | |
| jasmine: { |
This file contains hidden or 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
| module.exports = function(grunt) { | |
| // Project configuration. | |
| grunt.initConfig({ | |
| // Metadata. | |
| pkg: grunt.file.readJSON('package.json'), | |
| // Task configuration. | |
| jasmine: { |
This file contains hidden or 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
| var MyModule = function() { | |
| this.myMethod = function() { | |
| return "Hello world"; | |
| }; | |
| }; |
This file contains hidden or 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
| istanbul: { | |
| src: '<%= jasmine.all.src %>', | |
| options: { | |
| vendor: '<%= jasmine.all.options.vendor %>', | |
| specs: '<%= jasmine.all.options.specs %>', | |
| template: require('grunt-template-jasmine-istanbul'), | |
| templateOptions: { | |
| coverage: 'coverage/json/coverage.json', | |
| report: [ | |
| {type: 'html', options: {dir: 'coverage/html'}}, |
This file contains hidden or 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
| watch: { | |
| js: { | |
| files: [ | |
| 'public/javascripts/src/**/*.js', | |
| 'public/javascripts/spec/**/*.js' | |
| ], | |
| tasks: ['jasmine:all'] | |
| } | |
| } |
This file contains hidden or 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
| describe("My module", function() { | |
| it("answers to myMethod() correctly", function() { | |
| var instance = new MyModule(); | |
| expect(instance.myMethod()).toEqual("Hello world"); | |
| }); | |
| }); |
This file contains hidden or 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
| // Create an empty canvas | |
| var canvas = document.createElement('canvas'); | |
| // Create an image | |
| var img = new Image(); | |
| img.src = "http://path/to/image.png"; | |
| // Wait for image to be downloaded | |
| img.onload = function() { | |
| // Draw the image on the canvas |
This file contains hidden or 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
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| // Javascript minification | |
| min : { | |
| code : { | |
| 'src' : [ | |
| 'public/js/file1.js', | |
| 'public/js/file2.js', | |
| 'public/js/file3.js' | |
| ], |
NewerOlder