Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marc-ed-raffalli/declarative-e2e-test
Declaration driven test generator for REST endpoints
https://github.com/marc-ed-raffalli/declarative-e2e-test
assertion-library e2e-tests http
Last synced: 9 days ago
JSON representation
Declaration driven test generator for REST endpoints
- Host: GitHub
- URL: https://github.com/marc-ed-raffalli/declarative-e2e-test
- Owner: marc-ed-raffalli
- License: mit
- Created: 2020-07-01T20:12:01.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T06:36:55.000Z (over 1 year ago)
- Last Synced: 2024-03-25T21:23:13.869Z (8 months ago)
- Topics: assertion-library, e2e-tests, http
- Language: TypeScript
- Homepage: https://marc-ed-raffalli.github.io/declarative-e2e-test
- Size: 1.58 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# declarative-e2e-test
Easy to write, easy to maintain, clutter free :)
[![Build Status](https://travis-ci.org/marc-ed-raffalli/declarative-e2e-test.svg?branch=master)](https://travis-ci.org/marc-ed-raffalli/declarative-e2e-test)
[![Coverage Status](https://coveralls.io/repos/github/marc-ed-raffalli/declarative-e2e-test/badge.svg?branch=master)](https://coveralls.io/github/marc-ed-raffalli/declarative-e2e-test?branch=master)
[![NPM version](https://img.shields.io/npm/v/declarative-e2e-test.svg)](https://www.npmjs.com/package/declarative-e2e-test)
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/marc-ed-raffalli/declarative-e2e-test/blob/master/LICENSE)`declarative-e2e-test` is a Node.js library designed to write e2e tests for any backends in a declarative way.
```typescript
import {api, run, TestRequestSuiteDefinition} from 'declarative-e2e-test';const exampleTestDefinition: TestRequestSuiteDefinition = {
'Profile API': {
tests: {
'returns user data': {
url: '/user/profile',
headers: {authorization: 'some-auth-token'},
expect: {username: 'johnDoe', role: 'user'}
},
'returns 401 when not authenticated': {
url: '/user/profile',
expect: 401
}
}
}
};run(exampleTestDefinition, {api: api.jest});
```## Features
- Makes HTTP request from node.js and assert response
- Compatible with major Node testing libraries
- Generates the tests and test suites where the requests are performed
- Flexible response assertion
- status
- headers / payload
- multiple / default
- Test hooks / Skip / Only
- Single request flow / series of requests
- Easy integration with Express application instance## Installation
**Using Yarn**:
```bash
$ yarn add --save-dev declarative-e2e-test# or
$ yarn add -D declarative-e2e-test
```**Using Npm**:
```bash
$ npm install --save-dev declarative-e2e-test# or
$ npm i -D declarative-e2e-test
````declarative-e2e-test` does not include any testing libraries.
A testing library of the like of [Jest][jest], [Jasmine][jasmine] or [Mocha][mocha] is required to run the tests.## Documentation
[View project's homepage][projectHomePage]
## Issues
Please share your feedback and report the encountered issues on the
[project's issues page][projectIssues].[projectHomePage]: https://marc-ed-raffalli.github.io/declarative-e2e-test
[projectIssues]: https://github.com/marc-ed-raffalli/declarative-e2e-test/issues[jest]: https://jestjs.io/
[jasmine]: https://jasmine.github.io/
[mocha]: https://mochajs.org/