0

我正在尝试使用 friby.js 和 Jasmine 在 Enide Studio 上运行休息 API 测试。

我收到了这个错误:

C:\Users\xxxx\AppData\Roaming\npm\node_modules\frisby\lib\frisby.js:1125
jasmine.Matchers.prototype.toMatchOrBeNull = function(expected) {
^
ReferenceError: jasmine is not defined
    at Object.<anonymous> (C:\Users\xxxx\AppData\Roaming\npm\node_modules\frisby\lib\frisby.js:1125:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Users\xxxx\Desktop\Enide-Studio-2014.17-luna-SR1-win64\ws\SampleProject\.settings\sample_spec.js:4:12)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

我在记事本中尝试了相同的脚本并使用 CLI 运行,它运行良好。

请帮助我,因为我需要在 IDE 上运行它。

4

1 回答 1

1

I had similar problem after migrating to Jasmine 2.x. It became obvious that 2.x is currently not supported in Frisby. Although, a frisby fork at https://github.com/m0x72/frisby solves this probelem.

cd node_modules
git clone https://github.com/m0x72/frisby.git
npm install qs
npm install jsonschema
npm install stack-trace

You may include it in your test file as follows:

// var frisby = require('frisby');
var frisby = require('frisby-master');
于 2015-07-27T22:40:52.590 回答