small medium large xlarge

Baby_wee_apple_ally_pragsmall
27 Jul 2017, 00:51
maki (4 posts)

chapter 3

These tests do not pass with this error
ReferenceError: view is not defined

learnjs/public/tests/app_spec.js

it(‘has a title that includes the problem number’, function() { expect(view.find(‘.title’).text()).toEqual(‘Problem #1’);
});
it(‘shows the description’, function() { expect(view.find(‘[data-name=”description”]’).text()).toEqual(‘What is truth?’);
});
it(‘shows the problem code’, function() {
expect(view.find(‘[data-name=”code”]’).text()).toEqual(‘function problem() { return __; }’);
});

Benrady-avatar_pragsmall
27 Jul 2017, 03:55
Ben Rady (67 posts)

Are you creating the view in a beforeEach section in the test?

Baby_wee_apple_ally_pragsmall
28 Jul 2017, 01:07
maki (4 posts)

No. I don’t have beforeEach section

Benrady-avatar_pragsmall
31 Jul 2017, 12:42
Ben Rady (67 posts)

Well, you’ll need one to create a view that your tests can use. See page 56 for details.

Baby_wee_apple_ally_pragsmall
03 Aug 2017, 01:57
maki (4 posts)

Hi Ben!

The book I am reading is translated into Japanese…. I will search the part of page 56. Thank you

Baby_wee_apple_ally_pragsmall
09 Aug 2017, 01:10
maki (4 posts)

I bought the original version of the book.
I will check the place you taught me

You must be logged in to comment