Fork me on GitHub
#kaocha
<
2021-04-16
>
Max13:04:27

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

plexus09:04:09

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.

plexus10:04:15

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

Alys Brooks20:04:36

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 Brooks20:04:07

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

Jason22:04:24

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.