diff --git a/package.json b/package.json index 7d19bf21..068baf5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angularjs-gulp-browserify-boilerplate", - "version": "1.5.1", + "version": "1.5.2", "author": "Jake Marsh ", "description": "Boilerplate using AngularJS, SASS, Gulp, and Browserify while also utilizing best practices.", "repository": { diff --git a/test/karma.conf.js b/test/karma.conf.js index 29689e3d..c662ea36 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -12,7 +12,8 @@ const karmaBaseConfig = { frameworks: ['jasmine', 'browserify'], preprocessors: { - 'app/js/**/*.js': ['browserify', 'coverage'] + 'app/js/**/*.js': ['browserify', 'coverage'], + 'test/**/*.js': ['browserify'] }, browsers: ['Chrome'], diff --git a/test/unit/constants_spec.js b/test/unit/constants_spec.js index 8fb2a5b6..81cdc7a7 100644 --- a/test/unit/constants_spec.js +++ b/test/unit/constants_spec.js @@ -4,14 +4,14 @@ describe('Unit: Constants', function() { - var constants; + let constants; beforeEach(function() { // instantiate the app module angular.mock.module('app'); // mock the directive - angular.mock.inject(function(AppSettings) { + angular.mock.inject((AppSettings) => { constants = AppSettings; }); }); diff --git a/test/unit/controllers/example_spec.js b/test/unit/controllers/example_spec.js index bfbfa546..4f71c4f5 100644 --- a/test/unit/controllers/example_spec.js +++ b/test/unit/controllers/example_spec.js @@ -4,13 +4,13 @@ describe('Unit: ExampleCtrl', function() { - var ctrl; + let ctrl; beforeEach(function() { // instantiate the app module angular.mock.module('app'); - angular.mock.inject(function($controller) { + angular.mock.inject(($controller) => { ctrl = $controller('ExampleCtrl'); }); }); diff --git a/test/unit/directives/example_spec.js b/test/unit/directives/example_spec.js index 42a5d011..77cac062 100644 --- a/test/unit/directives/example_spec.js +++ b/test/unit/directives/example_spec.js @@ -11,7 +11,7 @@ describe('Unit: ExampleDirective', function() { spyOn(window, 'alert'); angular.mock.module('app'); - angular.mock.inject(function($compile, $rootScope) { + angular.mock.inject(($compile, $rootScope) => { scope = $rootScope; scope.title = 'A sample title'; scope.message = 'A sample message'; diff --git a/test/unit/filters/example_spec.js b/test/unit/filters/example_spec.js index d339a0c4..fe7f833b 100644 --- a/test/unit/filters/example_spec.js +++ b/test/unit/filters/example_spec.js @@ -4,21 +4,21 @@ describe('Unit: ExampleFilter', function() { - var $filter; + let $filter; beforeEach(function() { // instantiate the app module angular.mock.module('app'); // mock the filter - angular.mock.inject(function(_$filter_) { + angular.mock.inject((_$filter_) => { $filter = _$filter_; }); }); it('should replace the word "keyboard" with "leopard"', function() { - var testString = 'computers are operated by keyboards'; - var resultString = $filter('ExampleFilter')(testString); + const testString = 'computers are operated by keyboards'; + const resultString = $filter('ExampleFilter')(testString); expect(resultString).toEqual('computers are operated by leopards'); }); diff --git a/test/unit/services/example_spec.js b/test/unit/services/example_spec.js index fadce16f..77aba4d6 100644 --- a/test/unit/services/example_spec.js +++ b/test/unit/services/example_spec.js @@ -4,14 +4,14 @@ describe('Unit: ExampleService', function() { - var http, service; + let http, service; beforeEach(function() { // instantiate the app module angular.mock.module('app'); // mock the service - angular.mock.inject(function($httpBackend, ExampleService) { + angular.mock.inject(($httpBackend, ExampleService) => { http = $httpBackend; service = ExampleService; }); @@ -24,9 +24,9 @@ describe('Unit: ExampleService', function() { it('should retrieve data', function(done) { http.expect('GET', 'apiPath').respond(201, {data: 1234}); - service.get().then(function(result) { + service.get().then((result) => { expect(result).toEqual({data: 1234}); - }, function(error) { + }).catch((error) => { expect(error).toBeUndefined(); }).then(done);