2014-01-29 02:11:50 +00:00
|
|
|
/*global module:false*/
|
|
|
|
module.exports = function(grunt) {
|
|
|
|
|
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
|
|
|
// Metadata.
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
|
|
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
|
|
|
|
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
|
|
|
|
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
|
|
|
|
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
|
|
|
|
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
|
|
|
|
// Task configuration.
|
|
|
|
uglify: {
|
|
|
|
options: {
|
|
|
|
banner: '<%= banner %>'
|
|
|
|
},
|
|
|
|
dist: {
|
2014-01-30 20:23:02 +00:00
|
|
|
files: {
|
|
|
|
'dist/loopback.min.js': ['dist/loopback.js']
|
|
|
|
}
|
2014-01-29 02:11:50 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
jshint: {
|
|
|
|
options: {
|
2014-01-30 20:23:02 +00:00
|
|
|
curly: false,
|
2014-01-29 02:11:50 +00:00
|
|
|
eqeqeq: true,
|
|
|
|
immed: true,
|
2014-01-30 20:23:02 +00:00
|
|
|
latedef: false,
|
2014-01-29 02:11:50 +00:00
|
|
|
newcap: true,
|
|
|
|
noarg: true,
|
|
|
|
sub: true,
|
|
|
|
undef: true,
|
2014-01-30 20:23:02 +00:00
|
|
|
unused: false,
|
2014-01-29 02:11:50 +00:00
|
|
|
boss: true,
|
|
|
|
eqnull: true,
|
|
|
|
browser: true,
|
2014-01-30 20:23:02 +00:00
|
|
|
asi: true,
|
|
|
|
node: true,
|
|
|
|
laxbreak: true,
|
2014-01-29 02:11:50 +00:00
|
|
|
globals: {
|
2014-01-30 20:23:02 +00:00
|
|
|
require: true,
|
|
|
|
jQuery: true,
|
|
|
|
process: true,
|
|
|
|
/* MOCHA */
|
|
|
|
describe: false,
|
|
|
|
it: false,
|
|
|
|
before: false,
|
|
|
|
beforeEach: false,
|
|
|
|
after: false,
|
|
|
|
afterEach: false,
|
|
|
|
assert: false,
|
|
|
|
request: false,
|
|
|
|
app: false,
|
|
|
|
loopback: false,
|
|
|
|
expect: true,
|
|
|
|
GeoPoint: true,
|
|
|
|
assertValidDataSource: true
|
2014-01-29 02:11:50 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
gruntfile: {
|
|
|
|
src: 'Gruntfile.js'
|
|
|
|
},
|
|
|
|
lib_test: {
|
|
|
|
src: ['lib/**/*.js', 'test/**/*.js']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
gruntfile: {
|
|
|
|
files: '<%= jshint.gruntfile.src %>',
|
|
|
|
tasks: ['jshint:gruntfile']
|
|
|
|
},
|
|
|
|
lib_test: {
|
|
|
|
files: '<%= jshint.lib_test.src %>',
|
|
|
|
tasks: ['jshint:lib_test']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
browserify: {
|
|
|
|
dist: {
|
|
|
|
files: {
|
|
|
|
'dist/loopback.js': ['index.js'],
|
|
|
|
},
|
|
|
|
options: {
|
2014-02-04 17:04:37 +00:00
|
|
|
ignore: ['nodemailer', 'passport'],
|
|
|
|
standalone: 'loopback'
|
2014-01-29 02:11:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mochaSelenium: {
|
|
|
|
options: {
|
|
|
|
// Mocha options
|
|
|
|
reporter: 'spec',
|
|
|
|
timeout: 30e3,
|
|
|
|
// Toggles wd's promises API, default:false
|
|
|
|
usePromises: false
|
|
|
|
},
|
|
|
|
firefox: {
|
|
|
|
src: ['test/*.js']
|
|
|
|
// firefox is the default browser, so no browserName option required
|
|
|
|
},
|
|
|
|
chrome: {
|
|
|
|
src: ['test/*.js'],
|
|
|
|
options: {
|
|
|
|
// Chrome browser must be installed from Chromedriver support
|
|
|
|
browserName: 'chrome'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
phantomjs: {
|
|
|
|
src: ['test/*.js'],
|
|
|
|
options: {
|
|
|
|
// phantomjs must be in the $PATH when invoked
|
|
|
|
browserName: 'phantomjs'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// todo appium
|
|
|
|
|
|
|
|
// These plugins provide necessary tasks.
|
2014-01-30 20:23:02 +00:00
|
|
|
grunt.loadNpmTasks('grunt-browserify');
|
2014-01-29 02:11:50 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
grunt.loadNpmTasks('grunt-mocha-selenium');
|
|
|
|
|
|
|
|
// Default task.
|
2014-01-30 20:23:02 +00:00
|
|
|
grunt.registerTask('default', ['browserify', 'mochaSelenium']);
|
2014-01-29 02:11:50 +00:00
|
|
|
|
|
|
|
};
|