当前位置:网站首页>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
边栏推荐
- 万物生长大会在杭召开,当贝入选2022中国未来独角兽TOP100榜单
- NLA自然语言分析,让数据分析更智能
- What is erdma? Popular science cartoon illustration
- In 2021, the global revenue of structural bolts was about $796.4 million, and it is expected to reach $1097.6 million in 2028
- Story point vs. Human Sky
- Quick analysis: easy to share the Internet
- Design of non main lamp: how to make intelligent lighting more "intelligent"?
- 软件测试的方法
- Tip: SQL Server blocked the state 'openrowset/opendatasource' of component 'ad hoc distributed queries'
- P1042 [NOIP2003 普及组] 乒乓球
猜你喜欢

默认插槽,具名插槽,作用域插槽

TeamTalk源码分析之win-client

Daily learning 2

每日学习2

Tip: SQL Server blocked the state 'openrowset/opendatasource' of component 'ad hoc distributed queries'

Method of creating linked server for cross server data access

Fabric.js 橡皮擦的用法(包含恢复功能)

Development and design of animation surrounding mall sales website based on php+mysql

Selenium installing selenium in pycharm

PyQt5_ Qscrollarea content is saved as a picture
随机推荐
Adhere to the foundation of 20 minutes go every day II
卷积神经网络(入门)
Launcher startup process
The most complete analysis of Flink frame window function
< schematic diagram of oral arithmetic exercise machine program development> oral arithmetic exercise machine / oral arithmetic treasure / children's math treasure / children's calculator LCD LCD driv
P1042 [noip2003 popularization group] Table Tennis
Fabric.js 手动加粗文本iText
[deep learning] simple implementation of neural network forward propagation
千元投影小明Q1 Pro和极米NEW Play谁更好?和哈趣K1比哪款配置更高?
How many knowledge points can a callable interface have?
路由(二)
全屋Wi-Fi:一个谁也解决不好的痛点?
Tip: SQL Server blocked the state 'openrowset/opendatasource' of component 'ad hoc distributed queries'
Convolutional neural network (Introduction)
Development and design of animation surrounding mall sales website based on php+mysql
【虹科技术分享】如何测试 DNS 服务器:DNS 性能和响应时间测试
HMS core machine learning service helps zaful users to shop conveniently
Simple introduction to ENSP
Characteristics of selenium
博睿数据一体化智能可观测平台入选中国信通院2022年“云原生产品名录”