Skip to content

Commit

Permalink
test: add router/common.case.test.ts (#2258)
Browse files Browse the repository at this point in the history
* test: remove unused spy

* refactor: add "@typescript-eslint/no-explicit-any" for avoiding lint error

* test: exclude *.case.test.ts files from vitest

These special files are used to share test cases between different modules or runtime environments.
* shared among multiple routers
* shared by renderToString and renderToDom

* test: rename helper/css/common.test.tsx to helper/css/common.case.test.tsx

* test: add router/common.case.test.ts

* test: remove redundant skip field
  • Loading branch information
usualoma authored Feb 24, 2024
1 parent c19fad7 commit e691319
Show file tree
Hide file tree
Showing 13 changed files with 914 additions and 1,908 deletions.
1 change: 1 addition & 0 deletions deno_dist/middleware/jsx-renderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const jsxRenderer = (
return component({ ...props, Layout })
})
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
c.setRenderer(createRenderer(c, Layout, component, options) as any)
return next()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import type {
Style as StyleComponent,
} from './index'

it.skip('this file only exports test runners.', () => {})

interface Support {
nest: boolean
}
Expand Down
2 changes: 1 addition & 1 deletion src/helper/css/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { JSXNode } from '../../jsx'
import { Suspense, renderToReadableStream } from '../../jsx/streaming'
import type { HtmlEscapedString } from '../../utils/html'
import { HtmlEscapedCallbackPhase, resolveCallback } from '../../utils/html'
import { renderTest } from './common.test'
import { renderTest } from './common.case.test'
import { css, cx, keyframes, viewTransition, rawCssString, Style, createCssContext } from './index'

async function toString(
Expand Down
2 changes: 1 addition & 1 deletion src/jsx/dom/css.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { jsx } from '..'
import type { JSXNode } from '..'
import { Style, css, rawCssString, createCssContext } from '../../helper/css'
import { minify } from '../../helper/css/common'
import { renderTest } from '../../helper/css/common.test'
import { renderTest } from '../../helper/css/common.case.test'
import { render } from '.'

describe('Style and css for jsx/dom', () => {
Expand Down
3 changes: 0 additions & 3 deletions src/jsx/dom/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1067,9 +1067,6 @@ describe('DOM', () => {

describe('SVG', () => {
it('simple', () => {
const createElementSpy = vi.spyOn(dom.window.document, 'createElement')
const createElementNSSpy = vi.spyOn(dom.window.document, 'createElementNS')

const App = () => {
return (
<svg>
Expand Down
1 change: 1 addition & 0 deletions src/middleware/jsx-renderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const jsxRenderer = (
return component({ ...props, Layout })
})
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
c.setRenderer(createRenderer(c, Layout, component, options) as any)
return next()
}
Expand Down
Loading

0 comments on commit e691319

Please sign in to comment.