From: Eduardo San Martin Morote Date: Sun, 19 Dec 2021 22:07:53 +0000 (+0100) Subject: test: remove old tests from 4dc1f1b X-Git-Tag: @pinia/nuxt@0.1.7~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=716f76a266c85a198fb883cc7dc110fb9ae26348;p=thirdparty%2Fvuejs%2Fpinia.git test: remove old tests from 4dc1f1b --- diff --git a/packages/pinia/__tests__/actions.spec.ts b/packages/pinia/__tests__/actions.spec.ts index 0fbc0b20..45e49156 100644 --- a/packages/pinia/__tests__/actions.spec.ts +++ b/packages/pinia/__tests__/actions.spec.ts @@ -147,22 +147,6 @@ describe('Actions', () => { expect(() => store.throws()).toThrowError('fail') }) - it.skip('can avoid thrown errors to propagate', () => { - const store = useStore() - store.$onAction(({ onError }) => { - onError(() => false) - }) - expect(() => store.throws()).not.toThrowError('fail') - }) - - it.skip('can avoid async errors to propagate', async () => { - const store = useStore() - store.$onAction(({ onError }) => { - onError(() => false) - }) - await expect(store.rejects()).resolves.toBe(undefined) - }) - it('throws async errors', async () => { const store = useStore() expect.assertions(1) @@ -178,45 +162,6 @@ describe('Actions', () => { expect(spy).toHaveBeenCalledWith('fail') }) - it.skip('can override the returned value', () => { - const store = useStore() - expect.assertions(2) - store.$onAction(({ after }) => { - // @ts-expect-error: cannot return a string because no action returns a string - after((v) => { - expect(v).toBe(false) - return 'hello' - }) - }) - expect(store.toggle()).toBe('hello') - }) - - it.skip('can override the resolved value', async () => { - const store = useStore() - expect.assertions(2) - store.$onAction(({ after }) => { - // @ts-expect-error: cannot return a string because no action returns a string - after((v) => { - expect(v).toBe(false) - return 'hello' - }) - }) - await expect(store.getNonA()).resolves.toBe('hello') - }) - - it.skip('can override the resolved value with a promise', async () => { - const store = useStore() - expect.assertions(2) - store.$onAction(({ after }) => { - // @ts-expect-error: cannot return a string because no action returns a string - after(async (v) => { - expect(v).toBe(false) - return 'hello' - }) - }) - await expect(store.getNonA()).resolves.toBe('hello') - }) - it('can destructure actions', () => { const store = useStore() const { simple } = store