Skip to content

Test file #18

Description

@jema28
  1. Please write helpful messages in the test: change "xd" and "33333333333sortTodos" in each test.
    t.deepEqual(actual,expected,"xd");
  2. Why are you doing logic in the test? And what do v and b mean? Please make sure you're writing semantically.

    toDoApp/test.js

    Lines 70 to 89 in 3766fb0

    test('sortTodos', function(t) {
    var a = [
    { id: -1, description: 'third todo', done:true },
    { id: -2, description: 'second todo', done:true },
    { id: 0, description: 'zero todo', done:false },
    ];
    var v=logic.sortTodos(a,function(a, b){return a['description'] > b['description']});
    var b = [
    { id: -2, description: 'second todo', done:true },
    { id: -1, description: 'third todo', done:true },
    { id: 0, description: 'zero todo' , done:false},
    ];
    console.log(a[0]['description']+"\n");
    console.log(b[0]['description']+"\n");
    console.log(v[0]['description']+"\n");
    t.deepEqual(v,b,"33333333333sortTodos");
    t.end();
    });
  3. Delete console.logs.
  4. Please fix indentation in the file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions