EthanRBrown / web-development-with-node-and-express

Companion repository to Web Development With Node and Express, first edition.
1.02k stars 502 forks source link

Zombie.js on book's version was deprecated ? #80

Closed ghost closed 8 years ago

ghost commented 8 years ago

In this book, Zombie.js is used like below

var Browser = require('zombie'),
    assert = require('chai').assert;

var browser;

suite('Cross-Page Tests', function () {
  setup( function () {
  browser = new Browser();
});

test('requesting a group rate from the hood river tour page' +
  'should populate the referrer field', function ( done ) {
    var referrer = 'http://localhost:3000/tours/hood-river';
    browser.visit(referrer, function () {
      browser.clickLink('.requestGroupRate', function () {
        assert(browser.field('referrer').value === referrer);
        done();
      });
    });
});
....

It's result should be 2 passing 1 failing, but the result is 3 failing. Maybe there aren't syntax error of my source.

So, I saw the documentation of zombie.js There are outstanding difference of syntax followed by

describe('submits form', function() {

  before(function(done) {
    browser
      .fill('email',    'zombie@underworld.dead')
      .fill('password', 'eat-the-living')
      .pressButton('Sign Me Up!', done);
  });

  it('should be successful', function() {
    browser.assert.success();
  });
});

It looks like jasmine.

ghost commented 8 years ago

Had an typo sorry