https://github.com/haraka/test-fixtures
Fixtures for testing Haraka and plugins
https://github.com/haraka/test-fixtures
haraka test-automation testing
Last synced: 3 months ago
JSON representation
Fixtures for testing Haraka and plugins
- Host: GitHub
- URL: https://github.com/haraka/test-fixtures
- Owner: haraka
- License: mit
- Created: 2016-02-23T19:55:55.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2026-03-17T23:07:13.000Z (3 months ago)
- Last Synced: 2026-03-18T11:27:24.809Z (3 months ago)
- Topics: haraka, test-automation, testing
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/haraka-test-fixtures
- Size: 116 KB
- Stars: 2
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status][ci-img]][ci-url]
[![CodeCov][cov-img]][cov-url]
[![Qlty][qlty-img]][qlty-url]
# haraka-test-fixtures
Fixtures for testing Haraka and plugins
## Usage
```js
const fixtures = require('haraka-test-fixtures')
```
### A common pattern
```js
beforeEach(() => {
this.plugin = new fixtures.plugin('pluginName')
this.connection = fixtures.connection.createConnection()
this.connection.init_transaction()
})
describe('pluginName', () => {
it('registers', () => {
this.plugin.register()
})
})
```
## Exports the following fixture types:
- connection
- line_socket
- logger
- plugin
- [results](https://github.com/haraka/haraka-results)
- stub
- transaction
- util_hmailitem
These fixtures are analogs of their like-named siblings in Haraka with varying levels of completeness. If there are functions necessary to enhance your ability to test, please do add them.
[ci-img]: https://github.com/haraka/test-fixtures/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/haraka/test-fixtures/actions/workflows/ci.yml
[cov-img]: https://codecov.io/github/haraka/test-fixtures/graph/badge.svg?token=YmOC83OqCH
[cov-url]: https://codecov.io/github/haraka/test-fixtures
[qlty-img]: https://qlty.sh/gh/haraka/projects/haraka-test-fixtures/maintainability.svg
[qlty-url]: https://qlty.sh/gh/haraka/projects/haraka-test-fixtures