kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
Max 2021-04-16T13:45:27.054300Z

Hi! I’m working on a testing tool and I had a question about kaocha’s focus feature. Given the following test plan:

a
- b
  - c
    - d
    - e
  - f
    - g
    - h
- i
  - j
Which of the following test plans does focusing on d result in? (yes I know it actually uses skip, but setting that aside for a moment)
Option 1
a
- b
  - c
    - d

Option 2
d

Option 3
a
- b
  - c
    - d
  - f
- i
This is particularly important in the tool I’m working on where branch nodes can contain setup/teardown code that should only run if there are leaves underneath them, i.e. option 1 is what I’m looking for

plexus 2021-04-19T09:38:09.059500Z

I believe it's option 1, all tests that have a child that is focused are not skipped. But easy enough to verify with --print-test-plan.

plexus 2021-04-19T10:55:15.061300Z

it really has to be, if we would skip a then it would never get to d

Alys Brooks 2021-04-16T20:04:36.055400Z

I'm not sure what the difference between 1 and 2 is, since I don't think a, b, or c would contain tests. (But maybe I'm misunderstanding your plans?)

Alys Brooks 2021-04-16T20:37:07.055900Z

I don't think d 'loses' its context when focusing, though, if that's what you're asking.

Jason 2021-04-16T22:10:24.058700Z

I'm searching for re-frame event / component testing strategies. i don't see much prior art out there. "rehook" looks useful but afaict it needs a kaocha adapter. Any advice very welcome.