Skip to content

Commit

Permalink
Merge pull request #2 from dkingicct/develop
Browse files Browse the repository at this point in the history
camera, unit tests and file structure
  • Loading branch information
dennisdunn committed Mar 5, 2016
2 parents 5edea1c + ce1dee5 commit b4bff45
Show file tree
Hide file tree
Showing 29 changed files with 1,410 additions and 258 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -36,7 +36,9 @@ npm-debug.log
node_modules/
platforms/
plugins/
coverage/
www/lib
resources/android
resources/ios
*.swp
.DS_Store
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -9,6 +9,23 @@ technologies like HTML5, CSS, and Javascript.

Our tool set pulls from the nodejs environment.

##Unit tests

* Testing Suite
* Test runner - Karma
* Test framework - Jasmine

http://karma-runner.github.io/0.13/index.html
http://jasmine.github.io/

* Running tests
```
karma start
```

* Viewing Unit Test Coverage report
* The coverage report will be generated after you start karma and will be located in /coverage/Chrome*/index.html

## Quick(ish) Start

* Install nodejs from nodejs.org. Windows users will download and run the installer while
Expand Down
8 changes: 5 additions & 3 deletions bower.json
Expand Up @@ -11,12 +11,14 @@
"pouchdb": "~5.1.0",
"angular-pouchdb": "~4.1.0",
"ionic-material": "~0.4.2",
"robotodraft": "~1.1.0"
"robotodraft": "~1.1.0",
"angular-mocks": "^1.5.0"
},
"resolutions": {
"angular": "1.4.9",
"angular": "1.5.0",
"ionic": "1.2.1",
"angular-animate": "1.4.3",
"angular-sanitize": "1.4.3"
"angular-sanitize": "1.4.3",
"angular-mocks": "^1.5.0"
}
}
91 changes: 91 additions & 0 deletions karma.conf.js
@@ -0,0 +1,91 @@
// Karma configuration
// Generated on Mon Feb 29 2016 07:54:43 GMT-0500 (Eastern Standard Time)

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: './',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],

// add plugins to make coverage work
plugins: [
'karma-jasmine',
'karma-coverage',
'karma-chrome-launcher',
'karma-firefox-launcher',
],
// list of files / patterns to load in the browser
files: [
//Dependencies
'www/lib/angular/angular.min.js',
'www/lib/angular-mocks/angular-mocks.js',
//'www/lib/angular/angular.min.js.map',
//Files under tests
'www/js/app.js',
'www/js/controllers/*.js',
'www/js/services/*.js',


//tests
'www/tests/*/*.js'
],


// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: { 'www/js/*/*.js': 'coverage'
},
//define output for coverage report
coverageReporter: {
'type': 'html',
'dir': 'coverage/',
'file': 'coverage.html'
},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -6,12 +6,14 @@
"devDependencies": {
"bower": "^1.3.3",
"gulp": "^3.5.6",
"gulp-angular-templatecache": "^1.8.0",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^2.0.4",
"gulp-angular-templatecache": "^1.8.0",
"gulp-util": "^2.2.14",
"karma": "^0.13.21",
"karma-jasmine": "^0.3.7",
"shelljs": "^0.3.0"
},
"cordovaPlugins": [
Expand Down
16 changes: 13 additions & 3 deletions www/index.html
Expand Up @@ -31,8 +31,18 @@

<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
<!-- app controllers -->
<script src="js/controllers/HomeCtrl.js"></script>
<script src="js/controllers/MenuCtrl.js"></script>
<script src="js/controllers/PatientCtrl.js"></script>
<script src="js/controllers/SearchCtrl.js"></script>
<script src="js/controllers/SettingsCtrl.js"></script>
<!-- app services -->
<script src="js/services/CameraService.js"></script>
<script src="js/services/CdsiService.js"></script>
<script src="js/services/PatientService.js"></script>
<script src="js/services/SettingsService.js"></script>
<!-- app data -->
<script src="data/medical.js"></script>
<script src="data/cdsi.js"></script>
</head>
Expand All @@ -41,4 +51,4 @@
<ion-nav-view></ion-nav-view>
</body>

</html>
</html>
6 changes: 4 additions & 2 deletions www/js/app.js
@@ -1,6 +1,8 @@
"use strict";

angular.module('templates',[]);
angular.module('app.controllers',[]);
angular.module('app.services',[]);

// Ionic Starter App
angular.module('app', ['ionic', 'ionic-material', 'app.controllers', 'app.services', 'data.medical', 'data.cdsi','pouchdb'])
Expand All @@ -25,8 +27,8 @@ angular.module('app', ['ionic', 'ionic-material', 'app.controllers', 'app.servic
.config(function ($stateProvider, $urlRouterProvider, $ionicConfigProvider) {

if (ionic.Platform.isAndroid())
$ionicConfigProvider.scrolling.jsScrolling(false);
$ionicConfigProvider.scrolling.jsScrolling(false);

// Ionic uses AngularUI Router which uses the concept of states
// Learn more here: https://github.com/angular-ui/ui-router
// Set up the various states which the app can be in.
Expand Down
142 changes: 0 additions & 142 deletions www/js/controllers.js

This file was deleted.

9 changes: 9 additions & 0 deletions www/js/controllers/HomeCtrl.js
@@ -0,0 +1,9 @@
"use strict";

angular.module('app.controllers')

.controller('HomeCtrl', function ($scope, $state) {
$scope.goSearch = function () {
$state.go('app.search');
}
});
11 changes: 11 additions & 0 deletions www/js/controllers/MenuCtrl.js
@@ -0,0 +1,11 @@
"use strict";

angular.module('app.controllers')

.controller('MenuCtrl', function ($scope, $state, PatientService) {
$scope.showPatient = function () {
$state.go('app.patient', {
patientId: PatientService.currentId
});
};
});

0 comments on commit b4bff45

Please sign in to comment.