提交 e6968364 编写于 作者: fxy060608's avatar fxy060608

chore(nvue): tests

上级 d1f69174
const execa = require('execa')
const fs = require('fs')
import fs from 'fs'
import path from 'path'
import execa from 'execa'
const nvuePath = require('path').resolve(__dirname, '../nvue')
const projectDir = path.resolve(__dirname, '../nvue')
beforeAll(async () => {
await execa('npm run', ['build:app'], {
cwd: nvuePath,
await execa('npm', ['run', 'build:app'], {
cwd: projectDir,
})
})
......@@ -13,8 +14,8 @@ describe('nvue playground', () => {
jest.setTimeout(50 * 1000)
test('template scroll-view', () => {
const s = fs.readFileSync(
require('path').resolve(nvuePath, 'dist/build/app/pages/index/index.js'),
{ encoding: 'utf8' }
path.resolve(projectDir, 'dist/build/app/pages/index/index.js'),
'utf8'
)
expect(s).toContain('scroll-view')
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册