/
githubmirror
/
taro
Обзор
Документация
Войти
/
githubmirror
/
taro
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/__tests__/framework.spec.ts
60 строк
2 KB
liuzejia
refactor: 抽离webpack5-runner 测试到 tests
27 май 2024, 11:43
27 май 2024, 11:43
5b9772f
Код
Авторство
О чём код?
import { IH5BuildConfig, IMiniBuildConfig } from '../utils/types' import { compile, getOutput } from './utils/compiler' describe('framework', () => { describe('should build react app', () => { test('web', async () => { const { stats, config } = await compile<IH5BuildConfig>('react', { platformType: 'web', framework: 'react' }) const assets = stats?.toJson().assets || [] expect(assets.length).toMatchSnapshot() const output = getOutput(stats, config) expect(output).toMatchSnapshot() }) test('mini', async () => { const { stats, config } = await compile<IMiniBuildConfig>('react', { platformType: 'mini', framework: 'react' }) const assets = stats?.toJson().assets || [] expect(assets.length).toMatchSnapshot() const output = getOutput(stats, config) expect(output).toMatchSnapshot() }) }) describe('should build vue3 app', () => { test('web', async () => { const { stats, config } = await compile<IH5BuildConfig>('vue3', { platformType: 'web', framework: 'vue3' }) const assets = stats?.toJson().assets || [] expect(assets.length).toMatchSnapshot() const output = getOutput(stats, config) expect(output).toMatchSnapshot() }) test('mini', async () => { const { stats, config } = await compile<IMiniBuildConfig>('vue3', { platformType: 'mini', framework: 'vue3' }) const assets = stats?.toJson().assets || [] expect(assets.length).toMatchSnapshot() const output = getOutput(stats, config) expect(output).toMatchSnapshot() }) }) })