Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tirithen/amqp-test-fixture-runner
A system that connects to an ActiveMQ instance and runs test fixtures
https://github.com/tirithen/amqp-test-fixture-runner
Last synced: about 5 hours ago
JSON representation
A system that connects to an ActiveMQ instance and runs test fixtures
- Host: GitHub
- URL: https://github.com/tirithen/amqp-test-fixture-runner
- Owner: tirithen
- License: gpl-3.0
- Created: 2016-10-13T15:57:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-01T07:59:22.000Z (almost 8 years ago)
- Last Synced: 2024-10-04T19:07:09.558Z (about 1 month ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# amqp-test-fixture-runner - A system that connects to an ActiveMQ instance and runs test fixtures
This package is ment to ease testing of AMQP services by only writing fixture files and requiring this package.
The package will pull and run a docker container with an ActiveMQ service that will act as the AMQP broker for the test fixtures.
## Dependencies
This package requires that you have *docker* and *docker-compose* applications installed on your system.
## Fixture example
See *test/ingredientTranslate.js* for an example of a fixture file.
## Usage
Add this package to your package.json dependencies:
$ npm install --save-dev amqp-test-fixture-runner
Add the test command to scripts.test inside package.json:
"scripts": {
"test": "docker-compose -f ./node_modules/amqp-test-fixture-runner/test/docker-compose.yml up -d && AMQP_URL=amqp://producer:DYjpp4fbCQ8zpiDIoJwP@localhost FIXTURE_DIRECTORIES=./test ./node_modules/.bin/mocha --timeout 60000 && docker-compose -f ./node_modules/amqp-test-fixture-runner/test/docker-compose.yml down"
}Add one or more test fixture files (see *./node_modules/amqp-test-fixture-runner/test/ingredientTranslate.js* as an other example) to your projects ./test directory with the following syntax:
const add = {
sendOn: 'add',
recieveOn: 'topic://add.result',
timeout: 500,
tests: [
{
send: {
environment: 'test',
x: 1,
y: 2
},
recieve: {
environment: 'test',
sum: 3
}
}
]
};module.exports = {
amqpFixtures: true,
add
};Run your tests with:
$ npm test
## Test this package
Make sure you have the required dependencies and run:
$ npm install
$ npm test## Contribute
Please feel free to contribute, hack around, add tests, and create a merge request. ;D
## License
This package is released with the GPL-3.0 license.