Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Rashid Khan 2014-03-03 15:27:23 -07:00
commit a6d7a2a092
8 changed files with 33 additions and 18 deletions

View file

@ -33,5 +33,6 @@
"sub": true,
"maxlen": 140,
"-W084": true,
"maxerr": 10
}
"maxerr": 10,
"scripturl": true
}

3
.travis.yml Normal file
View file

@ -0,0 +1,3 @@
language: node_js
node_js:
- "0.10"

View file

@ -16,7 +16,8 @@
"mocha": "~1.17.1",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-jade": "~0.10.0",
"grunt-contrib-less": "~0.9.0"
"grunt-contrib-less": "~0.9.0",
"grunt-cli": "~0.1.13"
},
"scripts": {
"test": "grunt test",

View file

@ -1,13 +1,13 @@
module.exports = function(config) {
module.exports = function (config) {
return {
// just lint the source dir
source: {
files: {
src: ['Gruntfile.js', '<%= root %>/src/**/*.js']
src: ['Gruntfile.js', '<%= src %>/**/*.js', '<%= unitTestDir %>/**/*.js', '<%= root %>/tasks/**/*.js']
}
},
options: {
jshintrc: '<%= root %>/.jshintrc',
jshintrc: true,
ignores: [
'node_modules/*',
'dist/*',

View file

@ -1,6 +1,7 @@
module.exports = function (grunt) {
/* jshint scripturl:true */
grunt.registerTask('test', [
'jshint',
'connect:test',
'jade:test',
'mocha:unit'

View file

@ -0,0 +1,18 @@
define(function (require) {
return {
test: {
mappings: {
testType: {
'foo.bar': {
full_name: 'foo.bar',
mapping: {
bar: {
type: 'string'
}
}
}
}
}
}
};
});

View file

@ -14,7 +14,7 @@
}
}
});
require(["/specs/apps/dashboard/index.js","/specs/calculate_indices.js","/specs/courier.js","/specs/data_source.js","/specs/mapper.js"], function () {
require(["/fixtures/field_mapping.js","/specs/calculate_indices.js","/specs/courier.js","/specs/data_source.js","/specs/mapper.js"], function () {
window.mochaRunner = mocha.run().on('end', function () {
window.mochaResults = this.stats;
});

View file

@ -5,6 +5,7 @@ define(function (require) {
var Courier = require('courier/courier');
var DataSource = require('courier/data_source/data_source');
var Mapper = require('courier/mapper');
var fieldMapping = require('../fixtures/field_mapping.js');
var client = new elasticsearch.Client({
host: 'localhost:9200',
@ -26,17 +27,7 @@ define(function (require) {
// Stub out a mini mapping response.
sinon.stub(client.indices, 'getFieldMapping',function (params, callback) {
if(params.index === 'valid') {
setTimeout(callback(undefined,{
test: {
mappings: {
testType: {
'foo.bar': {
full_name: 'foo.bar',
mapping: {
bar: {
type: 'string'
} } } } } } }
),0);
setTimeout(callback(undefined, fieldMapping),0);
} else {
setTimeout(callback('Error: Not Found',undefined));
}