diff --git a/Gruntfile.js b/Gruntfile.js
index 5da379b..6219c72 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -21,7 +21,12 @@ module.exports = function(grunt) {
}
}
},
- watch: {}
+ watch: {},
+ karma: {
+ 'summernote': {
+ configFile: './test/karma.conf.js'
+ }
+ }
});
// These plugins provide necessary tasks.
@@ -31,6 +36,6 @@ module.exports = function(grunt) {
// Default task.
grunt.registerTask('default', []);
- grunt.registerTask('test', []);
+ grunt.registerTask('test', ['karma:summernote']);
grunt.registerTask('lint', ['jshint']);
};
diff --git a/bower.json b/bower.json
index cb08d97..2889bc2 100644
--- a/bower.json
+++ b/bower.json
@@ -10,5 +10,8 @@
"summernote": "~0.5.0",
"angular": "~1.2.8"
},
- "devDependencies": {}
+ "devDependencies": {
+ "chai": "~1.8.1",
+ "angular-mocks": "~1.2.8"
+ }
}
diff --git a/karma.conf.js b/karma.conf.js
new file mode 100644
index 0000000..ec5bbe8
--- /dev/null
+++ b/karma.conf.js
@@ -0,0 +1,68 @@
+// Karma configuration
+// Generated on Wed Jan 15 2014 20:50:47 GMT+0900 (KST)
+
+module.exports = function(config) {
+ config.set({
+
+ // base path, that will be used to resolve files and exclude
+ basePath: '',
+
+
+ // frameworks to use
+ frameworks: ['mocha'],
+
+
+ // list of files / patterns to load in the browser
+ files: [
+ '"test/**/*.test.js"'
+ ],
+
+
+ // list of files to exclude
+ exclude: [
+
+ ],
+
+
+ // test results reporter to use
+ // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
+ reporters: ['progress'],
+
+
+ // web server port
+ port: 9876,
+
+
+ // enable / disable colors in the output (reporters and logs)
+ colors: true,
+
+
+ // level of logging
+ // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+ logLevel: config.LOG_INFO,
+
+
+ // enable / disable watching file and executing tests whenever any file changes
+ autoWatch: true,
+
+
+ // Start these browsers, currently available:
+ // - Chrome
+ // - ChromeCanary
+ // - Firefox
+ // - Opera (has to be installed with `npm install karma-opera-launcher`)
+ // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
+ // - PhantomJS
+ // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
+ browsers: ['Chrome'],
+
+
+ // If browser does not capture in given timeout [ms], kill it
+ captureTimeout: 60000,
+
+
+ // Continuous Integration mode
+ // if true, it capture browsers, run tests and exit
+ singleRun: false
+ });
+};
diff --git a/package.json b/package.json
index 21689f1..a0d33fd 100644
--- a/package.json
+++ b/package.json
@@ -17,8 +17,19 @@
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.7.2",
"grunt-contrib-connect": "~0.5.0",
- "grunt-contrib-watch": "~0.5.3"
+ "grunt-contrib-watch": "~0.5.3",
+ "mocha": "~1.17.0",
+ "karma-script-launcher": "~0.1.0",
+ "karma-chrome-launcher": "~0.1.2",
+ "karma-firefox-launcher": "~0.1.3",
+ "karma-html2js-preprocessor": "~0.1.0",
+ "requirejs": "~2.1.10",
+ "karma-requirejs": "~0.2.1",
+ "karma-coffee-preprocessor": "~0.1.2",
+ "karma-phantomjs-launcher": "~0.1.1",
+ "karma": "~0.10.9",
+ "karma-mocha": "~0.1.1",
+ "grunt-karma": "~0.6.2"
},
- "dependencies": {
- }
+ "dependencies": {}
}
diff --git a/test/angular-summernote.test.js b/test/angular-summernote.test.js
new file mode 100644
index 0000000..8c13297
--- /dev/null
+++ b/test/angular-summernote.test.js
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2013 JeongHoon Byun aka "Outsider",