Răsfoiți Sursa

add unit tests

Brian Gough 6 ani în urmă
părinte
comite
a684619bce
1 a modificat fișierele cu 19 adăugiri și 1 ștergeri
  1. 19 1
      services/clsi/test/unit/js/LatexRunnerTests.js

+ 19 - 1
services/clsi/test/unit/js/LatexRunnerTests.js

@@ -37,7 +37,10 @@ describe('LatexRunner', function() {
             done() {}
             done() {}
           })
           })
         },
         },
-        './CommandRunner': (this.CommandRunner = {})
+        './CommandRunner': (this.CommandRunner = {}),
+        'fs': (this.fs = {
+          writeFile: sinon.stub().callsArg(2)
+        })
       }
       }
     })
     })
 
 
@@ -83,6 +86,21 @@ describe('LatexRunner', function() {
           )
           )
           .should.equal(true)
           .should.equal(true)
       })
       })
+
+      it('should record the stdout and stderr', function () {
+        this.fs.writeFile
+          .calledWith(
+            this.directory + '/' + 'output.stdout',
+            "this is stdout"
+          )
+          .should.equal(true)
+        this.fs.writeFile
+          .calledWith(
+            this.directory + '/' + 'output.stderr',
+            "this is stderr"
+          )
+          .should.equal(true)
+      })
     })
     })
 
 
     describe('with an .Rtex main file', function() {
     describe('with an .Rtex main file', function() {