[英]Karate - karate.configure('headers', { Accept: 'application/json' }); is not recognized in karate-config.js file. It says missing import statements
I have setup a new karate project and everything working fine but when I try to use " karate.configure()
" in " karate-config.js
" file it does not recognize and when I hover over it, I get this message " missing import statements, insert const karate = require(./Chart.min) "我已经设置了一个新的空手道项目,一切正常,但是当我尝试在“karate
karate-config.js
”文件中使用“ karate.configure()
”时,它无法识别,当我在它上面使用 hover 时,我收到这条消息“丢失导入语句,插入 const karate = require(./Chart.min) "
This is how my " karate-config.js
" file looks like: "```这就是我的“
karate-config.js
”文件的样子:“```
function fn() { function fn() {
karate.configure("headers", {'Content-Type':'application/x-www-form-urlencoded'})
karate.configure('connectTimeout', 6000000);
karate.configure('readTimeout', 6000000);
var config = {
baseUrl: 'https://someurl',
iprHost: 'https://url',
};
return config;
} }
And the dependencies I am using are :
"```
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-apache</artifactId>
<version>0.9.6</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.intuit.karate/karate-junit4 -->
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit4</artifactId>
<version>1.1.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting -->
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>5.6.1</version>
</dependency>
```"
Your dependencies are wrong.你的依赖是错误的。 Also note that we don't support old versions any more.
另请注意,我们不再支持旧版本。 I suggest you use the quick-start as it will set up all you need: https://github.com/karatelabs/karate#quickstart
我建议您使用快速入门,因为它将设置您需要的所有内容: https://github.com/karatelabs/karate#quickstart
You can ignore the message about import statements, Karate's version of JS does not need any.您可以忽略有关导入语句的消息,空手道版本的 JS 不需要任何。
If you are still stuck follow this process: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue如果您仍然卡住,请按照以下流程操作: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.