Skip to content

Commit

Permalink
Move service files over, infrastructure for test
Browse files Browse the repository at this point in the history
  • Loading branch information
softwaredoug committed Jul 29, 2014
1 parent 6da2358 commit 17c0894
Show file tree
Hide file tree
Showing 12 changed files with 900 additions and 79 deletions.
16 changes: 8 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');

grunt.loadNpmTasks('grunt-karma');
/**
Function that wraps everything to allow dynamically setting/changing grunt options and config later by grunt task. This init function is called once immediately (for using the default grunt options, config, and setup) and then may be called again AFTER updating grunt (command line) options.
@toc 3.
Expand Down Expand Up @@ -81,17 +81,17 @@ module.exports = function(grunt) {
},
build: {
files: {},
src: 'r-search.js',
dest: 'r-search.min.js'
src: 'services/*.js',
dest: 'splainer-search.min.js'
}
}/*,
},
karma: {
unit: {
configFile: publicPathRelativeRoot+'config/karma.conf.js',
configFile: 'karma.conf.js',
singleRun: true,
browsers: ['PhantomJS']
}
}*/
}
});


Expand All @@ -100,9 +100,9 @@ module.exports = function(grunt) {
@toc 6.
*/
// Default task(s).
grunt.registerTask('default', ['jshint:beforeconcatQ', 'uglify:build']);
grunt.registerTask('default', ['jshint:beforeconcatQ', 'karma:unit', 'uglify:build']);

}
init({}); //initialize here for defaults (init may be called again later within a task)

};
};
52 changes: 26 additions & 26 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "splainer-search-demo",
"version": "0.0.0",
"authors": [
"Doug Turnbull <[email protected]>"
],
"description": "Demo",
"keywords": [
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular":"~1.2.0",
"angular-sanitize":"~1.2.0",
"angular-route":"~1.2.0",
"angular-touch":"~1.2.0"
},
"devDependencies": {
}
}
{
"name": "splainer-search-demo",
"version": "0.0.0",
"authors": [
"Doug Turnbull <[email protected]>"
],
"description": "Demo",
"keywords": [],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": "~1.2.0",
"angular-sanitize": "~1.2.0",
"angular-route": "~1.2.0",
"angular-touch": "~1.2.0"
},
"devDependencies": {
"angular-mocks": "~1.2.21"
}
}
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
<script type="text/javascript" src="bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script type="text/javascript" src="bower_components/angular-touch/angular-touch.min.js"></script>

<script type="text/javascript" src="r-search.js"></script>
<!--<script type="text/javascript" src="r-search.min.js"></script>-->
<script type="text/javascript" src="services/normalDocsSvc.js"></script>
<script type="text/javascript" src="services/fieldSpecSvc.js"></script>
<script type="text/javascript" src="services/vectorSvc.js"></script>
<script type="text/javascript" src="services/explainSvc.js"></script>
<script type="text/javascript" src="services/solrSearchSvc.js"></script>

<script type="text/javascript" src="app.js"></script>

Expand Down
71 changes: 71 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Karma configuration
// http://karma-runner.github.io/0.12/config/configuration-file.html
// Generated on 2014-07-17 using
// generator-karma 0.8.3

module.exports = function(config) {
'use strict';

config.set({
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,

// 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: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'module.js',
'services/**/*.js',
'test/mock/**/*.js',
'test/spec/**/*.js'
],

// list of files / patterns to exclude
exclude: [],

// web server port
port: 8080,

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

// Which plugins to enable
plugins: [
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-jasmine'
],

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

colors: true,

// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,

// Uncomment the following lines if you are using grunt's server to run the tests
// proxies: {
// '/': 'http://localhost:9000/'
// },
// URL root prevent conflicts with the site root
// urlRoot: '_karma_'
});
};
1 change: 1 addition & 0 deletions module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
angular.module('o19s.splainer-search', []);
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"author": "",
"name": "splainer-search-demo",
"version": "0.0.0",
"description": "",
"homepage": "",
"dependencies": {
},
"devDependencies": {
"express":"~3.4.4",
"grunt": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.5",
"grunt-contrib-jshint": "~0.7.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": "",
"engines":{
"node":"0.10.10"
}
}
{
"author": "",
"name": "splainer-search-demo",
"version": "0.0.0",
"description": "",
"homepage": "",
"dependencies": {},
"devDependencies": {
"express": "~3.4.4",
"grunt": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-jshint": "~0.7.0",
"grunt-contrib-uglify": "~0.2.5",
"grunt-karma": "^0.8.3"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": "",
"engines": {
"node": "0.10.10"
}
}
20 changes: 0 additions & 20 deletions r-search.js

This file was deleted.

Loading

0 comments on commit 17c0894

Please sign in to comment.