From 9a75bb142545b2c3dd8b911cfae72345b3f65410 Mon Sep 17 00:00:00 2001 From: Justin Pumford Date: Fri, 12 Aug 2016 13:34:06 -0600 Subject: [PATCH] refactor(karma.conf.js,package.json): remove testingDeps key and add angular-mocks dep --- other/karma.conf.es6.js | 8 +------- other/tests.js | 1 + package.json | 4 +--- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/other/karma.conf.es6.js b/other/karma.conf.es6.js index 6f4e1fd..3eb20ad 100644 --- a/other/karma.conf.es6.js +++ b/other/karma.conf.es6.js @@ -2,12 +2,6 @@ module.exports = config => { // load external cdn dependencies const pkg = require('../package.json'); const cdns = Object.values(pkg.cdnDependencies); - const testingDeps = Object.values(pkg.testingDependencies); - // add angular mocks - const externalFiles = [ - ...cdns, - ...testingDeps - ]; // entry file that bundles all the test files const testEntryFile = './other/tests.js'; @@ -18,7 +12,7 @@ module.exports = config => { config.set({ frameworks: ['mocha', 'chai', 'sinon'], files: [ - ...externalFiles, + ...cdns, testEntryFile ], preprocessors: { diff --git a/other/tests.js b/other/tests.js index 49216f8..06165c2 100644 --- a/other/tests.js +++ b/other/tests.js @@ -1,3 +1,4 @@ +require('angular-mocks/ngMock'); const testFiles = require.context('../src', true, /\.spec\.js$/); const ngModule = angular.module('da.test', []); testFiles.keys().forEach(key => { testFiles(key)(ngModule); }); diff --git a/package.json b/package.json index 038a092..3e4b239 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "license": "SEE LICENSE IN LICENSE", "devDependencies": { "@domoinc/da-plop": "^3.0.0", + "angular-mocks": "^1.5.8", "autoprefixer": "^6.1.2", "babel-core": "^6.3.17", "babel-loader": "^6.2.0", @@ -102,9 +103,6 @@ "angular-animate": "https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.3/angular-animate.min.js", "angular-ui-router": "https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.15/angular-ui-router.min.js" }, - "testingDependencies": { - "angular-mocks": "https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.3/angular-mocks.js" - }, "config": { "AppTeam6": { "framework": "da-webpack",