Testing NVUE Template Component Integration in dcloudio/uni-app
This test suite validates the nvue playground functionality in uni-app, focusing on scroll-view template components. It ensures proper build processes and template rendering for nvue components within the application framework.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
dcloudio/uni-app
packages/playground/__tests__/nvue.spec.ts
import fs from 'fs'
import path from 'path'
import execa from 'execa'
const projectDir = path.resolve(__dirname, '../nvue')
beforeAll(async () => {
await execa('npm', ['run', 'build:app'], {
cwd: projectDir,
})
})
describe('nvue playground', () => {
jest.setTimeout(50 * 1000)
test('template scroll-view', () => {
const s = fs.readFileSync(
path.resolve(projectDir, 'dist/build/app/pages/index/index.js'),
'utf8'
)
expect(s).toContain('scroll-view')
})
})