Skip to content

Commit

Permalink
Set up Unit Tests
Browse files Browse the repository at this point in the history
Test Version
  • Loading branch information
snapjay committed Jan 25, 2015
1 parent 27fd2cd commit 752c175
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function (grunt) {
separator: ';'
},
dist: {
src: ['src/*.js'],
src: ['src/ngCart.js', 'src/ngCart.directives.js'],
dest: "dist/ngCart.js"
}
},
Expand All @@ -31,15 +31,15 @@ module.exports = function (grunt) {

karma: {
unit: {
configFile: 'test/karma.conf.js',
configFile: 'karma.conf.js',
background: true
},
once: {
configFile: 'test/karma.conf.js',
configFile: 'karma.conf.js',
singleRun: true
},
travis: {
configFile: 'test/karma.conf.js',
configFile: 'karma.conf.js',
singleRun: true,
browsers: ['PhantomJS']
}
Expand Down
5 changes: 2 additions & 3 deletions test/karma.conf.js → karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
module.exports = function (config) {
config.set({

basePath: '../',
basePath: './',

files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'bower_components/lodash/dist/lodash.js',
'src/**/*.js',
'test/unit/**/*.js'
'src/**/*.js'
],

autoWatch: false,
Expand Down
Empty file added src/ngCart.directives_test.js
Empty file.
11 changes: 11 additions & 0 deletions src/ngCart_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

describe('ngCart.version module', function() {
beforeEach(module('ngCart'));

describe('version service', function() {
it('should return current version', inject(function(version) {
expect(version).toEqual('0.0.3-rc.1');
}));
});
});

0 comments on commit 752c175

Please sign in to comment.