forked from gsklee/ngStorage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build up the unit testing infrastructure with Karma, Mocha, and Chai;…
… refine Gruntfile.js
- Loading branch information
Gias Kay Lee
committed
Oct 16, 2013
1 parent
2f36c9c
commit 9adb17f
Showing
7 changed files
with
96 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "components" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
components | ||
.DS_Store | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,50 @@ | ||
'use strict'; | ||
|
||
module.exports = function(grunt) { | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
|
||
karma: { | ||
unit: { | ||
options: { | ||
files: [ | ||
'components/angular/angular.js', | ||
'components/angular-mocks/angular-mocks.js', | ||
'components/chai/chai.js', | ||
'ngStorage.js', | ||
'test/spec.js' | ||
] | ||
}, | ||
|
||
frameworks: ['mocha'], | ||
|
||
browsers: [ | ||
'Chrome', | ||
'PhantomJS', | ||
'Firefox' | ||
], | ||
|
||
singleRun: true | ||
} | ||
}, | ||
|
||
uglify: { | ||
options: { | ||
banner: '/*! <%= pkg.name %> <%= pkg.version %> | Copyright (c) <%= grunt.template.today("yyyy") %> Gias Kay Lee | MIT License */' | ||
}, | ||
|
||
build: { | ||
src: '<%= pkg.name %>.js', | ||
dest: '<%= pkg.name %>.min.js' | ||
} | ||
} | ||
}); | ||
|
||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
grunt.loadNpmTasks('grunt-karma'); | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
uglify: { | ||
options: { | ||
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' | ||
}, | ||
build: { | ||
src: '<%= pkg.name %>.js', | ||
dest: '<%= pkg.name %>.min.js' | ||
} | ||
} | ||
}); | ||
|
||
// Load the plugin that provides the "uglify" task. | ||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
|
||
// Default task(s). | ||
grunt.registerTask('default', ['uglify']); | ||
|
||
}; | ||
grunt.registerTask('default', [ | ||
'karma', | ||
'uglify' | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
{ | ||
"name": "ngstorage", | ||
"version": "0.2.3", | ||
"main": "./ngStorage.js", | ||
"keywords": [ | ||
"angular", | ||
"cookie", | ||
"storage", | ||
"local", | ||
"localstorage", | ||
"session", | ||
"sessionstorage" | ||
], | ||
"dependencies": { | ||
"angular": ">=1.0.8" | ||
}, | ||
"devDependencies": { | ||
"angular-mocks": ">=1.0.8", | ||
"chai": "~1.8.1" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
{ | ||
"name": "ngStorage", | ||
"version": "0.2.3", | ||
"description": "An AngularJS module that makes Web Storage working in the Angular Way. Contains two services: $localStorage and $sessionStorage.", | ||
"main": "ngStorage.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/gsklee/ngStorage.git" | ||
}, | ||
"author": "gsklee", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/gsklee/ngStorage/issues" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-uglify": "~0.2.4" | ||
} | ||
"name": "ngStorage", | ||
"version": "0.2.3", | ||
"private": true, | ||
"author": "Gias Kay Lee", | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://github.com/gsklee/ngStorage/blob/master/LICENSE" | ||
} | ||
], | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-uglify": "~0.2.4", | ||
"grunt-karma": "~0.7.1", | ||
"karma-mocha": "~0.1.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
describe('ngStorage', function () { | ||
var expect = chai.expect; | ||
|
||
beforeEach(module('ngStorage')); | ||
|
||
it('should contain a $localStorage service', inject(function( | ||
$localStorage | ||
){ | ||
expect($localStorage).not.to.equal(null); | ||
})); | ||
}); |