当前位置:网站首页>Uniapp automated test learning
Uniapp automated test learning
2022-07-02 14:28:00 【snotJam】
List of articles
Environmental Science : It's normal uniapp project , Build a test environment by installing plug-ins , Instead of cli The way
Question 1 : Tips node Of binding.node The problem of
After installing the plug-in , Tips node Of binding.node The problem of , Currently installed is node.js yes v14 Version of , Install after uninstall v12 edition , No more errors
Question two : There is no option to run test cases by right clicking
the reason being that vue How to write it , establish xxx.spec.js The test file , There is no option to run test cases by right clicking . Change it to xxx.test.js , Right click to select run test case
Question 3 : import when , newspaper Cannot use import statement outside a module
See vue Component unit tests , In the test file , have access to import To introduce modules , But in uniapp Of , xxx.test.js In file , Use import To introduce , Will be submitted to the :
Cannot use import statement outside a module
detail as follows :
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { shallowMount } from "@vue/test-utils";
It seems to be the whole xxx.test.js The file encapsulates a function Method , So use import It's a mistake , Need to use require To introduce
1:import Loaded at code compile time , So it has to be at the beginning of the file ,require Loaded at code run time , therefore require In theory, it can be used anywhere in the code , therefore import Better performance .
2:import When the introduced object is modified , The source object will also be modified , Equivalent to light copy ,require When the introduced object is modified , The source object will not be modified , The official website is called copy , We can understand it as a deep copy .
Then I refer to other people's articles :uniapp automated testing
Tested according to the blogger's writing :.test.js The contents are as follows
.child-title Is one of the introduced sub components class, The operation results are as follows :
thus , It can be regarded as a simple test process , For the preparation of test documents and jest Usage of , To be studied
边栏推荐
- The use of TestNG, the testing framework (II): the use of TestNG XML
- Getting started with QT - making a simple calculator
- 快解析:轻松实现共享上网
- Qt原代码基本知识
- Codeforces Round #803 (Div. 2)(A~D)
- Thymeleaf dependency
- P1042 [NOIP2003 普及组] 乒乓球
- Penetrate the remote connection database through the Intranet
- <口算练习机 方案开发原理图>口算练习机/口算宝/儿童数学宝/儿童计算器 LCD液晶显示驱动IC-VK1621B,提供技术支持
- 万物生长大会在杭召开,当贝入选2022中国未来独角兽TOP100榜单
猜你喜欢
博睿数据一体化智能可观测平台入选中国信通院2022年“云原生产品名录”
跨服务器数据访问的创建链接服务器方法
Selenium, element operation and browser operation methods
kaggle如何使用utility script
QT new project
The most complete analysis of Flink frame window function
What is erdma? Popular science cartoon illustration
每日学习3
C crystal report printing
【虹科技术分享】如何测试 DNS 服务器:DNS 性能和响应时间测试
随机推荐
P1042 [NOIP2003 普及组] 乒乓球
<口算练习机 方案开发原理图>口算练习机/口算宝/儿童数学宝/儿童计算器 LCD液晶显示驱动IC-VK1621B,提供技术支持
Teamtalk source code analysis win client
没有从远程服务器‘‘映射到本地用户‘(null)/sa‘的远程用户‘sa‘及服务主密码解密错误的解决办法
跨服务器数据访问的创建链接服务器方法
提示:SQL Server 阻止了对组件‘Ad Hoc Distributed Queries ‘的STATEMENT ‘OpenRowset/OpenDatasource“”
什么是 eRDMA?丨科普漫画图解
P1908 逆序对
Fabric. JS dynamically set font size
MySQL 45 lecture - learning from the actual battle of geek time MySQL 45 Lecture Notes - 04 | easy to understand index (Part 1)
C语言高级用法--函数指针:回调函数;转换表
How to set QT manual layout
Golang quickly generates model and queryset of database tables
selenium 元素定位方法
[deep learning] simple implementation of neural network forward propagation
Fabric.js 橡皮擦的用法(包含恢复功能)
PHP linked list creation and traversal
Systemserver process
字符串匹配问题
Generally speaking, if the error of inconsistent tab and space occurs frequently