Skip to content

Commit 421a35c

Browse files
committed
chore(linting): fix some issues
1 parent f8604f6 commit 421a35c

File tree

2 files changed

+34
-37
lines changed

2 files changed

+34
-37
lines changed

test/useFormKitSchema.test.ts

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1-
import { expect, test } from 'vitest'
2-
import {useFormKitSchema} from '../src/composables'
1+
import { expect, it } from 'vitest'
2+
import { useFormKitSchema } from '../src/composables'
33

4-
function renderToBoolean(element: any):boolean {
5-
return new Boolean(element?.if).valueOf()
4+
function renderToBoolean(element: any): boolean {
5+
return !!element?.if
66
}
77

8-
test('add element', () => {
9-
const { addElement } = useFormKitSchema()
8+
it('add element', () => {
9+
const { addElement } = useFormKitSchema()
1010

11-
const e1 = addElement()
12-
console.log(e1)
13-
expect( e1.$el).toBe('div')
14-
expect( renderToBoolean(e1)).toBe(true)
15-
expect(e1.children?.length).toBe(0)
11+
const e1 = addElement()
12+
expect(e1.$el).toBe('div')
13+
expect(renderToBoolean(e1)).toBe(true)
14+
expect(e1.children?.length).toBe(0)
1615

17-
const e2 = addElement('span', [e1], { name: 'test'}, false)
18-
console.log(e2)
19-
expect( e2.$el).toBe('span')
20-
expect( renderToBoolean(e2)).toBe(false)
21-
expect(e2.children?.length).toBe(1)
22-
expect(e2.attrs?.name).toBe('test')
16+
const e2 = addElement('span', [e1], { name: 'test' }, false)
17+
expect(e2.$el).toBe('span')
18+
expect(renderToBoolean(e2)).toBe(false)
19+
expect(e2.children?.length).toBe(1)
20+
expect(e2.attrs?.name).toBe('test')
2321
})
2422

25-
test('add component', () => {
26-
const {addComponent} = useFormKitSchema()
23+
it('add component', () => {
24+
const { addComponent } = useFormKitSchema()
2725

28-
const c1 = addComponent()
29-
expect( c1.$cmp).toBe('Button')
30-
console.log(c1)
31-
expect(renderToBoolean(c1)).toBe(true)
32-
})
26+
const c1 = addComponent()
27+
expect(c1.$cmp).toBe('Button')
28+
expect(renderToBoolean(c1)).toBe(true)
29+
})

vite.config.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { defineConfig } from 'vite'
22
import vue from '@vitejs/plugin-vue'
33

4-
export default defineConfig({
5-
plugins: [vue()],
6-
test: {
7-
// enable jest-like global test APIs
8-
globals: true,
4+
export default defineConfig({
5+
plugins: [vue()],
6+
test: {
7+
// enable jest-like global test APIs
8+
globals: true,
99

10-
// simulate DOM with happy-dom
11-
// (requires installing happy-dom as a peer dependency)
12-
environment: 'happy-dom',
10+
// simulate DOM with happy-dom
11+
// (requires installing happy-dom as a peer dependency)
12+
environment: 'happy-dom',
1313

14-
coverage: {
15-
exclude: ['dev/**', 'docs/**']
16-
}
17-
}
18-
})
14+
coverage: {
15+
exclude: ['dev/**', 'docs/**'],
16+
},
17+
},
18+
})

0 commit comments

Comments
 (0)