From 2f5e5d415c1a61eed97fbedb690fb62ed316bc1c Mon Sep 17 00:00:00 2001 From: Dmitri Akatov Date: Thu, 20 Jun 2013 12:12:43 +0100 Subject: [PATCH] don't run unit tests. use jshint. --- Gruntfile.coffee | 18 ++++++++++-------- src/radians/contenteditable.coffee | 14 ++++++++------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 0564bb9..48f879e 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -2,9 +2,7 @@ module.exports = (grunt) -> - # Project configuration. grunt.initConfig - # Metadata. pkg: grunt.file.readJSON 'package.json' meta: src: 'src/' @@ -24,6 +22,8 @@ module.exports = (grunt) -> test: files: src: ['<%= meta.src %>**/*.coffee'] options: max_line_length: level: 'warn' + gruntfile: + files: src: ['Gruntfile.coffee'] coffee: src: options: bare: true files: @@ -31,15 +31,17 @@ module.exports = (grunt) -> '<%= meta.src %>**/*.coffee' ] karma: - unit: configFile: 'config/karma-unit.coffee' + # unit: configFile: 'config/karma-unit.coffee' e2e: configFile: 'config/karma-e2e.coffee' - unit_ci: - configFile: 'config/karma-unit.coffee' - singleRun: true + # unit_ci: + # configFile: 'config/karma-unit.coffee' + # singleRun: true + # browsers: ['PhantomJS'] e2e_ci: configFile: 'config/karma-e2e.coffee' singleRun: true browsers: ['PhantomJS'] + jshint: target: ['<%= meta.target %>**/*.js'] grunt.loadNpmTasks 'grunt-contrib-clean' grunt.loadNpmTasks 'grunt-contrib-coffee' @@ -49,7 +51,7 @@ module.exports = (grunt) -> grunt.loadNpmTasks 'grunt-contrib-jshint' - grunt.registerTask 'test', ['karma'] + grunt.registerTask 'test', ['karma:e2e_ci'] grunt.registerTask 'lint', ['coffeelint'] - grunt.registerTask 'build', ['clean', 'lint', 'coffee'] + grunt.registerTask 'build', ['clean', 'coffee'] grunt.registerTask 'default', ['lint' , 'test', 'build', 'jshint'] diff --git a/src/radians/contenteditable.coffee b/src/radians/contenteditable.coffee index 23c4fe2..0bb9bba 100644 --- a/src/radians/contenteditable.coffee +++ b/src/radians/contenteditable.coffee @@ -1,16 +1,18 @@ angular.module('radians.contenteditable', []) .directive('contenteditable', -> require: 'ngModel', - link: (scope, elm, attrs, ctrl) -> + link: (scope, elmt, attrs, ctrl) -> # view -> model view_to_model = -> scope.$apply -> - ctrl.$setViewValue elm.html() + ctrl.$setViewValue elmt.html() - elm.bind 'blur', view_to_model - elm.bind 'input', view_to_model - elm.bind 'change', view_to_model + elmt.bind 'blur', view_to_model + elmt.bind 'input', view_to_model + elmt.bind 'change', view_to_model # model -> view - ctrl.$render = -> elm.html ctrl.$viewValue + ctrl.$render = -> elmt.html ctrl.$viewValue + + null )