Skip to content

Commit b757d96

Browse files
ci: apply automated fixes
1 parent 5110b20 commit b757d96

2 files changed

Lines changed: 31 additions & 23 deletions

File tree

packages/devtools-utils/src/solid/class.test.tsx

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,27 @@ describe('constructCoreClass', () => {
2828
vi.clearAllMocks()
2929
})
3030
it('should export DevtoolsCore and NoOpDevtoolsCore classes and make no calls to Solid.js primitives', () => {
31-
const [DevtoolsCore, NoOpDevtoolsCore] = constructCoreClass(
32-
() => <div>Test Component</div>,
33-
)
31+
const [DevtoolsCore, NoOpDevtoolsCore] = constructCoreClass(() => (
32+
<div>Test Component</div>
33+
))
3434
expect(DevtoolsCore).toBeDefined()
3535
expect(NoOpDevtoolsCore).toBeDefined()
3636
expect(lazyImportMock).not.toHaveBeenCalled()
3737
})
3838

3939
it('DevtoolsCore should call solid primitives when mount is called', async () => {
40-
const [DevtoolsCore, _] = constructCoreClass(() => <div>Test Component</div>)
40+
const [DevtoolsCore, _] = constructCoreClass(() => (
41+
<div>Test Component</div>
42+
))
4143
const instance = new DevtoolsCore()
4244
await instance.mount(document.createElement('div'), 'dark')
4345
expect(renderMock).toHaveBeenCalled()
4446
})
4547

4648
it('DevtoolsCore should throw if mount is called twice without unmounting', async () => {
47-
const [DevtoolsCore, _] = constructCoreClass(() => <div>Test Component</div>)
49+
const [DevtoolsCore, _] = constructCoreClass(() => (
50+
<div>Test Component</div>
51+
))
4852
const instance = new DevtoolsCore()
4953
await instance.mount(document.createElement('div'), 'dark')
5054
await expect(
@@ -53,13 +57,17 @@ describe('constructCoreClass', () => {
5357
})
5458

5559
it('DevtoolsCore should throw if unmount is called before mount', () => {
56-
const [DevtoolsCore, _] = constructCoreClass(() => <div>Test Component</div>)
60+
const [DevtoolsCore, _] = constructCoreClass(() => (
61+
<div>Test Component</div>
62+
))
5763
const instance = new DevtoolsCore()
5864
expect(() => instance.unmount()).toThrow('Devtools is not mounted')
5965
})
6066

6167
it('DevtoolsCore should allow mount after unmount', async () => {
62-
const [DevtoolsCore, _] = constructCoreClass(() => <div>Test Component</div>)
68+
const [DevtoolsCore, _] = constructCoreClass(() => (
69+
<div>Test Component</div>
70+
))
6371
const instance = new DevtoolsCore()
6472
await instance.mount(document.createElement('div'), 'dark')
6573
instance.unmount()
@@ -69,9 +77,9 @@ describe('constructCoreClass', () => {
6977
})
7078

7179
it('NoOpDevtoolsCore should not call any solid primitives when mount is called', async () => {
72-
const [_, NoOpDevtoolsCore] = constructCoreClass(
73-
() => <div>Test Component</div>,
74-
)
80+
const [_, NoOpDevtoolsCore] = constructCoreClass(() => (
81+
<div>Test Component</div>
82+
))
7583
const noOpInstance = new NoOpDevtoolsCore()
7684
await noOpInstance.mount(document.createElement('div'), 'dark')
7785

@@ -81,9 +89,9 @@ describe('constructCoreClass', () => {
8189
})
8290

8391
it('NoOpDevtoolsCore should not throw if mount is called multiple times', async () => {
84-
const [_, NoOpDevtoolsCore] = constructCoreClass(
85-
() => <div>Test Component</div>,
86-
)
92+
const [_, NoOpDevtoolsCore] = constructCoreClass(() => (
93+
<div>Test Component</div>
94+
))
8795
const noOpInstance = new NoOpDevtoolsCore()
8896
await noOpInstance.mount(document.createElement('div'), 'dark')
8997
await expect(
@@ -92,17 +100,17 @@ describe('constructCoreClass', () => {
92100
})
93101

94102
it('NoOpDevtoolsCore should not throw if unmount is called before mount', () => {
95-
const [_, NoOpDevtoolsCore] = constructCoreClass(
96-
() => <div>Test Component</div>,
97-
)
103+
const [_, NoOpDevtoolsCore] = constructCoreClass(() => (
104+
<div>Test Component</div>
105+
))
98106
const noOpInstance = new NoOpDevtoolsCore()
99107
expect(() => noOpInstance.unmount()).not.toThrow()
100108
})
101109

102110
it('NoOpDevtoolsCore should not throw if unmount is called after mount', async () => {
103-
const [_, NoOpDevtoolsCore] = constructCoreClass(
104-
() => <div>Test Component</div>,
105-
)
111+
const [_, NoOpDevtoolsCore] = constructCoreClass(() => (
112+
<div>Test Component</div>
113+
))
106114
const noOpInstance = new NoOpDevtoolsCore()
107115
await noOpInstance.mount(document.createElement('div'), 'dark')
108116
expect(() => noOpInstance.unmount()).not.toThrow()

packages/devtools-utils/src/solid/class.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @jsxImportSource solid-js - we use Solid.js as JSX here */
22

3-
import type { JSX, } from 'solid-js'
3+
import type { JSX } from 'solid-js'
44

55
/**
66
* Constructs the core class for the Devtools.
@@ -18,7 +18,7 @@ export function constructCoreClass(Component: () => JSX.Element) {
1818
#Component: any
1919
#ThemeProvider: any
2020

21-
constructor() { }
21+
constructor() {}
2222

2323
async mount<T extends HTMLElement>(el: T, theme: 'light' | 'dark') {
2424
const { lazy } = await import('solid-js')
@@ -64,8 +64,8 @@ export function constructCoreClass(Component: () => JSX.Element) {
6464
constructor() {
6565
super()
6666
}
67-
async mount<T extends HTMLElement>(_el: T, _theme: 'light' | 'dark') { }
68-
unmount() { }
67+
async mount<T extends HTMLElement>(_el: T, _theme: 'light' | 'dark') {}
68+
unmount() {}
6969
}
7070
return [DevtoolsCore, NoOpDevtoolsCore] as const
7171
}

0 commit comments

Comments
 (0)