2
0
Fork 0

made pass jshint and strict

This commit is contained in:
Willem 2016-04-23 03:58:27 +02:00
parent f37d735890
commit 583b7d8cc3
9 changed files with 16 additions and 63 deletions

View file

@ -1,2 +0,0 @@
node_modules
example

View file

@ -1,38 +0,0 @@
{
"predef": [
"before",
"after",
"it",
"describe",
"beforeEach",
"afterEach"
],
"asi" : false,
"bitwise" : true,
"boss" : false,
"curly" : true,
"debug": false,
"devel": false,
"eqeqeq": true,
"evil": false,
"expr": true,
"forin": false,
"immed": true,
"latedef" : false,
"laxbreak": false,
"multistr": true,
"newcap": true,
"noarg": true,
"node" : true,
"noempty": false,
"nonew": true,
"onevar": false,
"plusplus": false,
"proto": true,
"regexp": false,
"strict": false,
"sub": false,
"trailing" : true,
"undef": true,
"unused": true
}

View file

@ -31,6 +31,8 @@
* @module FFSpaLoader * @module FFSpaLoader
*/ */
(function (root, factory) { (function (root, factory) {
'use strict';
if ( typeof define === 'function' && define.amd ) { if ( typeof define === 'function' && define.amd ) {
define(factory(root)); define(factory(root));
} else if ( typeof exports === 'object' ) { } else if ( typeof exports === 'object' ) {

View file

@ -1,3 +0,0 @@
'use strict';
//require('mocha-jshint')(['es5-ff-spa-loader.js','example']);

View file

@ -12,7 +12,9 @@ module.exports = function(config) {
'test/spec-runner.js'], 'test/spec-runner.js'],
preprocessors: { preprocessors: {
'es5-ff-spa-loader.js': ['jshint','coverage'] 'es5-ff-spa-loader.js': ['jshint','coverage'],
'example/**/*.js': ['jshint'],
'test/**/*.js': ['jshint']
}, },
reporters: ['coverage', 'mocha', 'junit'], reporters: ['coverage', 'mocha', 'junit'],
@ -29,22 +31,10 @@ module.exports = function(config) {
jshint: { jshint: {
options: { options: {
curly: true, strict: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
devel: true,
eqnull: true,
browser: true, browser: true,
globals: { jasmine: true,
cordova: true, predef: ['define']
jQuery: true
}
}, },
summary: true summary: true
}, },

View file

@ -2,12 +2,14 @@ var testModules = [];
var TEST_REGEXP = /^\/base\/test\/spec\/\S*.js$/i; var TEST_REGEXP = /^\/base\/test\/spec\/\S*.js$/i;
var pathToModule = function(path) { var pathToModule = function(path) {
'use strict';
return path.replace(/^\/base\//, '').replace(/\.js$/, ''); return path.replace(/^\/base\//, '').replace(/\.js$/, '');
}; };
testModules.push('es5-ff-spa-loader'); testModules.push('es5-ff-spa-loader');
Object.keys(window.__karma__.files).forEach(function(file) { Object.keys(window.__karma__.files).forEach(function(file) {
'use strict';
//console.log('file: '+file); //console.log('file: '+file);
if (TEST_REGEXP.test(file)) { if (TEST_REGEXP.test(file)) {
var fileNew = pathToModule(file); var fileNew = pathToModule(file);

View file

@ -1,6 +1,7 @@
'use strict';
define(['es5-ff-spa-loader'], function(FFSpaLoader) { define(['es5-ff-spa-loader'], function(FFSpaLoader) {
'use strict';
describe('Start loader', function() { describe('Start loader', function() {
it('FFSpaLoader start with error', function(done) { it('FFSpaLoader start with error', function(done) {
FFSpaLoader.options.server.url = 'http://localhost:9999'; FFSpaLoader.options.server.url = 'http://localhost:9999';

View file

@ -1,6 +1,7 @@
'use strict';
define(['es5-ff-spa-loader'], function(FFSpaLoader) { define(['es5-ff-spa-loader'], function(FFSpaLoader) {
'use strict';
describe('Check module exports', function() { describe('Check module exports', function() {
describe('Check undefined', function() { describe('Check undefined', function() {
it('FFSpaLoader.options should be defined', function() { it('FFSpaLoader.options should be defined', function() {
@ -34,4 +35,3 @@ define(['es5-ff-spa-loader'], function(FFSpaLoader) {
}); });

View file

@ -1,6 +1,7 @@
'use strict';
define(['es5-ff-spa-loader'], function(FFSpaLoader) { define(['es5-ff-spa-loader'], function(FFSpaLoader) {
'use strict';
describe('Check factory detect', function() { describe('Check factory detect', function() {
it('FFSpaLoader.factory.detect.localStorage', function() { it('FFSpaLoader.factory.detect.localStorage', function() {
expect(FFSpaLoader.factory.detect.localStorage()).toEqual(true); expect(FFSpaLoader.factory.detect.localStorage()).toEqual(true);