Skip to content

Commit

Permalink
working tests with karma
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishokamp committed Feb 21, 2014
1 parent 8649f32 commit 02f54d6
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 5,137 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ node_modules
dist
.tmp
.sass-cache
.css
app/bower_components
heroku_app
29 changes: 26 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,18 @@ module.exports = function (grunt) {
// },

// Test settings
// see: https://github.com/yearofmoo-articles/AngularJS-Testing-Article/blob/master/Gruntfile.js
karma: {
unit: {
configFile: 'karma.conf.js',
configFile: './test/karma-unit.conf.js',
// TODO: karma autowatch is currently broken
autoWatch: true
//singleRun: true
autoWatch: false,
singleRun: true
},
unit_auto: {
configFile: './test/karma-unit.conf.js',
autoWatch: true,
singleRun: false
}
//backgroundUnit: {
// configFile: 'karma.conf.js',
Expand Down Expand Up @@ -425,4 +431,21 @@ module.exports = function (grunt) {
'test',
'build'
]);

// some testing tasks -- taken from: https://github.com/yearofmoo/angularjs-seed-repo/blob/master/Gruntfile.js
grunt.registerTask('test', ['connect:testserver','karma:unit','karma:midway', 'karma:e2e']);
grunt.registerTask('test:unit', ['karma:unit']);
grunt.registerTask('test:midway', ['connect:testserver','karma:midway']);
grunt.registerTask('test:e2e', ['connect:testserver', 'karma:e2e']);

//autotest and watch tests
grunt.registerTask('autotest', ['karma:unit_auto']);
grunt.registerTask('autotest:unit', ['karma:unit_auto']);
grunt.registerTask('autotest:e2e', ['connect:testserver','shell:selenium','watch:protractor']);






};
1 change: 1 addition & 0 deletions app/scripts/aceEditor/AceCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// maintain the current TM matches based on the selected token in the source side

angular.module('controllers').controller('AceCtrl',
// angular.module('editorComponentsApp.controllers').controller('AceCtrl',
['$scope', 'Document', 'TranslationMemory', 'tokenizer', 'Glossary', 'GermanStemmer', '$http','$timeout', '$log', function($scope, Document, TranslationMemory, tokenizer, Glossary, GermanStemmer, $http, $timeout, $log) {

// require some stuff from the ace object
Expand Down
3 changes: 1 addition & 2 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
angular.module('editorComponentsApp',
var App = window.App = angular.module('editorComponentsApp',
[
'ui.router',
'ngResource',
Expand All @@ -9,7 +9,6 @@ angular.module('editorComponentsApp',
'services',
'ui.ace',
'ui.bootstrap',
'services',
'angularFileUpload',
//'filters',
//'ui.bootstrap',
Expand Down
1 change: 1 addition & 0 deletions app/scripts/controllers.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
angular.module('controllers', []);
//angular.module('editorComponentsApp.controllers', []);
Loading

0 comments on commit 02f54d6

Please sign in to comment.