forked from cabrel/angular-lodash
-
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.
Added test runner + jshint, added LoDash available through AngularJS …
…DI service. Added 'has' in to filter list, because it was missing. Updated examples.
- Loading branch information
Showing
8 changed files
with
191 additions
and
59 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
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
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
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,54 @@ | ||
// Karma configuration | ||
// http://karma-runner.github.io/0.10/config/configuration-file.html | ||
|
||
'use strict'; | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
// base path, that will be used to resolve files and exclude | ||
basePath: './', | ||
|
||
// testing framework to use (jasmine/mocha/qunit/...) | ||
frameworks: ['jasmine'], | ||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
'node_modules/angular/angular.js', | ||
'node_modules/angular-mocks/angular-mocks.js', | ||
'node_modules/lodash/lodash.js', | ||
|
||
'angular-lodash.js', | ||
'test/apiSpec.js', | ||
'test/serviceSpec.js', | ||
'test/ngFilterSpec.js', | ||
'test/filterSpec.js' | ||
], | ||
|
||
preprocessors: {/*None*/}, | ||
|
||
// list of files / patterns to exclude | ||
exclude: [], | ||
|
||
// level of logging | ||
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: false, | ||
|
||
// Start these browsers, currently available: | ||
// - Chrome | ||
// - ChromeCanary | ||
// - Firefox | ||
// - Opera | ||
// - Safari (only Mac) | ||
// - PhantomJS | ||
// - IE (only Windows) | ||
browsers: ['PhantomJS'], | ||
|
||
// Continuous Integration mode | ||
// if true, it capture browsers, run tests and exit | ||
singleRun: true | ||
}); | ||
}; |
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
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,10 +1,27 @@ | ||
'use strict'; | ||
|
||
describe('ropooy-angular-lodash: API', function() { | ||
beforeEach(module('_')); | ||
_.each(_.functions(_), function(fnName) { | ||
it(fnName + ' should adapt to lodash\'s '+ fnName, inject(function($rootScope) { | ||
expect($rootScope[fnName].toString()).toBe(_[fnName].toString()); | ||
describe('ropooy-angular-lodash: API', function () { | ||
beforeEach(module('ropooy-angular-lodash/utils')); | ||
|
||
var $window, | ||
$rootScope; | ||
|
||
beforeEach(inject(function (_$window_, _$rootScope_) { | ||
$window = _$window_; | ||
$rootScope = _$rootScope_; | ||
})); | ||
}); | ||
|
||
describe('Testing LoDash methods', function () { | ||
it('Should be a function ($window._)', inject(function () { | ||
expect(angular.isFunction($window._)).toBe(true); | ||
})); | ||
|
||
var testData = _.functions(_); | ||
|
||
angular.forEach(testData, function(fnName) { | ||
it('Should match LoDash ' + fnName + ' -method in to $rootScope', function() { | ||
expect(angular.isFunction($rootScope[fnName])).toBe(true); | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.