Skip to content

Commit

Permalink
Add support for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
outcoldman committed Mar 26, 2014
1 parent 8d61952 commit cc7e6d6
Show file tree
Hide file tree
Showing 99 changed files with 2,236 additions and 31,477 deletions.
29 changes: 26 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ module.exports = function(grunt) {
'js/**/*.js',
'!js/lib/*'
],
tests: {
// suppress chai asserts
options: {
expr: true
},
src: [ 'test/**/*.js' ]
},
other: {
options: {
node: true
Expand All @@ -21,18 +28,34 @@ module.exports = function(grunt) {
}
},

// Tests
karma: {
unit: {
configFile: './test/unit.conf.js'
},
chrome: {
configFile: './test/unit.conf.js',
browsers: ['Chrome'],
singleRun: false,
autoWatch: true,
reporters: ['progress', 'mocha']
}
},

// Development
watch: {
dev: {
files: ['js/**/*.js'],
tasks: ['jshint']
files: ['js/**/*.js', 'test/**/*.js'],
tasks: ['jshint', 'karma:unit']
}
}
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');

grunt.registerTask('default', ['watch']);
grunt.registerTask('test', ['jshint']);
grunt.registerTask('test', ['jshint', 'karma:unit']);
grunt.registerTask('chrome', ['karma:chrome']);
};
5 changes: 2 additions & 3 deletions app.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
<title>Dewey</title>

<link rel='stylesheet' href='css/style.css'>
<script src='bower_components/requirejs/require.js'></script>
<script src='js/startup.js'></script>
<script data-main='js/startup' src='bower_components/requirejs/require.js'></script>
</head>
<body>
<div ui-view></div>
<div ng-view></div>
<div class="row" id="loadMorePlaceholder" />
</body>
</html>
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"requirejs": "~2.1.10",
"underscore": "~1.5.2",
"bootstrap": "~3.1.0",
"angular-ui-router": "0.2.7",
"ui-bootstrap": "~0.10.0",
"bootstrap-tagsinput": "~0.3.9",
"color-thief": "*"
"color-thief": "*",
"angular-route": "~1.2.15"
}
}
19 changes: 19 additions & 0 deletions bower_components/angular-mocks/.bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "angular-mocks",
"version": "1.2.15",
"main": "./angular-mocks.js",
"dependencies": {
"angular": "1.2.15"
},
"homepage": "https://github.com/angular/bower-angular-mocks",
"_release": "1.2.15",
"_resolution": {
"type": "version",
"tag": "v1.2.15",
"commit": "6ea137cb6f72c6b1d424702345b6c077db722214"
},
"_source": "git://github.com/angular/bower-angular-mocks.git",
"_target": "~1.2.15",
"_originalSource": "angular-mocks",
"_direct": true
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
# bower-angular-mocks

This repo is for distribution on `bower`. The source for this module is in the
[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngMock).
Please file issues and pull requests against that repo.

## Install

Install with `bower`:

```shell
bower install angular-mocks
```

## Documentation

Documentation is available on the
[AngularJS docs site](http://docs.angularjs.org/guide/dev_guide.unit-testing).

## License

The MIT License

Copyright (c) 2013 Karsten Sperling
Copyright (c) 2010-2012 Google, Inc. http://angularjs.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit cc7e6d6

Please sign in to comment.