yandex-tank-ammo

1.0.0 • Public • Published

yandex-tank-ammo

Generate ammo for yandex-tank

Install

npm i yandex-tank-ammo

Usage

GET method

Script:

  const yandexTankAmmo = require('yandex-tank-ammo');

  const list = [
    {
      'host': 'yandex.ru',
      'method': 'GET',
      'httpVersion': '1.1',
      'tag': 'qqq',
      'url': '/',
      'headers': {
        'Authorization': 'Bearer 8f81c7fe-f5a1-4322-80fa-b54a6553bba9',
        'User-Agent': 'xxx (shell 1)'
      },
    },
  ];

  const ammo = yandexTankAmmo(list);

ammo

123 qqq
GET / HTTP/1.1
Host: yandex.ru
Authorization: Bearer 8f81c7fe-f5a1-4322-80fa-b54a6553bba9
User-Agent: xxx (shell 1)

POST method

Script:

  const yandexTankAmmo = require('yandex-tank-ammo');

  const list = [
    {
      'host': 'yandex.ru',
      'method': 'GET',
      'httpVersion': '1.1',
      'tag': 'qqq',
      'url': '/',
      'headers': {
        'Authorization': 'Bearer 8f81c7fe-f5a1-4322-80fa-b54a6553bba9',
        'User-Agent': 'xxx (shell 1)'
      },
    },
  ];

  const ammo = yandexTankAmmo(list);

ammo

170 qqq
POST / HTTP/1.1
Host: yandex.ru
Authorization: Bearer token
Content-Type: application/json; charset=utf-8
Content-Length: 33

{"filters":{},"size":24,"page":1}

Test

npm run test

License

MIT © nlapshin

Readme

Keywords

none

Package Sidebar

Install

npm i yandex-tank-ammo

Weekly Downloads

6

Version

1.0.0

License

ISC

Unpacked Size

6.14 kB

Total Files

6

Last publish

Collaborators

  • nlapshin