0.5.2 • Published 3 years ago

tasty-api v0.5.2

Weekly downloads
12
License
Apache-2.0
Repository
github
Last release
3 years ago

TastyJS CircleCI

TastyJS is an API testing framework which will make your testing process tastier.

TastyJS doesn't pretend to be a Swizz knife in testing world. It's a syntactic sugar above mocha and other testing kitchen stuff related to api testing. The main goal is make api testing process as easy as it possible.

You don't need to know anything about testing standards, dictionary, and community conventions.

You just write, what you hear.

This tool limits the number of degrees of freedom. In this case, if you a programming geek, here you will be cramped. If you want to focus on the essence of api testing, and want to increase the speed of this process, this tool is for you.

PoC

TastyJS provides unified approach for development, support and testing REST API endpoints

TastyJS is built on top Application abstraction
Every Application has list of Resources
one Resouce describe single REST API url - path and related configuration

There is Service - mock abstraction for Resource, that allow declaring required Resource headers, status codes, response in declarative manner and use for TDD development

TastyJS provides an interface for testing each Resource with specific api:

TEST API

Simple test:

import tasty from 'tasty';
import app from '../app';

tasty.case('Tests for /login',
  tasty.suite(
    'Response status',
    app.login.post(),
    {
      checkStatus: 200
    }
  )
);

or something more complex

import tasty from 'tasty';
import app from '../app';

tasty.case('Tests for /product',
  app.login
    .setMock({
      token: 'some mock server token',
    })
    .post({
      capture: {
        json: '$.token',
        as: 't',
      },
    }),
  tasty.suite(
    'Response structure',
    app.product.get(),
    {
      checkStatus: 200,
      checkStatusText: 'OK',
      checkStructure: true,
      check: (res, ctx) => ctx.t === 'some mock server token',
    },
  ),
  app.logout.post(),
);

Sponsors

Leroy Merlin LM Tech

License

This project is licensed under the terms of the Apache-2.0 license.

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

4 years ago

0.4.9

4 years ago

0.4.8

4 years ago

0.4.7

4 years ago

0.4.6

4 years ago

0.4.5

4 years ago

0.4.4

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.8

4 years ago

0.3.6

4 years ago

0.3.7

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago