Category Archives: Testing

Test Push Notifications

https://github.com/onmyway133/PushNotifications

Load testing tools

https://yandex.ru/dev/tank/ [Tool | Free] https://jmeter.apache.org/ [Tool | Free] http://tsung.erlang-projects.org/ [Tool | Free] https://gatling.io/ [Tool | Free/$] https://k6.io/ [Tool | Free/SaaS] https://locust.io/ [Tool | Free] https://loader.io/ [SaaS | Free/$] https://artillery.io [Tool | Free/$] https://github.com/wg/wrk [Tool | Free]

A way to test http client in go

A couple of ways are described here — http://hassansin.github.io/Unit-Testing-http-client-in-Go The way I liked is the following one: func Test_Mine(t *testing.T) { … client := httpClientWithRoundTripper(http.StatusOK, «OK») … } type roundTripFunc func(req *http.Request) *http.Response func (f roundTripFunc) RoundTrip(req *http.Request) (*http.Response, error) { return f(req), nil } func httpClientWithRoundTripper(statusCode int, response string) *http.Client { return &http.Client{ Transport: …

Read more

Golang: testing http and grpc servers

HTTP server is quite easy to test — here is a nice video about it:

E2E tests in go

I tried it via ginkgo and gomega. It has Agouti with WebDriver support out of the box, but I didn’t use it as we have grpc API. That’s the example (table tests): var _ = Describe(«GetRoute», func() { var ( srClient sr.Client srErr error ) JustBeforeEach(func() { srClient, srErr = GetClient() }) DescribeTable(«positive cases», func(fromGeoPointID, …

Read more

Mocking for testing go code

If you’re testing go code and have a huge API you have to mock, you have two options: make your dummy struct with embedded interface and implement only methods you need, or use your own interface that has only methods you need (and change your code to use that). For instance, I had amazon’s s3 …

Read more

BDD Framework For Golang

There is a good one: https://github.com/onsi/ginkgo It prefers to use http://onsi.github.io/gomega/ as a matcher.

Testing react’s dom with jest and enzyme

Install it like this: yarn add enzyme enzyme-adapter-react-16 —registry=»https://registry.npmjs.org»

Regression testing of react app with jest

Example is here — https://facebook.github.io/jest/docs/en/tutorial-react.html. The main idea is this: // Link.react.test.js import React from ‘react’; import Link from ‘../Link.react’; import renderer from ‘react-test-renderer’; test(‘Link changes the class when hovered’, () => { const component = renderer.create( Facebook, ); let tree = component.toJSON(); expect(tree).toMatchSnapshot(); // manually trigger the callback tree.props.onMouseEnter(); // re-rendering tree = component.toJSON(); …

Read more

Javascript mocking frameworks

Classical one — http://sinonjs.org/. TestDouble — https://github.com/testdouble/testdouble.js/blob/master/README.md There is a good video on using TestDouble from it’s creator: https://www.youtube.com/watch?v=nH8EnmdEBj4