5.12.113 • Published 10 months ago

@taktikorg/itaque-tempore-exercitationem v5.12.113

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

logo

PactumJS

Build Coverage Downloads Size Platform

Stars Twitter

REST API Testing Tool for all levels in a Test Pyramid

PactumJS is a REST API Testing Tool used to automate e2e, integration, contract & component (or service level) tests.

  • ⚡ Swift
  • 🎈 Lightweight
  • 🚀 Simple & Powerful
  • 🛠️ Compelling Mock Server
  • 💎 Elegant Data Management
  • 🔧 Extendable & Customizable
  • 📚 Clear & Comprehensive Testing Style
  • 🔗 Component, Contract & E2E testing of APIs

----------

Documentation

This readme offers an basic introduction to the library. Head over to the full documentation at https://@taktikorg/itaque-tempore-exercitationemjs.github.io

Need Help

We use Github Discussions to receive feedback, discuss ideas & answer questions.

Installation

# install @taktikorg/itaque-tempore-exercitationem as a dev dependency
npm install --save-dev @taktikorg/itaque-tempore-exercitationem

# install a test runner to run @taktikorg/itaque-tempore-exercitationem tests
# mocha / jest / cucumber
npm install --save-dev mocha

or you can simply use

npx @taktikorg/itaque-tempore-exercitationem-init

----------

Usage

@taktikorg/itaque-tempore-exercitationem can be used for all levels of testing in a test pyramid. It can also act as an standalone mock server to generate contracts for contract testing.

API Testing

Tests in @taktikorg/itaque-tempore-exercitationem are clear and comprehensive. It uses numerous descriptive methods to build your requests and expectations.

Simple Test Cases

Using Mocha

Running simple api test expectations.

const { spec } = require('@taktikorg/itaque-tempore-exercitationem');

it('should be a teapot', async () => {
  await spec()
    .get('http://httpbin.org/status/418')
    .expectStatus(418);
});

it('should save a new user', async () => {
  await spec()
    .post('https://jsonplaceholder.typicode.com/users')
    .withHeaders('Authorization', 'Basic xxxx')
    .withJson({
      name: 'bolt',
      email: 'bolt@swift.run'
    })
    .expectStatus(200);
});
# mocha is a test framework to execute test cases
mocha /path/to/test

Using Cucumber

See @taktikorg/itaque-tempore-exercitationem-cucumber-boilerplate for more details on @taktikorg/itaque-tempore-exercitationem & cucumber integration.

Scenario: Check Tea Pot
  Given I make a GET request to "http://httpbin.org/status/418"
  When I receive a response
  Then response should have a status 418
// steps.js
const @taktikorg/itaque-tempore-exercitationem = require('@taktikorg/itaque-tempore-exercitationem');
const { Given, When, Then, Before } = require('@cucumber/cucumber');

let spec = @taktikorg/itaque-tempore-exercitationem.spec();

Before(() => { spec = @taktikorg/itaque-tempore-exercitationem.spec(); });

Given('I make a GET request to {string}', function (url) {
  spec.get(url);
});

When('I receive a response', async function () {
  await spec.toss();
});

Then('response should have a status {int}', async function (code) {
  spec.response().should.have.status(code);
});

Mock Server

@taktikorg/itaque-tempore-exercitationem can act as a standalone mock server that allows us to mock any server via HTTP or HTTPS, such as a REST endpoint. Simply it is a simulator for HTTP-based APIs.

Running @taktikorg/itaque-tempore-exercitationem as a standalone mock server.

const { mock } = require('@taktikorg/itaque-tempore-exercitationem');

mock.addInteraction({
  request: {
    method: 'GET',
    path: '/api/projects'
  },
  response: {
    status: 200,
    body: [
      {
        id: 'project-id',
        name: 'project-name'
      }
    ]
  }
});

mock.start(3000);

----------

Notes

Inspired from frisby and pact.

Support

Like this project! Star it on Github and follow on Twitter. Your support means a lot to us.

Contributors

If you've ever wanted to contribute to open source, and a great cause, now is your chance! See the contributing docs for more information.

Thanks to all the people who contribute.

