From 5475328eaa944c862e2bfbc0a420603d6ced196f Mon Sep 17 00:00:00 2001 From: lazzzis Date: Mon, 9 May 2022 23:38:11 -0700 Subject: [PATCH] test: polish (#1280) --- packages/pinia/__tests__/actions.spec.ts | 7 +------ packages/pinia/__tests__/getters.spec.ts | 2 +- packages/pinia/__tests__/mapHelpers.spec.ts | 1 - packages/pinia/__tests__/state.spec.ts | 11 ----------- 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/packages/pinia/__tests__/actions.spec.ts b/packages/pinia/__tests__/actions.spec.ts index 45e49156..251b9995 100644 --- a/packages/pinia/__tests__/actions.spec.ts +++ b/packages/pinia/__tests__/actions.spec.ts @@ -142,11 +142,6 @@ describe('Actions', () => { expect(() => store.throws()).toThrowError('fail') }) - it('throws errors', () => { - const store = useStore() - expect(() => store.throws()).toThrowError('fail') - }) - it('throws async errors', async () => { const store = useStore() expect.assertions(1) @@ -175,7 +170,7 @@ describe('Actions', () => { { $id: store.$id, simple, - // otherwise it would faial + // otherwise it would fail toggle() {}, }.simple() ).toBe('simple') diff --git a/packages/pinia/__tests__/getters.spec.ts b/packages/pinia/__tests__/getters.spec.ts index af46d2a2..28668911 100644 --- a/packages/pinia/__tests__/getters.spec.ts +++ b/packages/pinia/__tests__/getters.spec.ts @@ -78,7 +78,7 @@ describe('Getters', () => { setActivePinia(pinia1) const aStore = useA() - // simulate a different applications + // simulate a different application setActivePinia(pinia2) const bStore = useB() bStore.b = 'c' diff --git a/packages/pinia/__tests__/mapHelpers.spec.ts b/packages/pinia/__tests__/mapHelpers.spec.ts index a0b74be9..23c2136d 100644 --- a/packages/pinia/__tests__/mapHelpers.spec.ts +++ b/packages/pinia/__tests__/mapHelpers.spec.ts @@ -52,7 +52,6 @@ describe('Map Helpers', () => { }) const wrapper = mount(Component, { global: { plugins: [pinia] } }) - // const store = useStore() // @ts-expect-error: by default this shouldn't exist expect(wrapper.vm.main).toBeDefined() expect(wrapper.vm.mainStore).not.toBeDefined() diff --git a/packages/pinia/__tests__/state.spec.ts b/packages/pinia/__tests__/state.spec.ts index f614f079..a09a42a9 100644 --- a/packages/pinia/__tests__/state.spec.ts +++ b/packages/pinia/__tests__/state.spec.ts @@ -95,17 +95,6 @@ describe('State', () => { expect(pinia.state.value.main.nested.n).toBe(3) }) - // it('watch', () => { - // setActivePinia(createPinia()) - // defineStore({ - // id: 'main', - // state: () => ({ - // name: 'Eduardo', - // counter: 0, - // }), - // })() - // }) - it('state can be watched', async () => { const store = useStore() const spy = jest.fn() -- 2.47.2