Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/sxzz/unplugin-combine. Unified plugin that combines other plugins into one plugin.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546import { expect, test } from 'vitest'import { createCombinePlugin, type OptionsPlugin } from '../src'
const plugins: OptionsPlugin[] = [{ name: `1` }, { name: `2` }, { name: `3` }]
test('plugin', () => { expect( createCombinePlugin(() => ({ name: 'name', plugins, })).plugins(), ).toMatchInlineSnapshot(` [ { "name": "1", }, { "name": "2", }, { "name": "3", }, ] `)})
test('plugin async', async () => { const combined = createCombinePlugin(() => ({ name: 'name', plugins: Promise.resolve(plugins), })).plugins() await expect(combined).resolves.toMatchInlineSnapshot(` [ { "name": "1", }, { "name": "2", }, { "name": "3", }, ] `)})