简体   繁体   English

找不到变量:Phantomjs中的Promise

[英]Can't find variable: Promise in Phantomjs

I am writing test cases with Jasmin. 我正在和Jasmin一起编写测试用例。

When I call bellow method, 当我打电话给波纹管方法时,

initialize({"Data": "primary"});

Which is: 这是:

initialize: function(config) {

    console.info("initialize Version 2 initialized..");

    return new Promise(function(resolve, reject) {

    console.info("promise");

    resolve(true);
    });
}

I am getting below error 我收到了以下错误

ReferenceError: Can't find variable: Promise in http://localhost:8080/absolute/home/krushanu/project/krushanu/ekstep/theLib/js-libs/telemetry/telemetry.js?a043c6a23b1af06737d8e1ae1e1c2e152d4faa83

Installed phantom js Version is 2.1.1 安装的幻影js版本是2.1.1

Promise support is not present natively in PhantomJS. PhantomJS本身不存在承诺支持。 See the issue in github here . 在这里查看github中的问题 You could use es6-promise or promise-polyfill to enable Promise support. 您可以使用es6-promise或promise-polyfill来启用Promise支持。 If it is possible, I would recommend migrating to Puppeteer 如果有可能,我会建议迁移到Puppeteer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM