jasmine-node

Jenkins jasmine-node command not found

别等时光非礼了梦想. 提交于 2020-01-06 11:34:28
问题 I am trying to configure Jenkins to be used for my team which works on node.js projects. We used jasmine-node for most of our projects. I have a jenkins instance managed by another group in the org which recognizes node and npm. I ran 'npm install -g jasmine-node' as one of the Jenkins job and the coonsole output says it is successfull: Building on master in workspace C:\.jenkins\workspace\ttm-closr > git rev-parse --is-inside-work-tree Fetching changes from the remote Git repository > git

node js unit testing: mocking require dependency

倖福魔咒の 提交于 2020-01-02 02:47:05
问题 I am having issues writing unit test for the following setup as a jira.js file (in a node.js module): var rest = require('restler'); // https://www.npmjs.com/package/restler module.exports = function (conf) { var exported = {}; exported.getIssue = function (issueId, done) { ... rest.get(uri).on('complete', function(data, response) { ... }; return exported; }; Now, i want to write unit test for my getIssue function. 'restler' is a REST client through which i make REST calls to the JIRA API to

how to mock/stub a node.js module

自作多情 提交于 2019-12-24 23:43:53
问题 I'm working on some code to run on RaspberryPi, and I'm using the Wiring-Pi node module. I have two problems 1) Wiring-Pi won't build on x86 platforms 2) Node-jasmine won't build on RaspberryPi So, after playing around with a bunch of different ideas, I'm wondering if I'm best off to mock or stub the Wiring-Pi module when on x86 platforms, so I can run the tests. Of course, my problem is that the file I'm testing includes the require statment // getters.js var wpi = require('wiring-pi'); //

Property 'jasmineMatches' is missing in type 'x'

≯℡__Kan透↙ 提交于 2019-12-24 08:57:47
问题 After ng test Expected output: i get pass/fail on x amount of tests. Actual ouput: ERROR in src/app/todo-data.service.spec.ts(19,45): error TS2345: Argument of type 'Todo[]' is not assignable to parameter of type 'Expected<Observable<Todo[]>>'. Type 'Todo[]' is not assignable to type 'ObjectContaining<Observable<Todo[]>>'. Property 'jasmineMatches' is missing in type 'Todo[]'. In my todo class i don't have a jasminematches property, but this might not be the root problem. todo.ts: export

No output from jasmine-node

£可爱£侵袭症+ 提交于 2019-12-22 10:53:42
问题 I'm new to JavaScript, Node.js and jasmine. I'm trying to run a test from the book "The Node Craftsman Book", FilesizeWatcher. I've created the package.json file and run "npm install", thus installing jasmine-node locally to the project. When I run jasmine-node on the spec file I see only output from console.log but nothing from jasmine. I can see from console.log statements that calls to jasmine (e.g. expect(err).toBe("Path does not start with a slash");) are made, but there is no output.

How do you force the absolute path for node modules?

試著忘記壹切 提交于 2019-12-19 09:07:30
问题 I have a Titanium project which uses the CommonJS module style. However the code uses absolute paths so that when it builds the absolute path is sandboxed to the application directory. var foo = require("/lib/module"); I want to run some tests on the command line and have jasmine-node working. However when a test executes a module the module will have the above absolute paths in their require statements. Is there a way to isolate (maybe chroot) node to resolve absolute require paths to a

Closing an express server after running jasmine specs

被刻印的时光 ゝ 提交于 2019-12-13 13:31:15
问题 I am trying to set up jasmine testing of my express server. I am spinning up a new server with each spec and trying to shut it down after each spec completes. Unfortunately, the server doesn't seem to be shutting down... making running more than one spec impossible. server.js: var app = require('express')(); exports.start = function(config){ if(!this.server){ app.get('/', function(req, res){ res.status(200); res.end(); }) this.server = app.listen(config.port, function(){ console.log('Server

jasmine is not defined

我们两清 提交于 2019-12-13 05:44:42
问题 I am trying to run a rest API test on Enide Studio using friby.js and Jasmine. I got this error: 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

No output from jasmine-node on FilesizeWatcherSpec - Newbie Alert

♀尐吖头ヾ 提交于 2019-12-13 04:25:12
问题 I'm new to Node.js and jasmine, and my JavaScript experience is old and rusty, so I'm a newbie there too. I finished Manuel Kiessling's book, The Node Beginner Book , and I am working my way through his second book, The Node Craftsman Book . I'm stuck on the FilesizeWatcher tutorial. I've been able to run earlier tests but this one is not working. There is a similar question on SO: No output from jasmine-node but the answer isn't working for me. I'll post my code here and hopefully somebody

“No spec found” is displayed after I use one jasmine reporter

社会主义新天地 提交于 2019-12-13 03:13:57
问题 I am using jasmine-node framework for my API automation. I am able to run REST services and able to get the result using node-fetch or http. Without reporter when I run with the below command I was able to get the results in console jasmine spec/xxx.spec.js After that I added a reporter(pretty html reporter) for reporting. Now when I run those commands, I get the below error. No specs found Below are my code for reporter.js var Jasmine = require('jasmine'); var HtmlReporter = require('jasmine