Eric Mc Sween 6 лет назад
Родитель
Сommit
75f9b0ff10
1 измененных файлов с 24 добавлено и 2 удалено
  1. 24 2
      services/document-updater/test/acceptance/js/SettingADocumentTests.js

+ 24 - 2
services/document-updater/test/acceptance/js/SettingADocumentTests.js

@@ -1,7 +1,5 @@
 /* eslint-disable
 /* eslint-disable
     camelcase,
     camelcase,
-    handle-callback-err,
-    no-return-assign,
 */
 */
 const sinon = require('sinon')
 const sinon = require('sinon')
 const chai = require('chai')
 const chai = require('chai')
@@ -79,6 +77,9 @@ describe('Setting a document', function () {
                 this.user_id,
                 this.user_id,
                 false,
                 false,
                 (error, res, body) => {
                 (error, res, body) => {
+                  if (error) {
+                    return done(error)
+                  }
                   this.statusCode = res.statusCode
                   this.statusCode = res.statusCode
                   done()
                   done()
                 }
                 }
@@ -110,6 +111,9 @@ describe('Setting a document', function () {
         this.project_id,
         this.project_id,
         this.doc_id,
         this.doc_id,
         (error, res, doc) => {
         (error, res, doc) => {
+          if (error) {
+            return done(error)
+          }
           doc.lines.should.deep.equal(this.newLines)
           doc.lines.should.deep.equal(this.newLines)
           done()
           done()
         }
         }
@@ -121,6 +125,9 @@ describe('Setting a document', function () {
         this.project_id,
         this.project_id,
         this.doc_id,
         this.doc_id,
         (error, res, doc) => {
         (error, res, doc) => {
+          if (error) {
+            return done(error)
+          }
           doc.version.should.equal(this.version + 2)
           doc.version.should.equal(this.version + 2)
           done()
           done()
         }
         }
@@ -154,6 +161,9 @@ describe('Setting a document', function () {
         this.user_id,
         this.user_id,
         false,
         false,
         (error, res, body) => {
         (error, res, body) => {
+          if (error) {
+            return done(error)
+          }
           this.statusCode = res.statusCode
           this.statusCode = res.statusCode
           setTimeout(done, 200)
           setTimeout(done, 200)
         }
         }
@@ -219,6 +229,9 @@ describe('Setting a document', function () {
         this.user_id,
         this.user_id,
         false,
         false,
         (error, res, body) => {
         (error, res, body) => {
+          if (error) {
+            return done(error)
+          }
           this.statusCode = res.statusCode
           this.statusCode = res.statusCode
           setTimeout(done, 200)
           setTimeout(done, 200)
         }
         }
@@ -271,6 +284,9 @@ describe('Setting a document', function () {
         this.user_id,
         this.user_id,
         false,
         false,
         (error, res, body) => {
         (error, res, body) => {
+          if (error) {
+            return done(error)
+          }
           this.statusCode = res.statusCode
           this.statusCode = res.statusCode
           setTimeout(done, 200)
           setTimeout(done, 200)
         }
         }
@@ -343,6 +359,9 @@ describe('Setting a document', function () {
                 this.user_id,
                 this.user_id,
                 true,
                 true,
                 (error, res, body) => {
                 (error, res, body) => {
+                  if (error) {
+                    return done(error)
+                  }
                   this.statusCode = res.statusCode
                   this.statusCode = res.statusCode
                   setTimeout(done, 200)
                   setTimeout(done, 200)
                 }
                 }
@@ -403,6 +422,9 @@ describe('Setting a document', function () {
                 this.user_id,
                 this.user_id,
                 false,
                 false,
                 (error, res, body) => {
                 (error, res, body) => {
+                  if (error) {
+                    return done(error)
+                  }
                   this.statusCode = res.statusCode
                   this.statusCode = res.statusCode
                   setTimeout(done, 200)
                   setTimeout(done, 200)
                 }
                 }