Skip to content

@pinia/root / @pinia/testing

@pinia/testing

Index

Interfaces

InterfaceDescription
TestingOptions-
TestingPiniaPinia instance specifically designed for testing. Extends a regular Pinia instance with test specific properties.

Functions

FunctionDescription
createTestingPiniaCreates a pinia instance designed for unit tests that requires mocking the stores. By default, all actions are mocked and therefore not executed. This allows you to unit test your store and components separately. You can change this with the stubActions option. If you are using jest, they are replaced with jest.fn(), otherwise, you must provide your own createSpy option.

Released under the MIT License.