Skip to content

Commit

Permalink
Just laying out test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidenari Nozaki committed Feb 14, 2014
1 parent 9e6ec01 commit b104c42
Show file tree
Hide file tree
Showing 7 changed files with 225 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
bower_components
.*.swp
.DS_Store
43 changes: 43 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": false,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"white": false,
"globals": {
"angular": false,
"_": false,
"_V_": false,
"afterEach": false,
"beforeEach": false,
"confirm": false,
"context": false,
"describe": false,
"expect": false,
"it": false,
"jasmine": false,
"JSHINT": false,
"mostRecentAjaxRequest": false,
"qq": false,
"runs": false,
"spyOn": false,
"spyOnEvent": false,
"waitsFor": false,
"xdescribe": false
}
}
61 changes: 61 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
module.exports = function (grunt) {
'use strict';

var initConfig;

// Loading external tasks
require('load-grunt-tasks')(grunt);

// Project configuration.
initConfig = {
bower: 'bower_components',
pkg: grunt.file.readJSON('package.json'),
watch: {
test: {
// Lint & run unit tests in Karma
// Just running `$ grunt watch` will only lint your code; to run tests
// on watch, use `$ grunt watch:karma` to start a Karma server first
files: ['src/select2.js', 'test/select2Spec.js'],
tasks: ['jshint', 'karma:unit:run']
}
},
karma: {
options: {
configFile: 'test/karma.conf.js',
browsers: ['Firefox', 'PhantomJS']
},
unit: {
singleRun: true
},
watch: {
autoWatch: true
},
server: {
background: true
}
},
jshint: {
all:[
'gruntFile.js',
'src/**/*.js',
'test/**/*Spec.js'
],
options: {
jshintrc: '.jshintrc'
}
},
changelog: {
options: {
dest: 'CHANGELOG.md'
}
}
};

// Register tasks
grunt.registerTask('default', ['jshint', 'karma:unit']);
grunt.registerTask('watch', ['jshint', 'karma:watch']);

grunt.initConfig(initConfig);
};


8 changes: 7 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@
"example",
"bower_components",
"node_modules"
]
],
"dependencies": {
"angular": ">=1.2.0"
},
"devDependencies": {
"angular-mocks": ">=1.2.0"
}
}
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"authors": [
"Daryl Rowland <[email protected]>"
],
"name": "angucomplete",
"description": "Awesome Autocompleteness for AngularJS",
"version": "1.0.0",
"homepage": "http://darylrowland.github.io/angucomplete/",
"engines": {
"node": ">= 0.8.4"
},
"dependencies": {},
"devDependencies": {
"async": "0.1.x",
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-watch": "~0.5.3",
"grunt-karma": "~0.6.2",
"karma": "~0.10.2",
"grunt-conventional-changelog": "~1.0.0",
"load-grunt-tasks": "~0.2.0"
}
}
10 changes: 10 additions & 0 deletions test/angucompleteSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

describe('angucomplete', function() {
beforeEach(module('angucomplete'));

it('should pass this simple test', function() {
expect(true).toBe(true);
});

});
77 changes: 77 additions & 0 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Karma configuration
// Generated on Tue Sep 17 2013 06:59:46 GMT-0400 (EDT)

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

// base path, that will be used to resolve files and exclude
basePath: '..',


// frameworks to use
frameworks: ['jasmine'],


// list of files / patterns to load in the browser
files: [
// Dependencies
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',

// Source Code
'angucomplete.js',

// Test Specs
'test/*Spec.js'
],


// list of files to exclude
exclude: [

],


// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['progress'],


// 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: false,

// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Chrome'],


// If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000,


// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false


});
};

0 comments on commit b104c42

Please sign in to comment.