tools
- Linux ubuntuG5 3.13.0-48-powerpc64-smp
- node.js v0.10.38
- zombie Version 3.1.0 2015-03-15
- jasmine-node 1.14.3
sample_zombie_spec.js
var Browser, assert, browser, url, title;
assert = require('assert');
Browser = require('zombie');
var google = "https://google.com"
var google_title = "Google"
url = google
title = google_title
browser = new Browser();
describe('home page', function() {
describe('title', function() {
it('should have a title', function(done) {
browser.visit(url).then(function() {
assert.equal(browser.text('title'), title);
done();
}).fail(function(err) {
console.log('Failed with error: ', error);
done(err);
});
});
});
});
This file is in spec/
so I ran the following command:
jasmine-node spec/
Results:
F
Failures:
1) home page title should have a title
Message:
TypeError: Object [object Promise] has no method 'fail'
Stacktrace:
TypeError: Object [object Promise] has no method 'fail'
at null.<anonymous> (/home/dmmmd/Dropbox/node_js_projects/affinity-zombie/spec/sample_zombie_spec.js:21:12)
at null.<anonymous> (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/async-callback.js:45:37)
at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
Finished in 0.12 seconds
1 test, 1 assertion, 1 failure, 0 skipped
I tried the exact same thing on a different machine:
tools
- Darwin 14.3.0 Darwin Kernel Version 14.3.0
- io.js v1.8.1
- zombie Version 4.0.7 2015-04-10
- jasmine-node 1.14.3
Results:
F
Failures:
1) home page title should have a title
Message:
TypeError: undefined is not a function
Stacktrace:
TypeError: undefined is not a function
at null.<anonymous> (/Users/dmmmd/Dropbox/node_js_projects/spec/sample_zombie_spec.js:21:12)
at null.<anonymous> (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/async-callback.js:45:37)
at Timer.listOnTimeout (timers.js:89:15)
Finished in 0.069 seconds
1 test, 1 assertion, 1 failure, 0 skipped
I tried some other urls, too, even localhost ones without any success.
JavaScript, node.js, io.js, zombie, and jasmine are all new to me so I am basically just following recipes from the documentation and stackoverflow questions. I would appreciate any suggestions. I suspect I am missing something very simple.
Thanks.