diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..300c65d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules +bower_components +.*.swp +.DS_Store diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..fc6f18d --- /dev/null +++ b/.jshintrc @@ -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 + } +} diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..c9c49d5 --- /dev/null +++ b/Gruntfile.js @@ -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); +}; + + diff --git a/bower.json b/bower.json index e5679fa..a15705b 100644 --- a/bower.json +++ b/bower.json @@ -17,5 +17,11 @@ "example", "bower_components", "node_modules" - ] + ], + "dependencies": { + "angular": ">=1.2.0" + }, + "devDependencies": { + "angular-mocks": ">=1.2.0" + } } diff --git a/package.json b/package.json new file mode 100644 index 0000000..4624968 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "authors": [ + "Daryl Rowland " + ], + "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" + } +} diff --git a/test/angucompleteSpec.js b/test/angucompleteSpec.js new file mode 100644 index 0000000..857f789 --- /dev/null +++ b/test/angucompleteSpec.js @@ -0,0 +1,10 @@ +'use strict'; + +describe('angucomplete', function() { + beforeEach(module('angucomplete')); + + it('should pass this simple test', function() { + expect(true).toBe(true); + }); + +}); diff --git a/test/karma.conf.js b/test/karma.conf.js new file mode 100644 index 0000000..f38de33 --- /dev/null +++ b/test/karma.conf.js @@ -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 + + + }); +};