You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vitepress/__tests__/unit/node/markdown/plugins/highlight.test.ts

27 lines
703 B

import { highlight } from 'node/markdown/plugins/highlight'
describe('node/markdown/plugins/highlight', () => {
test('passes color replacements through markdown options', async () => {
const [render, dispose] = await highlight(
{ light: 'github-light', dark: 'github-dark' },
{
colorReplacements: {
'github-light': {
'#005cc5': '#000000'
}
}
}
)
try {
const html = await render('const a = 1', 'js', '')
expect(html).toContain('--shiki-light:#000000')
expect(html).toContain('--shiki-dark:#79B8FF')
expect(html).not.toContain('--shiki-light:#005CC5')
} finally {
dispose()
}
})
})