gpt4 book ai didi

testing - casperjs 测试 cow-test.js 未定义不是评估 casper.test.begin 的函数

转载 作者:行者123 更新时间:2023-11-28 19:50:58 25 4
gpt4 key购买 nike

我正在使用 Windows。我正在尝试使用 CasperJS 测试框架。

我正在使用 phantomjs 版本 1.9.0。我正在使用 casperjs 版本 1.0.2。

当我运行时

casperjs test cow-test.js

返回以下内容。

Test file: cow-test.js
FAIL TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')
# type: uncaughtError
# error: "TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')"
TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')
C:/cow-test.js:16
FAIL 1 tests executed in 0.116s, 0 passed, 1 failed.

Details for the 1 failed test:

In cow-test.js:0
uncaughtError: TypeError: 'undefined' is not a function
(evaluating 'casper.test.begin')
var cow = {};
test.assert(cow);
test.done();
})')

如果我这样做

console.log(casper.test);

返回以下内容

[object Object]

如果我这样做

console.log(casper.test.begin);

返回以下内容。

undefined

我该怎么办?我应该从特定目录运行“casperjs test cow-test.js”吗?

或者,别的什么?

谢谢,安德烈Andre_Mikulec@Hotmail.com

最佳答案

您使用稳定版的 casperjs,而网站上的文档和代码用于开发 version 1.1

关于testing - casperjs 测试 cow-test.js 未定义不是评估 casper.test.begin 的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17913516/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com