Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin committed Sep 28, 2024
1 parent 0843e52 commit e089de1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/vue-directives.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { InjectionUsageRecord } from '../src'
import process from 'node:process'
import { describe, expect, it } from 'vitest'
import { compileTemplate } from 'vue/compiler-sfc'
Expand Down Expand Up @@ -823,7 +824,10 @@ describe('vue-directives', () => {
const metadata = ctx.getMetadata()
expect(metadata).toBeDefined()
expect(Object.keys(metadata!.injectionUsage).length).toBe(imports.length)
imports.map(i => metadata!.injectionUsage[i.as ?? i.name]).map((e) => {
imports.reduce((acc, i) => {
acc.push(metadata!.injectionUsage[i.as ?? i.name])
return acc
}, [] as InjectionUsageRecord[]).forEach((e) => {
expect(e).toBeDefined()
expect(e.count).toBe(1)
})
Expand Down

0 comments on commit e089de1

Please sign in to comment.