You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.
"use strict";varbuster=require("buster"),assert=buster.assert,refute=buster.refute;buster.testCase("stub reset test",{setUp: function(){this.server={close: function(){thrownewError("server is not running");}};this.stub(this.server,"close");refute.exception(this.server.close);},tearDown: function(){refute.exception(this.server.close);},"method close should be stubbed": function(){refute.exception(this.server.close);}});
leads to the following result:
Failure: stub reset test method close should be stubbed [refute.exception] Expected not to throw but threw Error (server is not running) AssertionError: [refute.exception] Expected not to throw but threw Error (server is not running) at Object.referee.fail (D:\busterDev\referee\lib\referee.js:156:25) at Object.fail (D:\busterDev\referee\lib\referee.js:43:17) at Function.refute.exception (D:\busterDev\referee\lib\referee.js:562:18) at Object.buster.testCase.tearDown (D:\busterDev\buster-ci\test\stub-test.js:20:16) at asyncFunction (D:\busterDev\buster-test\lib\test-runner.js:224:19) at callAndWait (D:\busterDev\buster-test\lib\test-runner.js:253:23) at next (D:\busterDev\buster-test\lib\test-runner.js:273:31) at callSerially (D:\busterDev\buster-test\lib\test-runner.js:279:9) at Object.bane.createEventEmitter.callTearDowns (D:\busterDev\buster-test\lib\test-runner.js:589:20) at Object.<anonymous> (D:\busterDev\buster-test\lib\test-runner.js:626:17)1 test, 2 assertions, 1 runtime ... 1 failure
As you can see, the failure occurs in line 20 of the test, which is inside of tearDown.
Question is, what is more useful, to reset the stubs before or after tearDown?
The text was updated successfully, but these errors were encountered:
Executing this test (
stub-test.js
):leads to the following result:
As you can see, the failure occurs in line 20 of the test, which is inside of
tearDown
.Question is, what is more useful, to reset the stubs before or after
tearDown
?The text was updated successfully, but these errors were encountered: