Pry while testing

You need to start your tests inside an iex session – you can do that by running iex -S mix test. Then you can use IEx.pry inside your test: require IEx test “the truth” do one = 1 IEx.pry assert one + one == 2 end You’ll be asked if you want to allow prying … Read more

Running multiple Thread Groups sequentially in JMeter

Concerning consecutive execution of thread groups in test plan: simple check Run Test Group consecutively check-box on the Test Plan configuration screen: Use e.g. Loop Controller for this: Thread Group Number of Threads = 1 Loop Count = 1 … Loop Controller Loop Count = N HTTP Request … or even schema without Loop Controller … Read more

Sinon JS “Attempted to wrap ajax which is already wrapped”

You have to remove the spy after every test. Take a look at the example from the sinon docs: { setUp: function () { sinon.spy(jQuery, “ajax”); }, tearDown: function () { jQuery.ajax.restore(); // Unwraps the spy }, “test should inspect jQuery.getJSON’s usage of jQuery.ajax”: function () { jQuery.getJSON(“/some/resource”); assert(jQuery.ajax.calledOnce); assertEquals(“/some/resource”, jQuery.ajax.getCall(0).args[0].url); assertEquals(“json”, jQuery.ajax.getCall(0).args[0].dataType); } } … Read more

What is a smoke test? [duplicate]

“Smoke test” is a term that comes from electrical engineering. It refers to a very basic, very simple test, where you just plug the device in and see if smoke comes out. It doesn’t tell you anything about whether or not the device actually works. The only thing it tells you is that it is … Read more

How override Provider in Angular 5 for only one test?

As of angular 6 I noticed that overrideProvider works with the useValue property. So in order to make it work try something like: class MockRequestService1 { … } class MockRequestService2 { … } then write you TestBed like: // example with injected service TestBed.configureTestingModule({ // Provide the service-under-test providers: [ SomeService, { provide: SomeInjectedService, useValue: … Read more

What is test harness?

Several broad questions there, will try to answer based on my experience. Think of a Test Harness as an ‘enabler’ that actually does all the work of (1)executing tests using a (2)test library and (3)generating reports. It would require that your test scripts are designed to handle different (4)test data and (5)test scenarios. Essentially, when … Read more

How to set the go timeout flag on “Go test”

Use a valid time.ParseDuration input. For example, $ go test -timeout 300ms $ go test -timeout 99999s Command go Testing flags -timeout t If a test runs longer than t, panic. Package flag Duration flags accept any input valid for time.ParseDuration. Package time func ParseDuration func ParseDuration(s string) (Duration, error) ParseDuration parses a duration string. … Read more