diff --git a/karma.conf.js b/karma.conf.js index 3de26ae16..add856c20 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -15,19 +15,34 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ + //3rd Party Code 'lib/angular/angular.min.js', + 'lib/angular-route/angular-route.js', 'lib/angular-mocks/angular-mocks.js', - 'lib/chai/chai.js', + + //App-specific Code 'js/*.js', 'js/**/*.js', - 'test/test*.js', + + //Test-Specific Code + 'lib/chai/chai.js', + 'test/lib/chai-should.js', + 'test/lib/chai-expect.js', + + //Mocha stuff + 'test/mocha.conf.js', + + //test files + 'test/unit/**/*.js' ], // list of files to exclude exclude: [ - - ], + 'js/copayBundle.js', + 'js/models/**/*.js', + 'js/init.js' + ], // preprocess matching files before serving them to the browser @@ -62,11 +77,14 @@ module.exports = function(config) { // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: [], + browsers: ['Chrome'], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits - singleRun: false + singleRun: false, + + // if browser doesn't capture output in given timeout (ms), kill it + captureTimeout: 60000 }); }; diff --git a/test/lib/chai-expect.js b/test/lib/chai-expect.js new file mode 100644 index 000000000..35da61515 --- /dev/null +++ b/test/lib/chai-expect.js @@ -0,0 +1 @@ +var expect = chai.expect; diff --git a/test/lib/chai-should.js b/test/lib/chai-should.js new file mode 100644 index 000000000..71dd9f322 --- /dev/null +++ b/test/lib/chai-should.js @@ -0,0 +1 @@ +var should = chai.should(); diff --git a/test/mocha.conf.js b/test/mocha.conf.js new file mode 100644 index 000000000..fd1766e7c --- /dev/null +++ b/test/mocha.conf.js @@ -0,0 +1 @@ +window.mocha.setup({ timeout: 5000 }); diff --git a/test/unit/controllers/controllersSpec.js b/test/unit/controllers/controllersSpec.js new file mode 100644 index 000000000..a5190f5b7 --- /dev/null +++ b/test/unit/controllers/controllersSpec.js @@ -0,0 +1,36 @@ +// +// test/unit/controllers/controllersSpec.js +// +describe("Unit: Testing Controllers", function() { + + beforeEach(angular.mock.module('copay')); + + it('should have a AddressesController controller', function() { + expect(copay.AddressesController).not.to.equal(null); + }); + + it('should have a BackupController controller', function() { + expect(copay.Backupcontroller).not.to.equal(null); + }); + + it('should have a HeaderController controller', function() { + expect(copay.HeaderController).not.to.equal(null); + }); + + it('should have a SendController controller', function() { + expect(copay.SendController).not.to.equal(null); + }); + + it('should have a SetupController controller', function() { + expect(copay.SetupController).not.to.equal(null); + }); + + it('should have a SigninController controller', function() { + expect(copay.SigninController).not.to.equal(null); + }); + + it('should have a TransactionsController controller', function() { + expect(copay.TransactionsController).not.to.equal(null); + }); + +}); diff --git a/test/unit/directives/directivesSpec.js b/test/unit/directives/directivesSpec.js new file mode 100644 index 000000000..ca9c694ec --- /dev/null +++ b/test/unit/directives/directivesSpec.js @@ -0,0 +1,6 @@ +// +// test/unit/directives/directivesSpec.js +// +describe("Unit: Testing Directives", function() { + +}); diff --git a/test/unit/filters/filtersSpec.js b/test/unit/filters/filtersSpec.js new file mode 100644 index 000000000..c72b3fa07 --- /dev/null +++ b/test/unit/filters/filtersSpec.js @@ -0,0 +1,6 @@ +// +// test/unit/filters/filtersSpec.js +// +describe("Unit: Testing Filters", function() { + +}); diff --git a/test/unit/services/servicesSpec.js b/test/unit/services/servicesSpec.js new file mode 100644 index 000000000..2cfd1fda8 --- /dev/null +++ b/test/unit/services/servicesSpec.js @@ -0,0 +1,6 @@ +// +// test/unit/services/servicesSpec.js +// +describe("Unit: Testing Services", function() { + +});