Closed atwright147 closed 6 years ago
@atwright147 there is a way to use it but I do not know of a way to write an async Jasmine matcher. Also couldn't find any information on the Interwebs http://stackoverflow.com/questions/37611672/jasmine-custom-asynchronous-matcher?rq=1
you could try to write something similar to this https://github.com/bvaughn/jasmine-es6-promise-matchers
I got axe-webdriverjs to work with a custom matcher, the trick was to set it up before calling for results. https://github.com/marcysutton/axe-webdriverjs-demo/blob/hfa-demo/spec/test.js
that solution works but results in tests being part of the before which is probably mostly not what would be required
Hey guys!
Found this thread by accident... I'm maintaining jasmine-es6-promise-matchers.
Indeed for async matchers you need to return { pass: true }
in a matcher and later on either call done
or done.fail
to flag the async results of a test spec.
I found this issue while searching for a better syntax for async matchers 😄
I answered a similar question on StackOverflow; not sure if it's the best, but it worked: https://stackoverflow.com/a/50070461/6178885
Hey,
I am trying to use
AxeBuilder
in Jasmine (with Protractor) but I cannot figure out how to deal with it's async nature i.e. is there a promise I can use?The following is my custom matcher but Jasmine always sees
result.pass
as undefined:aXe is returning accurate results but it just happens too late for Jasmine to log it as passed or failed correctly (
results
is always empty at that stage).Any ideas?
Andy