From 3e8d9bc63440749722e6e76f199f7da944f2cbd5 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 28 Jun 2021 16:52:07 +0200 Subject: [PATCH] docs: better comments --- docs/cookbook/testing.md | 4 ++++ src/testing.ts | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/cookbook/testing.md b/docs/cookbook/testing.md index 1e96565b..a4e023f7 100644 --- a/docs/cookbook/testing.md +++ b/docs/cookbook/testing.md @@ -1,5 +1,9 @@ # Testing stores +:::warning +This code is still not released. +:::: + Stores will, by design, be used at many places and can make testing much harder than it should be. Fortunately, this doesn't have to be the case. We need to take care of three things when testing stores: - The `pinia` instance: Stores cannot work without it diff --git a/src/testing.ts b/src/testing.ts index e309757c..f8154bc5 100644 --- a/src/testing.ts +++ b/src/testing.ts @@ -12,13 +12,16 @@ export interface TestingOptions { /** * When set to false, actions are only spied, they still get executed. When * set to true, actions will be replaced with spies, resulting in their code - * not being executed. Defaults to true. + * not being executed. Defaults to true. NOTE: when providing `createSpy()`, + * it will **only** make the `fn` argument `undefined`. You still have to + * handle this in `createSpy()`. */ stubActions?: boolean /** * When set to true, calls to `$patch()` won't change the state. Defaults to - * false. + * false. NOTE: when providing `createSpy()`, it will **only** make the `fn` + * argument `undefined`. You still have to handle this in `createSpy()`. */ stubPatch?: boolean -- 2.47.2