提交 87dfd70d 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: 通过限制测试顺序,规避 pullDownRefresh 测试手势操作被弹框影响问题

上级 8887f8c3
// 自动化测试
// 备注:
//
// 1. testPathIgnorePatterns 忽略/pages/API的几条用例,是因为在ios设备上,运行会导致app崩溃。后期完成后,再去除。
// 2. testPathIgnorePatterns 忽略webview相关用例, 是因为采用app-webview方式后,不需要这两个用例。请勿修改和提交到Git。
//
const path = require('path')
module.exports = {
testTimeout: 30000,
......@@ -15,8 +9,7 @@ module.exports = {
testMatch: ["<rootDir>/pages/**/*test.[jt]s?(x)"],
testPathIgnorePatterns: [
'/node_modules/',
'<rootDir>/pages/webview-screenshot-comparison/webview-screenshot-comparison.test.js',
'<rootDir>/pages/webview-screenshot/webview-screenshot.test.js'
],
setupFilesAfterEnv: ['<rootDir>/jest-setup.js'],
testSequencer: path.join(__dirname, "testSequencer.js")
}
const Sequencer = require("@jest/test-sequencer").default
const sortTestFilePaths = ["/pages/API/pull-down-refresh/pull-down-refresh.test.js"]
class CustomSequencer extends Sequencer {
sort(tests) {
// 测试例排序
const sortedTests = sortTestFilePaths
.map((filePath) => {
return tests.find((test) => test.path.endsWith(filePath))
})
.filter(Boolean)
return [...new Set([...sortedTests, ...tests])]
}
}
module.exports = CustomSequencer
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册