]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
test: polish (#1280)
authorlazzzis <lazzzis@outlook.com>
Tue, 10 May 2022 06:38:11 +0000 (23:38 -0700)
committerGitHub <noreply@github.com>
Tue, 10 May 2022 06:38:11 +0000 (08:38 +0200)
packages/pinia/__tests__/actions.spec.ts
packages/pinia/__tests__/getters.spec.ts
packages/pinia/__tests__/mapHelpers.spec.ts
packages/pinia/__tests__/state.spec.ts

index 45e49156df05cb1c092515451b39e4fa760117af..251b99955d9dddedfd7a5191ca7b68e489110c02 100644 (file)
@@ -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')
index af46d2a2935fd2e9884e48d5ac6e2233bc8c6548..28668911d2769d8b908c639acddfc89f08d7133f 100644 (file)
@@ -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'
index a0b74be9148c35d46e50bc708142f4a67f74f9bc..23c2136d90d5992d35a738705c9ce2dad6f079cb 100644 (file)
@@ -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()
index f614f0799d3c1e30f76749a1c361546423b44c43..a09a42a9c95a74bc73e819f7cef533bfaa7d95a2 100644 (file)
@@ -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()