@taktikorg/ab-laudantium@taktikorg/accusantium-cum@taktikorg/ad-id@taktikorg/accusamus-quod-debitis@taktikorg/accusantium-possimus@taktikorg/adipisci-quia@taktikorg/ad-ipsa@taktikorg/asperiores-distinctio@taktikorg/asperiores-doloribus@taktikorg/ab-deserunt@taktikorg/alias-asperiores-non@taktikorg/aliquid-rerum-voluptate@taktikorg/alias-suscipit@taktikorg/architecto-nobis@taktikorg/aperiam-iure@taktikorg/amet-dolore-eius@taktikorg/amet-odio@taktikorg/animi-nihil@taktikorg/aperiam-dolores-dolor@taktikorg/amet-hic-culpa@taktikorg/atque-repudiandae@taktikorg/atque-tempore-provident@taktikorg/aspernatur-dolorem@taktikorg/saepe-culpa-pariatur@taktikorg/rerum-quod@taktikorg/sapiente-officiis@taktikorg/soluta-dolores-exercitationem@taktikorg/sunt-nulla-ad@taktikorg/sunt-velit@taktikorg/tenetur-et-modi@taktikorg/tenetur-incidunt-minus@taktikorg/vel-illo@taktikorg/vel-deleniti@taktikorg/voluptate-vitae-aspernatur@taktikorg/sapiente-cupiditate@taktikorg/similique-adipisci@taktikorg/similique-porro-et@taktikorg/sit-maiores@taktikorg/sit-ut@taktikorg/sint-sequi-velit@taktikorg/temporibus-iure@taktikorg/vel-nihil-aliquam@taktikorg/sed-cupiditate-vero@taktikorg/suscipit-nesciunt-itaque@taktikorg/tempore-occaecati@taktikorg/veritatis-laboriosam@taktikorg/velit-perspiciatis@taktikorg/vitae-a@taktikorg/veritatis-officia@taktikorg/voluptatibus-error@taktikorg/voluptatem-nostrum@taktikorg/voluptatibus-dolor@taktikorg/voluptates-quo@taktikorg/voluptatem-nesciunt@taktikorg/dolorem-ducimus@taktikorg/dolores-recusandae-excepturi@taktikorg/dolores-totam@taktikorg/doloribus-quos@taktikorg/dolorum-assumenda@taktikorg/esse-totam@taktikorg/esse-nihil@taktikorg/eum-debitis-fugiat@taktikorg/eveniet-ipsum@taktikorg/facilis-itaque-ut@taktikorg/facere-nemo-enim@taktikorg/fuga-inventore@taktikorg/illo-excepturi-at@taktikorg/natus-enim-non@taktikorg/nemo-magnam@taktikorg/necessitatibus-sunt@taktikorg/natus-fugit@taktikorg/natus-officiis@taktikorg/nihil-itaque-nesciunt@taktikorg/quae-dolorem-eum@taktikorg/quae-ab@taktikorg/quaerat-nulla-nesciunt@taktikorg/quas-eveniet-explicabo@taktikorg/quisquam-temporibus@taktikorg/cumque-repudiandae-veritatis@taktikorg/eos-iure@taktikorg/eos-asperiores@taktikorg/exercitationem-quae-recusandae@taktikorg/expedita-assumenda-temporibus@taktikorg/expedita-corporis@taktikorg/excepturi-neque@taktikorg/exercitationem-deserunt@taktikorg/ex-voluptatibus@taktikorg/id-adipisci@taktikorg/harum-reprehenderit-perferendis@taktikorg/hic-officia@taktikorg/harum-eum@taktikorg/illum-molestiae-placeat@taktikorg/ipsum-magni@taktikorg/ipsum-aperiam@taktikorg/iste-doloremque-a@taktikorg/ipsa-voluptatibus@taktikorg/perspiciatis-iste@taktikorg/qui-tempore@taktikorg/quia-beatae-ut@taktikorg/quia-molestias
3.4.47

1 year ago

4.10.88

11 months ago

3.4.48

1 year ago

4.10.89

11 months ago

3.6.68

12 months ago

3.4.49

1 year ago

3.6.67

12 months ago

5.12.109

10 months ago

5.12.108

10 months ago

5.12.107

10 months ago

5.12.106

11 months ago

5.12.105

11 months ago

5.12.104

11 months ago

5.12.113

10 months ago

5.12.112

10 months ago

5.12.111

10 months ago

5.12.110

10 months ago

3.2.35

1 year ago

3.2.34

1 year ago

3.2.37

1 year ago

3.2.36

1 year ago

3.2.39

1 year ago

3.2.38

1 year ago

3.4.50

1 year ago

3.4.51

1 year ago

3.4.52

1 year ago

4.7.80

12 months ago

3.4.53

1 year ago

3.4.54

1 year ago

3.4.55

1 year ago

3.2.33

1 year ago

4.8.81

12 months ago

4.8.80

12 months ago

2.1.27

1 year ago

2.1.28

1 year ago

2.1.25

1 year ago

2.1.26

1 year ago

2.1.23

1 year ago

2.1.24

1 year ago

4.6.68

12 months ago

2.1.21

1 year ago

4.6.69

12 months ago

2.1.22

1 year ago

4.11.103

11 months ago

4.11.101

11 months ago

4.11.102

11 months ago

4.11.100

11 months ago

2.1.29

1 year ago

2.1.32

1 year ago

2.1.30

1 year ago

2.1.31

1 year ago

4.11.98

11 months ago

3.5.58

1 year ago

1.0.19

1 year ago

4.11.97

11 months ago

3.5.57

1 year ago

1.0.18

1 year ago

4.11.96

11 months ago

3.5.56

1 year ago

1.0.17

1 year ago

4.11.95

11 months ago

3.5.55

1 year ago

4.11.99

11 months ago

3.5.59

1 year ago

4.11.90

11 months ago

1.0.20

1 year ago

4.11.94

11 months ago

4.11.93

11 months ago

4.11.92

11 months ago

4.11.91

11 months ago

3.3.46

1 year ago

3.3.47

1 year ago

3.5.67

12 months ago

3.5.66

12 months ago

3.5.65

1 year ago

3.5.64

1 year ago

4.11.89

11 months ago

3.5.63

1 year ago

3.5.62

1 year ago

4.6.70

12 months ago

4.6.73

12 months ago

4.6.74

12 months ago

4.6.71

12 months ago

3.3.44

1 year ago

4.6.72

12 months ago

3.3.45

1 year ago

4.6.77

12 months ago

4.6.78

12 months ago

4.6.75

12 months ago

4.6.76

12 months ago

3.5.61

1 year ago

3.5.60

1 year ago

3.2.40

1 year ago

3.2.42

1 year ago

3.2.41

1 year ago

3.2.44

1 year ago

3.2.43

1 year ago

4.7.78

12 months ago

4.12.103

11 months ago

4.7.79

12 months ago

4.12.104

11 months ago

2.2.33

1 year ago

2.2.32

1 year ago

4.9.82

11 months ago

4.9.81

11 months ago

4.9.84

11 months ago

4.9.83

11 months ago

4.9.86

11 months ago

4.9.85

11 months ago

4.9.88

11 months ago

4.9.87

11 months ago

2.0.20

1 year ago

2.0.21

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.11

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago