Skip to content

Commit d274b85

Browse files
committed
better output for testing
1 parent 0a79647 commit d274b85

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/unit/openAPIGenerator.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ describe("OpenAPIGenerator", () => {
237237
it("should throw an error when writing a file fails", function () {
238238
const errStub = sinon.stub(logOutput.log, "error").returns("");
239239
const succSpy = sinon.spy(logOutput.log, "success");
240-
const fsStub = sinon.stub(fs, "writeFileSync").throws(new Error());
240+
const fsStub = sinon
241+
.stub(fs, "writeFileSync")
242+
.throws(new Error("throwing an error from writeFileSync"));
241243
const openAPIGenerator = new OpenAPIGenerator(sls, {}, logOutput);
242244
openAPIGenerator.processCliInput();
243245

@@ -258,7 +260,7 @@ describe("OpenAPIGenerator", () => {
258260
const errStub = sinon.spy(logOutput.log, "error");
259261
const succSpy = sinon.spy(logOutput.log, "success");
260262
const pgStub = sinon.stub(PostmanGenerator, "convert");
261-
pgStub.yields(new Error());
263+
pgStub.yields(new Error("throwing an error from PostmanGenerator"));
262264

263265
const openAPIGenerator = new OpenAPIGenerator(sls, {}, logOutput);
264266
openAPIGenerator.processCliInput();

0 commit comments

Comments
 (0)