-
Notifications
You must be signed in to change notification settings - Fork 1
Description
For assertions with alternations, in order for the site generator to be able to pick up the correct declaration rule you have to name the markdown file in your plugin with at least one alternation .
So for example to-be-the-start-of, the declaration rule for that assertion was not picked up. Under the title "to be the start of", there's supposed to be this declaration rule <moment> [not] to be the start of (second|minute|hour|day|week|isoWeek|month|quarter|year). In contrast, in to be truthy, the declaration rule was picked up correctly since the markdown file is named to-be-truthy.md.
I could fix the problem in my plugin by renaming my markdown file from to-be-the-start-of.md to to-be-the-start-of-second.md but then I'd have to create a copy of that file for every other alternation which would be too verbose in the docs (there's also to be the end of with just as many alternations). Or just create a single file to-be-the-start-of-second.md which I find might be a bit confusing to users.
So my ideal solution would be to put some code block or something in the markdown to tell the site generator which declaration rule to use for my assertion.
FYI, the failure is coming from this line. expect.assertions contains stuff like:
[
'to be the start of second': { ... },
'to be the start of minute': { ... },
'to be the start of hour': { ... }
... and so on
]while name is 'to be the start of'.
// cc @sunesimonsen