From ae6b81ec5c8ac2d6ea7aeb759d5bf22681b5b3d9 Mon Sep 17 00:00:00 2001 From: Adam Bullmer Date: Sun, 16 Jul 2017 00:46:50 -0500 Subject: [PATCH] Updated karma and karma-jasmine - gets rid of deprecation notice from outdated plugin - updates karma plugin to be broccoli 1.0 compatible Resolves #32 --- .circleci/config.yml | 14 ++------------ .circleci/images/primary/Dockerfile | 3 ++- .eslintrc | 3 --- lib/angular-app.js | 6 +++--- package.json | 13 +++++++------ 5 files changed, 14 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 281cabb..43e6ef6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,8 @@ defaults: &defaults version: 2 jobs: - build: + + test: <<: *defaults steps: - checkout @@ -25,13 +26,6 @@ jobs: root: . paths: - node_modules - - test: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: /angular-bro-app - run: name: unit-tests command: npm run test -- --reporter mocha-junit-reporter --reporter-options mochaFile=$(pwd)/junit/test-results.xml @@ -62,13 +56,9 @@ workflows: version: 2 build_and_test: jobs: - - build - test: - requires: - - build - deploy: requires: - - build - test filters: branches: diff --git a/.circleci/images/primary/Dockerfile b/.circleci/images/primary/Dockerfile index ee96da6..4932bb6 100644 --- a/.circleci/images/primary/Dockerfile +++ b/.circleci/images/primary/Dockerfile @@ -10,4 +10,5 @@ RUN apk update && \ nodejs \ nodejs-npm \ && \ - rm -rf /var/cache/apk/* + rm -rf /var/cache/apk/* && \ + npm install -g npm@^4 diff --git a/.eslintrc b/.eslintrc index 5cb5374..690eee7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -8,9 +8,6 @@ } }, "env": { - "browser": true, - "jasmine": true, - "jquery": true, "node": true }, "globals": { diff --git a/lib/angular-app.js b/lib/angular-app.js index 0a64383..8d030a1 100644 --- a/lib/angular-app.js +++ b/lib/angular-app.js @@ -14,7 +14,7 @@ const Funnel = require('broccoli-funnel'), amdNameResolver = require('amd-name-resolver').moduleResolve, amdLoader = require('broccoli-amd-loader'), Babel = require('broccoli-babel-transpiler'), - unitTest = require('broccoli-karma-plugin'), + unitTest = require('broccoli-plugin-karma'), writeFile = require('broccoli-file-creator'), wrap = require('broccoli-wrap'), chalk = require('chalk'), @@ -377,7 +377,7 @@ AngularApp.prototype.runTests = function (appScriptsTree, addonsScriptsTree, ven }); } - unitTestingResults = unitTest(mergeTrees([vendorScriptsTree, addonsScriptsTree, appScriptsTree, tests, lintingResults], { + unitTestingResults = new unitTest(mergeTrees([vendorScriptsTree, addonsScriptsTree, appScriptsTree, tests, lintingResults], { annotation: 'Merge Trees: Vendor Scripts, Addon Scripts, App Scripts, tests, linting' }), karmaConfig); @@ -403,7 +403,7 @@ AngularApp.prototype.toTree = function () { lintingResults = this.runLinter(appScripts, appStyles); - appScripts = this.babel(mergeTrees([appScripts, templates])); + appScripts = this.babel(mergeTrees([appScripts, templates])); addonsScripts = this.babel(addonsScripts); appScripts = ngAnnotate(appScripts , { add: true, annotation: 'Ng Annotate: App Scripts' }); addonsScripts = ngAnnotate(addonsScripts , { add: true, annotation: 'Ng Annotate: Addons Scripts' }); diff --git a/package.json b/package.json index c617daf..eaa0b30 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "angular-bro-app", - "version": "0.11.3", + "version": "0.12.0", "description": "Angular broccoli plugin and compilation routine", "main": "lib/angular-app.js", "scripts": { "test": "nyc mocha 'test/**/*.test.js'", "posttest": "npm run coverage", - "lint": "eslint .", + "lint": "eslint lib", "coverage": "nyc report --reporter=html", "coveralls": "nyc report --reporter=text-lcov | coveralls" }, @@ -43,21 +43,22 @@ "broccoli-htmlmin": "^2.1.0", "broccoli-imagemin": "^0.2.1", "broccoli-inject-livereload": "^0.2.0", - "broccoli-karma-plugin": "^0.1.1", "broccoli-less-single": "^0.6.0", "broccoli-lint-eslint": "^3.2.1", "broccoli-livereload-middleware": "0.1.1", "broccoli-merge-trees": "^1.1.1", "broccoli-ng-annotate": "^2.0.0", + "broccoli-plugin-karma": "^1.0.0", "broccoli-uglify-js": "^0.1.3", "broccoli-wrap": "0.0.2", "chalk": "^1.1.3", "express": "^4.13.4", "jasmine-core": "^2.4.1", "js-string-escape": "^1.0.1", - "karma": "^0.13.22", - "karma-coverage": "^0.5.5", - "karma-jasmine": "^0.3.8", + "karma": "^1.7.0", + "karma-babel-preprocessor": "^6.0.1", + "karma-coverage": "^1.1.1", + "karma-jasmine": "^1.1.0", "karma-jasmine-html-reporter": "^0.2.0", "karma-phantomjs-launcher": "^1.0.0", "lodash": "^4.6.1"