It turns out the answer was very simple.
BeforeEach
was not being executed because it was accidentally imported from the node:test
package and not from the vitest
package.
Just goes to show that sometimes it's worth going over the obvious stuff.