Skip to content

Commit

Permalink
test: update test usage
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 15, 2025
1 parent 11ef0cd commit acd1ee2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/compat/test/fixtures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { describe, expect, it } from 'vitest'
import getHighlighter from '../src'

describe('fixtures', () => {
const files = import.meta.glob('./input/*.*', { as: 'raw', eager: true })
const files = import.meta.glob<string>('./input/*.*', { query: '?raw', import: 'default', eager: true })
const filter = process.env.FILTER
Object
.entries(files)
Expand Down
18 changes: 9 additions & 9 deletions packages/transformers/test/fixtures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ body { margin: 0; }

suite(
'diff',
import.meta.glob('./fixtures/diff/*.*', { as: 'raw', eager: true }),
import.meta.glob('./fixtures/diff/*.*', { query: '?raw', import: 'default', eager: true }),
[transformerNotationDiff(), transformerRemoveLineBreak()],
code => `${code}
<style>
Expand All @@ -78,7 +78,7 @@ body { margin: 0; }

suite(
'focus',
import.meta.glob('./fixtures/focus/*.*', { as: 'raw', eager: true }),
import.meta.glob('./fixtures/focus/*.*', { query: '?raw', import: 'default', eager: true }),
[transformerNotationFocus(), transformerRemoveLineBreak()],
code => `${code}
<style>
Expand All @@ -91,7 +91,7 @@ body { margin: 0; }

suite(
'highlight',
import.meta.glob('./fixtures/highlight/*.*', { as: 'raw', eager: true }),
import.meta.glob('./fixtures/highlight/*.*', { query: '?raw', import: 'default', eager: true }),
[transformerNotationHighlight(), transformerRemoveLineBreak()],
code => `${code}
<style>
Expand All @@ -104,7 +104,7 @@ body { margin: 0; }

suite(
'highlight-word',
import.meta.glob('./fixtures/highlight-word/*.*', { as: 'raw', eager: true }),
import.meta.glob('./fixtures/highlight-word/*.*', { query: '?raw', import: 'default', eager: true }),
[transformerNotationWordHighlight(), transformerRemoveLineBreak()],
code => `${code}
<style>
Expand All @@ -117,7 +117,7 @@ body { margin: 0; }

suite(
'error-level',
import.meta.glob('./fixtures/error-level/*.*', { as: 'raw', eager: true }),
import.meta.glob('./fixtures/error-level/*.*', { query: '?raw', import: 'default', eager: true }),
[transformerNotationErrorLevel(), transformerRemoveLineBreak()],
code => `${code}
<style>
Expand All @@ -131,31 +131,31 @@ body { margin: 0; }

suite(
'whitespace:all',
import.meta.glob('./fixtures/whitespace/*.*', { as: 'raw', eager: true }),
import.meta.glob('./fixtures/whitespace/*.*', { query: '?raw', import: 'default', eager: true }),
[transformerRenderWhitespace({ position: 'all' })],
code => `${code}${CSS_RENDER_WHITESPACE}`,
'.all',
)

suite(
'whitespace:boundary',
import.meta.glob('./fixtures/whitespace/*.*', { as: 'raw', eager: true }),
import.meta.glob('./fixtures/whitespace/*.*', { query: '?raw', import: 'default', eager: true }),
[transformerRenderWhitespace({ position: 'boundary' })],
code => `${code}${CSS_RENDER_WHITESPACE}`,
'.boundary',
)

suite(
'whitespace:trailing',
import.meta.glob('./fixtures/whitespace/*.*', { as: 'raw', eager: true }),
import.meta.glob('./fixtures/whitespace/*.*', { query: '?raw', import: 'default', eager: true }),
[transformerRenderWhitespace({ position: 'trailing' })],
code => `${code}${CSS_RENDER_WHITESPACE}`,
'.trailing',
)

suite(
'all',
import.meta.glob('./fixtures/all/*.*', { as: 'raw', eager: true }),
import.meta.glob('./fixtures/all/*.*', { query: '?raw', import: 'default', eager: true }),
[
transformerNotationDiff(),
transformerNotationFocus(),
Expand Down
2 changes: 1 addition & 1 deletion packages/twoslash/test/fixtures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { rendererRich, transformerTwoslash } from '@shikijs/twoslash'
import { codeToHast, hastToHtml } from 'shiki'
import { describe, expect, it } from 'vitest'

const files = import.meta.glob('./fixtures/*.*', { as: 'raw', eager: true })
const files = import.meta.glob<string>('./fixtures/*.*', { query: '?raw', import: 'default', eager: true })

describe('fixtures', () => {
for (const file in files) {
Expand Down
2 changes: 1 addition & 1 deletion packages/vitepress-twoslash/test/fixtures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { codeToHast, getSingletonHighlighter } from 'shiki'
import { describe, expect, it } from 'vitest'
import { rendererFloatingVue } from '../src'

const files = import.meta.glob('../../twoslash/test/fixtures/*.*', { as: 'raw', eager: true })
const files = import.meta.glob<string>('../../twoslash/test/fixtures/*.*', { query: '?raw', import: 'default', eager: true })

describe('fixtures', async () => {
const shiki = await getSingletonHighlighter()
Expand Down

0 comments on commit acd1ee2

Please sign in to comment.