Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 使用jasmine测试节点幻影脚本_Node.js_Unit Testing_Jasmine_Phantomjs - Fatal编程技术网

Node.js 使用jasmine测试节点幻影脚本

Node.js 使用jasmine测试节点幻影脚本,node.js,unit-testing,jasmine,phantomjs,Node.js,Unit Testing,Jasmine,Phantomjs,使用jasmine测试嵌套异步phantomjs脚本的最佳方法是什么。我已经尝试过使用spyOn和一个异步请求,效果很好。但是如何测试嵌套。我使用的是节点幻影,有下面的页面结构。我想用茉莉花来测试一下 phantom.create(function(ph){ ph.createPage(function (page){ page.onConsoleMessage(function(msg){ ... }); page.open(config[server

使用jasmine测试嵌套异步phantomjs脚本的最佳方法是什么。我已经尝试过使用spyOn和一个异步请求,效果很好。但是如何测试嵌套。我使用的是节点幻影,有下面的页面结构。我想用茉莉花来测试一下

 phantom.create(function(ph){
  ph.createPage(function (page){
   page.onConsoleMessage(function(msg){
       ...

   });

   page.open(config[server].script_url, function(status){
       ......

   });