Skip to content

Commit

Permalink
test: use using
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 20, 2025
1 parent 4a291c2 commit 4ed7fa3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions packages/shiki/test/core-sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('should', () => {
const engine = createJavaScriptRegexEngine()

it('works', () => {
const shiki = createHighlighterCoreSync({
using shiki = createHighlighterCoreSync({
themes: [nord],
langs: [js],
engine,
Expand All @@ -19,7 +19,7 @@ describe('should', () => {
})

it('dynamic load sync theme and lang', async () => {
const shiki = createHighlighterCoreSync({
using shiki = createHighlighterCoreSync({
themes: [nord],
langs: [
js,
Expand Down
22 changes: 11 additions & 11 deletions packages/shiki/test/core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import nord from '../src/themes/nord.mjs'

describe('should', () => {
it('works', async () => {
const shiki = await createHighlighterCore({
using shiki = await createHighlighterCore({
themes: [nord],
langs: [js],
loadWasm: {
Expand All @@ -23,7 +23,7 @@ describe('should', () => {
})

it('dynamic load theme and lang', async () => {
const shiki = await createHighlighterCore({
using shiki = await createHighlighterCore({
themes: [nord],
langs: [
js,
Expand Down Expand Up @@ -61,7 +61,7 @@ describe('should', () => {
})

it('requires nested lang', async () => {
const shiki = await createHighlighterCore({
using shiki = await createHighlighterCore({
themes: [nord],
langs: [
import('../src/langs/cpp.mjs'),
Expand All @@ -84,7 +84,7 @@ describe('should', () => {
})

it('works without no initial langs and themes', async () => {
const shiki = await createHighlighterCore()
using shiki = await createHighlighterCore()

await shiki.loadLanguage(js)
await shiki.loadTheme(nord)
Expand All @@ -95,7 +95,7 @@ describe('should', () => {
})

it('works with alias', async () => {
const shiki = await createHighlighterCore({
using shiki = await createHighlighterCore({
langAlias: {
mylang: 'javascript',
mylang2: 'js', // nested alias
Expand All @@ -112,7 +112,7 @@ describe('should', () => {
})

it('works with alias override', async () => {
const shiki = await createHighlighterCore({
using shiki = await createHighlighterCore({
langAlias: {
js: 'typescript',
},
Expand All @@ -128,7 +128,7 @@ describe('should', () => {

describe('errors', () => {
it('throw on invalid theme', async () => {
const shiki = await createHighlighterCore({
using shiki = await createHighlighterCore({
themes: [nord],
langs: [js as any],
})
Expand All @@ -138,7 +138,7 @@ describe('errors', () => {
})

it('throw on invalid lang', async () => {
const shiki = await createHighlighterCore({
using shiki = await createHighlighterCore({
themes: [nord],
langs: [js as any],
})
Expand All @@ -148,7 +148,7 @@ describe('errors', () => {
})

it('highlight with raw theme registation', async () => {
const shiki = await createHighlighterCore({
using shiki = await createHighlighterCore({
themes: [nord],
langs: [js as any],
loadWasm: {
Expand All @@ -169,7 +169,7 @@ describe('errors', () => {
})

it('throw on circular alias', async () => {
const shiki = await createHighlighterCore({
using shiki = await createHighlighterCore({
langAlias: {
mylang: 'mylang2',
mylang2: 'mylang',
Expand All @@ -184,7 +184,7 @@ describe('errors', () => {
})

it('throw on using disposed instance', async () => {
const shiki = await createHighlighterCore({
using shiki = await createHighlighterCore({
themes: [nord],
langs: [js as any],
})
Expand Down

0 comments on commit 4ed7fa3

Please sign in to comment.