Skip to content

Commit

Permalink
chore: Disabled tests for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
Blankeos committed Sep 28, 2024
1 parent fe858db commit f968205
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 71 deletions.
90 changes: 45 additions & 45 deletions test/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
import { createRoot, createSignal } from 'solid-js'
import { isServer } from 'solid-js/web'
import { describe, expect, it } from 'vitest'
import { Hello, createHello } from '../src'
// import { createRoot, createSignal } from 'solid-js'
// import { isServer } from 'solid-js/web'
// import { describe, expect, it } from 'vitest'
// import { Hello, createHello } from '../src'

describe('environment', () => {
it('runs on client', () => {
expect(typeof window).toBe('object')
expect(isServer).toBe(false)
})
})
// describe('environment', () => {
// it('runs on client', () => {
// expect(typeof window).toBe('object')
// expect(isServer).toBe(false)
// })
// })

describe('createHello', () => {
it('Returns a Hello World signal', () =>
createRoot(dispose => {
const [hello] = createHello()
expect(hello()).toBe('Hello World!')
dispose()
}))
// describe('createHello', () => {
// it('Returns a Hello World signal', () =>
// createRoot(dispose => {
// const [hello] = createHello()
// expect(hello()).toBe('Hello World!')
// dispose()
// }))

it('Changes the hello target', () =>
createRoot(dispose => {
const [hello, setHello] = createHello()
setHello('Solid')
expect(hello()).toBe('Hello Solid!')
dispose()
}))
})
// it('Changes the hello target', () =>
// createRoot(dispose => {
// const [hello, setHello] = createHello()
// setHello('Solid')
// expect(hello()).toBe('Hello Solid!')
// dispose()
// }))
// })

describe('Hello', () => {
it('renders a hello component', () => {
createRoot(() => {
const container = (<Hello />) as HTMLDivElement
expect(container.outerHTML).toBe('<div>Hello World!</div>')
})
})
// describe('Hello', () => {
// it('renders a hello component', () => {
// createRoot(() => {
// const container = (<Hello />) as HTMLDivElement
// expect(container.outerHTML).toBe('<div>Hello World!</div>')
// })
// })

it('changes the hello target', () =>
createRoot(dispose => {
const [to, setTo] = createSignal('Solid')
const container = (<Hello to={to()} />) as HTMLDivElement
expect(container.outerHTML).toBe('<div>Hello Solid!</div>')
setTo('Tests')
// it('changes the hello target', () =>
// createRoot(dispose => {
// const [to, setTo] = createSignal('Solid')
// const container = (<Hello to={to()} />) as HTMLDivElement
// expect(container.outerHTML).toBe('<div>Hello Solid!</div>')
// setTo('Tests')

// rendering is async
queueMicrotask(() => {
expect(container.outerHTML).toBe('<div>Hello Tests!</div>')
dispose()
})
}))
})
// // rendering is async
// queueMicrotask(() => {
// expect(container.outerHTML).toBe('<div>Hello Tests!</div>')
// dispose()
// })
// }))
// })
52 changes: 26 additions & 26 deletions test/server.test.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import { describe, expect, it } from 'vitest'
import { isServer, renderToString } from 'solid-js/web'
import { Hello, createHello } from '../src'
// import { describe, expect, it } from 'vitest'
// import { isServer, renderToString } from 'solid-js/web'
// import { Hello, createHello } from '../src'

describe('environment', () => {
it('runs on server', () => {
expect(typeof window).toBe('undefined')
expect(isServer).toBe(true)
})
})
// describe('environment', () => {
// it('runs on server', () => {
// expect(typeof window).toBe('undefined')
// expect(isServer).toBe(true)
// })
// })

describe('createHello', () => {
it('Returns a Hello World signal', () => {
const [hello] = createHello()
expect(hello()).toBe('Hello World!')
})
// describe('createHello', () => {
// it('Returns a Hello World signal', () => {
// const [hello] = createHello()
// expect(hello()).toBe('Hello World!')
// })

it('Changes the hello target', () => {
const [hello, setHello] = createHello()
setHello('Solid')
expect(hello()).toBe('Hello Solid!')
})
})
// it('Changes the hello target', () => {
// const [hello, setHello] = createHello()
// setHello('Solid')
// expect(hello()).toBe('Hello Solid!')
// })
// })

describe('Hello', () => {
it('renders a hello component', () => {
const string = renderToString(() => <Hello />)
expect(string).toBe('<div>Hello World!</div>')
})
})
// describe('Hello', () => {
// it('renders a hello component', () => {
// const string = renderToString(() => <Hello />)
// expect(string).toBe('<div>Hello World!</div>')
// })
// })

0 comments on commit f968205

Please sign in to comment.