@tramvai/test-integration 1.45.0 → 1.46.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +13 -13
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Tramvai test integration
2
2
 
3
- Библиотека хелперов для интеграционного тестирования приложений. Подразумевается полноценный старт всего приложения со сборкой с помощью `@tramvai/cli` и использования хелперов для анализа результата запросов на сервер и проверки рендера приложения в браузере
3
+ Set of helpers to simplify the process of writing integration tests for the tramvai app. Implies full-fledged run of the app with build made by `@tramvai/cli` and use of helpers for test result of requests to the server and test render of the app in the browser.
4
4
 
5
- > Для работы должен быть установлен отдельно `@tramvai/cli`
5
+ > The `@tramvai/cli` package is required and should be installed manually
6
6
 
7
- ## Подключение
7
+ ## Installation
8
8
 
9
9
  ```bash
10
10
  npm i --save-dev @tramvai/test-integration
@@ -12,13 +12,13 @@ npm i --save-dev @tramvai/test-integration
12
12
 
13
13
  ## How To
14
14
 
15
- ### Тестирование запросов к `tramvai` приложению без запуска в браузере (aka `curl`)
15
+ ### Test request to the tramvai app without using browser (aka `curl`)
16
16
 
17
- Для тестирования полноценных запросов к `tramvai` приложению используется библиотеки [superagent](https://github.com/visionmedia/superagent) и [node-html-parser](https://github.com/taoqf/node-html-parser)
17
+ For testing requests to the tramvai app libraries [superagent](https://github.com/visionmedia/superagent) and [node-html-parser](https://github.com/taoqf/node-html-parser) are used under hood.
18
18
 
19
- При вызове метода `app.request` отправляются запросы в приложение, и доступны все возможности `superagent`.
19
+ Call of `app.request` sends requests to the app. All of the features of `superagent` are available.
20
20
 
21
- При вызове метода `app.render` можно получить доступ к HTML разметке, которую вернул запрос в приложение.
21
+ Call of `app.render` resolves to the HTML render that is returned from server while serving the request.
22
22
 
23
23
  ```ts
24
24
  import { startCli } from '@tramvai/test-integration';
@@ -36,7 +36,7 @@ afterAll(() => {
36
36
  return app.close();
37
37
  });
38
38
 
39
- it('request to main page return status 200', async () => {
39
+ it('request to main page should return status 200', async () => {
40
40
  return app.request('/').expect(200);
41
41
  });
42
42
 
@@ -48,15 +48,15 @@ it('main page HTML snapshot', async () => {
48
48
  });
49
49
  ```
50
50
 
51
- ### Тестирование приложения в браузере с помощью `Puppeteer`
51
+ ### Testing app in browser with the `puppeteer`
52
52
 
53
- Для запуска полноценных браузерных тестов можно использовать библиотеку [@tramvai/test-puppeteer](references/test/test-puppeteer.md)
53
+ You may use another library [@tramvai/test-puppeteer](references/test/test-puppeteer.md) to implement testing in the browser.
54
54
 
55
- ### Использование @tinkoff/mocker в тестах
55
+ ### Usage of `@tinkoff/mocker` in tests
56
56
 
57
- Для использования мокера в интеграционных тестах необходимо добавить модуль [`@tramvai/module-mocker`](references/modules/mocker.md) в список модулей для приложения
57
+ In order to use mocker there should be added [`@tramvai/module-mocker`](references/modules/mocker.md) to the tramvai app modules list.
58
58
 
59
- Затем мокер подтянет файловые моки как описано в доке к самому мокеру и есть возможность добавлять моки динамически в тестах:
59
+ After thar mocker will read file based mocks as it described in the docs to the mocker itself and it can be used dynamically in the tests:
60
60
 
61
61
  ```ts
62
62
  it('should work with mocker', async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/test-integration",
3
- "version": "1.45.0",
3
+ "version": "1.46.8",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@tinkoff/mocker": "1.5.3",
25
- "@tramvai/test-helpers": "1.45.0",
25
+ "@tramvai/test-helpers": "1.46.8",
26
26
  "@types/supertest": "^2.0.11",
27
27
  "supertest": "^6.1.3",
28
28
  "utility-types": "^3.10.0",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@tinkoff/utils": "^2.1.2",
33
- "@tramvai/cli": "1.45.0",
33
+ "@tramvai/cli": "1.46.8",
34
34
  "tslib": "^2.0.3"
35
35
  },
36
36
  "license": "Apache-2.0",