当前位置:网站首页>Jest single test style problem [identity obj proxy] NPM package
Jest single test style problem [identity obj proxy] NPM package
2022-07-27 07:05:00 【Brother Xiang's words】
background :
In the use of jest Single measurement time , Due to the existence of less file , Cause single test failure


Processing mode :
1、identity-obj-proxy
Use this npm combination jest To configure , You can delegate styles .
jest Two forms of configuration :
(1) A separate jest The configuration file

Configure the content :
module.exports = {
'moduleNameMapper': {
'\\.(css|less)$': 'identity-obj-proxy',
},
};
(2) Directly in package.json To configure
"jest": {
"moduleNameMapper": {
"\\.(css|less)$": "identity-obj-proxy"
}
}2、 establish mock file
rootDir: be relative to package.json Path to file
module.exports = {
'moduleNameMapper': {
'\\.(css|less)$': '<rootDir>/__mocks__/styleMock.js',
},
};
边栏推荐
- Redis operation of Linux Installation
- 关于ES6的新特性
- 正则表达式
- OpenGL development with QT (I) drawing plane graphics
- Add virtual network card and configure OP route in win10
- Unittest suite and runner
- 程序、进程、线程、协程以及单线程、多线程基本概念
- PNA polypeptide PNA TPP | GLT ala ala Pro Leu PNA | suc ala Pro PNA | suc AAPL PNA | suc AAPM PNA
- Bert and RESNET can also be trained on mobile phones?!
- DNA(脱氧核糖核酸)供应|碳纳米管载核酸-DNA/RNA材料|DNA/RNA核酸修饰磁性纳米颗粒
猜你喜欢

Image super-resolution evaluation index

Event capture and bubbling - what is the difference between them?

How can chrome quickly transfer a group of web pages (tabs) to another device (computer)

工控用Web组态软件比组态软件更高效

Web configuration software for industrial control is more efficient than configuration software

CdS quantum dots modified DNA | CDs DNA QDs | near infrared CdS quantum dots coupled DNA specification information

Record of pychart running jupyter notebook in virtual environment

The vscode run command reported an error: the mark "&" is not a valid statement separator in this version.

Deepsort工作原理分析

ES6 new features (getting started)
随机推荐
关于卡尔曼滤波的协方差如何影响deepsort的跟踪效果的考虑
Day012 application of one-dimensional array
DNA(脱氧核糖核酸)供应|碳纳米管载核酸-DNA/RNA材料|DNA/RNA核酸修饰磁性纳米颗粒
运行代码报错: libboost_filesystem.so.1.58.0: cannot open shared object file: No such file or directory
PNA肽核酸修饰多肽Suc-Tyr-Leu-Val-pNA|Suc-Ala-Pro-Phe-pNA 11
newest! SASAC releases new measures for digital transformation of state-owned enterprises
Iotdb C client release 0.13.0.7
PNA修饰多肽ARMS-PNA|PNA-DNA|suc-AAPF-pNA|Suc-(Ala)3-pNA
Talk about multimodality of fire
Variance and covariance
nvidia-smi 各参数意义
基于SSM学生成绩管理系统
DNA modified zinc oxide | DNA modified gold nanoparticles | DNA coupled modified carbon nanomaterials
【11】 Binary code: "holding two roller handcuffs, crying out for hot hot hot"?
Pymysql query result conversion JSON
Mysql database
NAT (network address translation)
Create a container that does not depend on any underlying image
Vscode connection remote server development
Future, futuretask and completable future are often asked in interviews