don't run unit tests. use jshint.

fix-space-nbsp
Dmitri Akatov 11 years ago
parent c7c955aee6
commit 2f5e5d415c

@ -2,9 +2,7 @@
module.exports = (grunt) -> module.exports = (grunt) ->
# Project configuration.
grunt.initConfig grunt.initConfig
# Metadata.
pkg: grunt.file.readJSON 'package.json' pkg: grunt.file.readJSON 'package.json'
meta: meta:
src: 'src/' src: 'src/'
@ -24,6 +22,8 @@ module.exports = (grunt) ->
test: test:
files: src: ['<%= meta.src %>**/*.coffee'] files: src: ['<%= meta.src %>**/*.coffee']
options: max_line_length: level: 'warn' options: max_line_length: level: 'warn'
gruntfile:
files: src: ['Gruntfile.coffee']
coffee: src: coffee: src:
options: bare: true options: bare: true
files: files:
@ -31,15 +31,17 @@ module.exports = (grunt) ->
'<%= meta.src %>**/*.coffee' '<%= meta.src %>**/*.coffee'
] ]
karma: karma:
unit: configFile: 'config/karma-unit.coffee' # unit: configFile: 'config/karma-unit.coffee'
e2e: configFile: 'config/karma-e2e.coffee' e2e: configFile: 'config/karma-e2e.coffee'
unit_ci: # unit_ci:
configFile: 'config/karma-unit.coffee' # configFile: 'config/karma-unit.coffee'
singleRun: true # singleRun: true
# browsers: ['PhantomJS']
e2e_ci: e2e_ci:
configFile: 'config/karma-e2e.coffee' configFile: 'config/karma-e2e.coffee'
singleRun: true singleRun: true
browsers: ['PhantomJS'] browsers: ['PhantomJS']
jshint: target: ['<%= meta.target %>**/*.js']
grunt.loadNpmTasks 'grunt-contrib-clean' grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-coffee'
@ -49,7 +51,7 @@ module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-contrib-jshint' grunt.loadNpmTasks 'grunt-contrib-jshint'
grunt.registerTask 'test', ['karma'] grunt.registerTask 'test', ['karma:e2e_ci']
grunt.registerTask 'lint', ['coffeelint'] grunt.registerTask 'lint', ['coffeelint']
grunt.registerTask 'build', ['clean', 'lint', 'coffee'] grunt.registerTask 'build', ['clean', 'coffee']
grunt.registerTask 'default', ['lint' , 'test', 'build', 'jshint'] grunt.registerTask 'default', ['lint' , 'test', 'build', 'jshint']

@ -1,16 +1,18 @@
angular.module('radians.contenteditable', []) angular.module('radians.contenteditable', [])
.directive('contenteditable', -> .directive('contenteditable', ->
require: 'ngModel', require: 'ngModel',
link: (scope, elm, attrs, ctrl) -> link: (scope, elmt, attrs, ctrl) ->
# view -> model # view -> model
view_to_model = -> view_to_model = ->
scope.$apply -> scope.$apply ->
ctrl.$setViewValue elm.html() ctrl.$setViewValue elmt.html()
elm.bind 'blur', view_to_model elmt.bind 'blur', view_to_model
elm.bind 'input', view_to_model elmt.bind 'input', view_to_model
elm.bind 'change', view_to_model elmt.bind 'change', view_to_model
# model -> view # model -> view
ctrl.$render = -> elm.html ctrl.$viewValue ctrl.$render = -> elmt.html ctrl.$viewValue
null
) )