是否可以为自定义客户端JavaScript创建和运行测试套件,而不是作为Node模块创建?那么配置应该如何改变呢?
如果我做对了,Intern配置中有一个loader部分,指定要加载的包.是否有必要以某种方式包含我的自定义JS代码?
我应该把我的测试套件放在哪里,当它们不属于任何Node包时,它们应该是什么样子,再次只是我的自定义JS代码.换句话说,我将如何"加载"并运行它们?
我试图以某种方式使它工作,而我对Node没有经验.我的尝试是这样的:
$ node client.js config=tests/js/intern
Defaulting to "console" reporter
Run Code Online (Sandbox Code Playgroud) 异步测试如何在实习测试框架中工作?我试图让它们像在示例中一样运行,但异步测试立即通过而不等待回调运行.
it('should connect in 5 seconds', function () {
var dfd = this.async(5000);
conn.connect(credentials, dfd.callback(function(result) {
expect(result).to.... something
}));
}
Run Code Online (Sandbox Code Playgroud)
测试立即通过.我究竟做错了什么?
Intern.js是一个伟大的测试人员,但它似乎只适用于SauceLabs.我的公司已经使用了BrowserStack并且非常满意.我想知道是否有人能够将Intern.js与BrowserStack集成,如果是这样的话怎么样?
我知道 String.intern() 将字符串添加到池中,如果它不包含对象,但如何解释结果。
下面的代码:
public static void main(String[] args) {
char[] abc = new char[]{'a','b','c'};
String str = new String(abc);
System.out.println(str == "abc");
str.intern();
System.out.println(str == "abc");
}
Run Code Online (Sandbox Code Playgroud)
输出是:
错误的
错误的
但是当代码如下:
public static void main(String[] args) {
char[] abc = new char[]{'a','b','c'};
String str = new String(abc);
str.intern();
System.out.println(str == "abc");
}
Run Code Online (Sandbox Code Playgroud)
输出是:
真的
有什么不同。
实习生使用requireJs来加载测试吗?我正在使用这种方法模拟我想测试的模块的依赖关系,所以我想知道这是否也适用于Intern.
我有一个大型项目,我正在编写实习测试,我能够为自己的软件包生成90%以上的覆盖率,但报告的覆盖范围远低于此,因为其他软件包(如dojo,dijit等)也正在包含在报告总数中.
是否有"开箱即用"的实习方式从报道报告中排除文件?
伊斯坦布尔支持"排除模式",是否只是编写另一个自定义实习记者来配置排除?
我该如何模拟此功能?这似乎是一种有意识的选择,WaitForDeletedById而不是反过来.
在ajax加载时,我如何等待页面上存在新元素,而不是缺少一个元素?
我正在尝试使用Intern测试框架来自动测试使用node.js和StrongLoop实现的简单REST API.StrongLoop提供了一个资源管理器网页,我用它来验证REST API是否已实现,我可以手动测试Postman的API.
我尝试使用intern.js的第一个API测试检索集合中的媒体对象的数量.HTTP方法是GET,URL是http://localhost:3000/api/media/count,响应是{"count":2}.
当我运行我的intern.js测试时,我收到错误"错误:尝试要求卸载模块http".
我在node.js应用程序中有一个\ tests子目录.我的测试用例是media.js:
define([
'intern!object',
'intern/chai!assert'
], function (registerSuite, assert, media) {
registerSuite({
name: 'media',
count: function() {
var http = require("http");
var request = http.request;
request({
url: "http://localhost:3000/api/media/count",
method: "GET"
}, function (error, response, body) {
console.log("Status", response.statusCode);
console.log("Headers", JSON.stringify(response.headers));
console.log("Response received", body);
});
assert.strictEqual(body, '{"count": 2}',
url + ' should return 2 items');
}
});
});
Run Code Online (Sandbox Code Playgroud)
我的intern.js配置文件是:
// Learn more about configuring this file at <https://github.com/theintern/intern/wiki/Configuring-Intern>.
// These default settings work OK …Run Code Online (Sandbox Code Playgroud) 在查看Intern.io示例时,我没有遵循路径语法.
例如:
define([
'intern!object',
'intern/chai!assert',
Run Code Online (Sandbox Code Playgroud)
'!'发生了什么事 字符?
// Non-functional test suite(s) to run in each browser
suites: [ 'intern/node_modules/dojo/has!host-browser?tests/utils' ],
Run Code Online (Sandbox Code Playgroud)
有人可以解释套件路径上面的路径参考吗?
谢谢.
我正在努力将我们的单元/功能测试框架切换到实习生,但我尝试的所有不同配置导致实习生只运行单元测试而根本没有完成功能测试.
Selenium Standalone和ChromeDriver确实在4444端口运行.
我有一个配置文件,如下所示:
// Learn more about configuring this file at <https://github.com/theintern/intern/wiki/Configuring-Intern>.
// These default settings work OK for most people. The options that *must* be changed below are the
// packages, suites, excludeInstrumentation, and (if you want functional tests) functionalSuites.
define({
// The port on which the instrumenting proxy will listen
proxyPort: 9000,
// A fully qualified URL to the Intern proxy
proxyUrl: 'http://localhost:9000/',
// Default desired capabilities for all environments. Individual capabilities can be overridden by any …Run Code Online (Sandbox Code Playgroud) intern ×10
javascript ×5
unit-testing ×3
asynchronous ×1
browserstack ×1
java ×1
jvm ×1
mocking ×1
node.js ×1
promise ×1
report ×1
rest ×1
selenium ×1
string ×1