当前位置:网站首页>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
边栏推荐
- 千元投影小明Q1 Pro和极米NEW Play谁更好?和哈趣K1比哪款配置更高?
- [development environment] Dell computer system reinstallation (download Dell OS recovery tool | use Dell OS recovery tool to make USB flash disk system | install system)
- 跨服务器数据访问的创建链接服务器方法
- The most complete analysis of Flink frame window function
- 什么是 eRDMA?丨科普漫画图解
- Go operation redis
- MQ教程 | Exchange(交换机)
- The global special paper revenue in 2021 was about $27 million, and it is expected to reach $35 million in 2028. From 2022 to 2028, the CAGR was 3.8%
- MySQL 45 lecture - learning the actual battle of MySQL in Geek time 45 Lecture Notes - 05 | easy to understand index (Part 2)
- Quarkus学习四 - 项目开发到部署
猜你喜欢

kaggle如何使用utility script
![[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)](/img/08/9f25515e600a3174340b2589c81b0e.jpg)
[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)

Codeforces Round #803 (Div. 2)(A~D)

2022家用投影仪首选!当贝F5强悍音画效果带来极致视听体验

QT new project_ MyNotepad++

千元投影小明Q1 Pro和极米NEW Play谁更好?和哈趣K1比哪款配置更高?

2022 home projector preferred! Dangbei F5 brings the ultimate audio-visual experience with its powerful audio-visual effect

Quick analysis: easy to share the Internet

Selenium, element operation and browser operation methods

Daily learning 3
随机推荐
P1908 reverse sequence pair
Golang quickly generates model and queryset of database tables
联合搜索:搜索中的所有需求
删除元素(带过渡动画)
数据湖(十一):Iceberg表数据组织与查询
Story point vs. Human Sky
Getting started with QT - making a simple calculator
Analysis of CPU surge in production environment service
NLA自然语言分析实现数据分析零门槛
千元投影小明Q1 Pro和极米NEW Play谁更好?和哈趣K1比哪款配置更高?
Selenium installing selenium in pycharm
腾讯云 TStor 统一存储通过信通院首批文件存储基础能力评测
Design and implementation of car query system based on php+mysql
The evolution process of the correct implementation principle of redis distributed lock and the summary of redison's actual combat
当贝投影4K激光投影X3 Pro获得一致好评:万元投影仪首选
什么是 eRDMA?丨科普漫画图解
Fabric.js 元素被选中时保持原有层级
Use of swagger
由粒子加速器产生的反中子形成的白洞
Convolutional neural network (Introduction)