Describe the bug
In my tests I am going to execute only GET requests which expected 200 and 403 response codes, and skip all the rest. Trying to
achieve this via dreddhook. I can easily exclude all except one status code, but when I use multiple OR condition, result confuses me.
This works fine:
hooks.beforeEach(function (transaction) {
if(transaction.expected.statusCode !== "403" || transaction.request.method !== "GET") {
transaction.skip = true;
}
});
This exclude ALL tests:
hooks.beforeEach(function (transaction) {
if(transaction.expected.statusCode !== "200" || transaction.expected.statusCode !== "403" || transaction.request.method !== "GET") {
transaction.skip = true;
}
});
To Reproduce
I have openapi.yml, dredd.yml config, dreddhooks.js and running test via command
docker run -it -v $PWD:/api -w /api apiaryio/dredd dredd
Expected behavior
Exclude all except I have in if condition
What is in your dredd.yml?
reporter: html
dry-run: null
hookfiles: "dreddhooks.js"
loglevel: debug
blueprint: openapi.yml
endpoint: http://host.docker.internal:8080/myapi
path: []
What's your dredd --version output?
Does dredd --loglevel=debug uncover something?
I am using debug level from the beginning
Can you send us failing test in a Pull Request?
Cannot
Output for first case (ok)

Output for second case (wrong)

P.S. All running tests are failing as I recorded these screenshot with switched off API, but it's not really matter in current case, as test is skipping.