summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2016-12-10 12:04:54 +0000
committerLuke "Jared" Bennett <lbennett@gitlab.com>2016-12-10 12:04:54 +0000
commitbc31040ea9344e8bc4d3c90fa49a6e30ce9c3698 (patch)
treead47b4b2d8226766f10247f8c30e37dd3a8689e1
parent3f768f9a14ad90bbd79d384e3c287db4feea3e35 (diff)
downloadgitlab-ce-bc31040ea9344e8bc4d3c90fa49a6e30ce9c3698.tar.gz
Fixed lint warning and propose fail or warningfix-eslint-warnings
-rw-r--r--package.json2
-rw-r--r--spec/javascripts/project_title_spec.js16
2 files changed, 10 insertions, 8 deletions
diff --git a/package.json b/package.json
index 961989f8012..49b8210e427 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
- "eslint": "eslint --ext .js,.js.es6 .",
+ "eslint": "eslint --max-warnings 0 --ext .js,.js.es6 .",
"eslint-fix": "npm run eslint -- --fix",
"eslint-report": "npm run eslint -- --format html --output-file ./eslint-report.html"
},
diff --git a/spec/javascripts/project_title_spec.js b/spec/javascripts/project_title_spec.js
index 49211a6b852..65de1756201 100644
--- a/spec/javascripts/project_title_spec.js
+++ b/spec/javascripts/project_title_spec.js
@@ -21,16 +21,18 @@
return this.project = new Project();
});
return describe('project list', function() {
+ var fakeAjaxResponse = function fakeAjaxResponse(req) {
+ var d;
+ expect(req.url).toBe('/api/v3/projects.json?simple=true');
+ d = $.Deferred();
+ d.resolve(this.projects_data);
+ return d.promise();
+ };
+
beforeEach((function(_this) {
return function() {
_this.projects_data = fixture.load('projects.json')[0];
- return spyOn(jQuery, 'ajax').and.callFake(function(req) {
- var d;
- expect(req.url).toBe('/api/v3/projects.json?simple=true');
- d = $.Deferred();
- d.resolve(_this.projects_data);
- return d.promise();
- });
+ return spyOn(jQuery, 'ajax').and.callFake(fakeAjaxResponse.bind(_this));
};
})(this));
it('to show on toggle click', (function(_this) {