没有定义BeforeAll(老茉莉) [英] BeforeAll is not defined (old jasmine)

查看:192
本文介绍了没有定义BeforeAll(老茉莉)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚安装了量角器V2.0.0 。我试图 beforeAll 添加到测试,并得到误差

I just installed Protractor v2.0.0. I tried to add beforeAll to a test and got error

的ReferenceError:未定义beforeAll

ReferenceError: beforeAll is not defined

综观堆栈跟踪我看到茉莉1.3.1量角器是一个子模块:

Looking at the the stacktrace I see jasmine 1.3.1 is a submodule of protractor:

C:\\Users\\bmackey\\AppData\\Roaming\
pm\
ode_modules\\protractor\
ode_modules\\minijasminenode\\lib\\jasmine-1.3.1.js:913:21

C:\Users\bmackey\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:913:21

beforeAll 在茉莉花2.1引入的。我试图 NPM我-g茉莉花之前,所有无济于事。我怎样才能得到这个功能工作?

beforeAll is introduced in jasmine 2.1. I tried npm i -g jasmine-before-all to no avail. How can I get this functionality to work?

推荐答案

量角器依然采用 jasmine1 默认情况下。你必须在你的配置设置茉莉版

Protractor is still using jasmine1 by default. You have to set jasmine version in your config

framework: 'jasmine2',

您可以找到参考配置文件中

这篇关于没有定义BeforeAll(老茉莉)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