Skip to content

Object methods, "this": Missing appropriate tests for chaining exercise #2826

@Omid-Heydarzadeh

Description

@Omid-Heydarzadeh

Article

Object methods, "this"

There are missing tests for the "chaining" exercise on the "Object methods, this" article to ensure that the showStep method returns this.

Suggested tests:

 it('showStep() should return this', function() {
   assert(ladder.showStep(), ladder);
 });

 it('up().up().down().showStep().down().showStep()', function () {
   assert.equal(ladder.up().up().down().showStep().down().showStep().step, 0)
 })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions