You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transactions don't pass to sync version of beforeAll().
info: Beginning Dredd testing...
info: Found Hookfiles: 0=/Users/yyamano/work/7d/dredd-app/bug/hooks.js
warn: DEPRECATION WARNING!
You are using only one argument for the `beforeAll` or `afterAll` hook function.
One argument hook functions will be treated as synchronous in the near future.
To keep the async behaviour, just define hook function with two parameters.
Interface of the hooks functions will be unified soon across all hook functions:
- `beforeAll` and `afterAll` hooks will support sync API depending on number of arguments
- Signatures of callbacks of all hooks will be the same
- First passed argument will be a `transactions` object
- Second passed argument will be a optional callback function for async
- `transactions` object in `hooks` module object will be removed
- Manipulation with transaction data will have to be performed on the first function argument
hook: beforeAll
hook:
hook: beforeEach
hook: name=/ > GET > 200 > application/json; charset=utf-8, id=GET (200) /, host=127.0.0.1, port=3000, method=GET, uri=/, Accept=application/json; charset=utf-8, User-Agent=Dredd/4.9.2 (Darwin 15.6.0; x64), body=, Content-Type=application/json; charset=utf-8, body={
"message": "nulla"
}, statusCode=200, bodySchema={"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}, filename=bug/api.yaml, apiName=Example API, resourceGroupName=, resourceName=/, actionName=GET, exampleName=200 > application/json; charset=utf-8, fullPath=/, protocol=http:, skip=false
pass: GET (200) / duration: 71ms
complete: 1 passing, 0 failing, 0 errors, 0 skipped, 1 total
complete: Tests took 94ms
% cat bug/hooks.js
var hooks = require('hooks');
hooks.beforeAll(function (transactions) {
hooks.log("beforeAll")
hooks.log(transactions)
});
hooks.beforeEach(function (transaction) {
hooks.log("beforeEach")
hooks.log(transaction)
});
@yyamano Thanks for the work, I think this is worth a PR, but we need to finish #705 first. So let's wait a bit until that one is done (currently in progress).
Describe your problem
Transactions don't pass to sync version of beforeAll().
What command line options do you use?
What is in your
dredd.yml
?What's your
dredd --version
output?Does
dredd --level=debug
uncover something?Can you send us failing test in a Pull Request?
The text was updated successfully, but these errors were encountered: