stephnr / electron-angular-boilerplate

An Electron template app using AngularJS, Skeleton and a whoe sleuth of tools for building Windows/Mac/Linux desktop applications
MIT License
138 stars 40 forks source link

Testings are crashing #13

Closed jsanzmex closed 8 years ago

jsanzmex commented 8 years ago

Hi Stephen,

First off, your boilerplate is awesome :D

The problem is when I run tests with 'npm test'. I get this at the end:

START:
WARN [watcher]: Pattern "/Users/julio/Angular/electron-angular-boilerplate/bower_components/angular/angular.min.js" does not match any file.
WARN [watcher]: Pattern "/Users/julio/Angular/electron-angular-boilerplate/bower_components/angular-mocks/angular-mocks.js" does not match any file.
INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket 2CjQ7SSbjHGyWGD8IdrQ with id 38855003
PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR
  ReferenceError: Can't find variable: angular
  at /Users/julio/Angular/electron-angular-boilerplate/dist/app/home/home.js:4

node 5.0.0 npm 3.3.6 Mac OS X 10.11.1

I had to modify devDependencies at package.json to avoid warnings and errors:

  "devDependencies": {
    "babel": "^5.6.14",
    "babel-jest": "^6.0.1",
    "del": "^1.2.0",
    "electron-packager": "^4.1.3",
    "gulp": "^3.9.0",
    "gulp-autoprefixer": "^2.3.1",
    "gulp-clean": "^0.3.1",
    "gulp-istanbul": "^0.10.0",
    "gulp-load-plugins": "^1.0.0-rc.1",
    "gulp-notify": "^2.2.0",
    "gulp-plumber": "^1.0.1",
    "gulp-rename": "^1.2.2",
    "gulp-sass": "^2.0.1",
    "gulp-sourcemaps": "^1.5.2",
    "gulp-util": "^3.0.5",
    "jasmine": "^2.4.1",
    "jasmine-core": "^2.4.1",
    "jest-cli": "^0.8.2",
    "jspm": "^0.16.19",
    "karma": "^0.12.37",
    "karma-coverage": "^0.4.2",
    "karma-jasmine": "^0.3.6",
    "karma-mocha-reporter": "^1.0.2",
    "karma-phantomjs-launcher": "^0.2.0",
    "lodash": "^3.9.3",
    "phantomjs": "^1.9.17",
    "wiredep": "^2.2.2"
  },

I hope you can help me. I am planning to use you boilerplate for a project but I need tests up and running.

Kind Regards

jsanzmex commented 8 years ago

Hi,

I found out the angular and angular-mock files were not properly configured at karma.conf.js . This worked for me:

    // list of files / patterns to load in the browser
    files: [
      'dist/vendor/angular/angular.min.js',
      'dist/vendor/angular-mocks/angular-mocks.js',
      'dist/app/**/*.js',
      '__tests__/**/*.spec.js'
    ],
stephnr commented 8 years ago

@jsanzmex thank you. Let me make the change and verify this correction

stephnr commented 8 years ago

Wooo what a nasty bugger...

Fixed with new Build >> https://circleci.com/gh/Stephn-R/electron-angular-boilerplate/14