1+ /** @jsxImportSource solid-js - we use Solid.js as JSX here */
12import { beforeEach , describe , expect , it , vi } from 'vitest'
23import { constructCoreClass } from './class'
34
@@ -28,22 +29,22 @@ describe('constructCoreClass', () => {
2829 } )
2930 it ( 'should export DevtoolsCore and NoOpDevtoolsCore classes and make no calls to Solid.js primitives' , ( ) => {
3031 const [ DevtoolsCore , NoOpDevtoolsCore ] = constructCoreClass (
31- '@test/devtools-mock-package' ,
32+ ( ) => < div > Test Component </ div > ,
3233 )
3334 expect ( DevtoolsCore ) . toBeDefined ( )
3435 expect ( NoOpDevtoolsCore ) . toBeDefined ( )
3536 expect ( lazyImportMock ) . not . toHaveBeenCalled ( )
3637 } )
3738
3839 it ( 'DevtoolsCore should call solid primitives when mount is called' , async ( ) => {
39- const [ DevtoolsCore , _ ] = constructCoreClass ( '@test/devtools-mock-package' )
40+ const [ DevtoolsCore , _ ] = constructCoreClass ( ( ) => < div > Test Component </ div > )
4041 const instance = new DevtoolsCore ( )
4142 await instance . mount ( document . createElement ( 'div' ) , 'dark' )
4243 expect ( renderMock ) . toHaveBeenCalled ( )
4344 } )
4445
4546 it ( 'DevtoolsCore should throw if mount is called twice without unmounting' , async ( ) => {
46- const [ DevtoolsCore , _ ] = constructCoreClass ( '@test/devtools-mock-package' )
47+ const [ DevtoolsCore , _ ] = constructCoreClass ( ( ) => < div > Test Component </ div > )
4748 const instance = new DevtoolsCore ( )
4849 await instance . mount ( document . createElement ( 'div' ) , 'dark' )
4950 await expect (
@@ -52,13 +53,13 @@ describe('constructCoreClass', () => {
5253 } )
5354
5455 it ( 'DevtoolsCore should throw if unmount is called before mount' , ( ) => {
55- const [ DevtoolsCore , _ ] = constructCoreClass ( '@test/devtools-mock-package' )
56+ const [ DevtoolsCore , _ ] = constructCoreClass ( ( ) => < div > Test Component </ div > )
5657 const instance = new DevtoolsCore ( )
5758 expect ( ( ) => instance . unmount ( ) ) . toThrow ( 'Devtools is not mounted' )
5859 } )
5960
6061 it ( 'DevtoolsCore should allow mount after unmount' , async ( ) => {
61- const [ DevtoolsCore , _ ] = constructCoreClass ( '@test/devtools-mock-package' )
62+ const [ DevtoolsCore , _ ] = constructCoreClass ( ( ) => < div > Test Component </ div > )
6263 const instance = new DevtoolsCore ( )
6364 await instance . mount ( document . createElement ( 'div' ) , 'dark' )
6465 instance . unmount ( )
@@ -69,7 +70,7 @@ describe('constructCoreClass', () => {
6970
7071 it ( 'NoOpDevtoolsCore should not call any solid primitives when mount is called' , async ( ) => {
7172 const [ _ , NoOpDevtoolsCore ] = constructCoreClass (
72- '@test/devtools-mock-package' ,
73+ ( ) => < div > Test Component </ div > ,
7374 )
7475 const noOpInstance = new NoOpDevtoolsCore ( )
7576 await noOpInstance . mount ( document . createElement ( 'div' ) , 'dark' )
@@ -81,7 +82,7 @@ describe('constructCoreClass', () => {
8182
8283 it ( 'NoOpDevtoolsCore should not throw if mount is called multiple times' , async ( ) => {
8384 const [ _ , NoOpDevtoolsCore ] = constructCoreClass (
84- '@test/devtools-mock-package' ,
85+ ( ) => < div > Test Component </ div > ,
8586 )
8687 const noOpInstance = new NoOpDevtoolsCore ( )
8788 await noOpInstance . mount ( document . createElement ( 'div' ) , 'dark' )
@@ -92,15 +93,15 @@ describe('constructCoreClass', () => {
9293
9394 it ( 'NoOpDevtoolsCore should not throw if unmount is called before mount' , ( ) => {
9495 const [ _ , NoOpDevtoolsCore ] = constructCoreClass (
95- '@test/devtools-mock-package' ,
96+ ( ) => < div > Test Component </ div > ,
9697 )
9798 const noOpInstance = new NoOpDevtoolsCore ( )
9899 expect ( ( ) => noOpInstance . unmount ( ) ) . not . toThrow ( )
99100 } )
100101
101102 it ( 'NoOpDevtoolsCore should not throw if unmount is called after mount' , async ( ) => {
102103 const [ _ , NoOpDevtoolsCore ] = constructCoreClass (
103- '@test/devtools-mock-package' ,
104+ ( ) => < div > Test Component </ div > ,
104105 )
105106 const noOpInstance = new NoOpDevtoolsCore ( )
106107 await noOpInstance . mount ( document . createElement ( 'div' ) , 'dark' )
0 commit comments