Skip to content

MAKE IT MODULAR another verify error #537

Description

@locdoan12121997

I'm getting an error when verifying the "Make It Modular" exercise.

Here's my make-it-modular.js:

var fs = require('fs');
var path = require('path');

module.exports = function (dir, ext,callback){
  fs.readdir(dir,function(err,list){
    if (err)
      return callback(err);
    for (var i = 0; i< list.length; i++){
      if (path.extname(list[i]) === ('.'+ext))
        callback(list[i]);
    }
  })
}

My module named filtered-ls1.js:

var mymodule = require('./make-it-modular.js');
mymodule(process.argv[2], process.argv[3],console.log);

And here's the output when I run learnyounode verify make_it_modular.js:

Your submission results compared to the expected:

                 ACTUAL                                 EXPECTED
────────────────────────────────────────────────────────────────────────────────

   "CHANGELOG.md"                      ==    "CHANGELOG.md"
   "LICENCE.md"                        ==    "LICENCE.md"
   "README.md"                         ==    "README.md"
   ""                                  ==    ""

────────────────────────────────────────────────────────────────────────────────

 ✓

 Submission results match expected

 ✓

 Additional module file exports a single function

 ✓

 Additional module file exports a function that takes 3 arguments

 ✓

 Additional module file handles errors properly

 ✓

 Additional module file handles callback argument

C:\Users\win\AppData\Roaming\npm\node_modules\learnyounode\node_modules\workshopper-exercise\exercise.js:188
    processors[i].call(self, mode, function (err, pass) {
                 ^

TypeError: Cannot read property 'call' of undefined
    at next (C:\Users\win\AppData\Roaming\npm\node_modules\learnyounode\node_modules\workshopper-exercise\exercise.js:188:18)
    at C:\Users\win\AppData\Roaming\npm\node_modules\learnyounode\node_modules\workshopper-exercise\exercise.js:195:7
    at callback (C:\Users\win\AppData\Roaming\npm\node_modules\learnyounode\exercises\make_it_modular\verify.js:26:15)
    at modFileError (C:\Users\win\AppData\Roaming\npm\node_modules\learnyounode\exercises\make_it_modular\verify.js:31:5)
    at C:\Users\win\AppData\Roaming\npm\node_modules\learnyounode\exercises\make_it_modular\verify.js:119:18
    at C:\Users\win\Desktop\Node js\Nodeschool\learnyounode\make-it-modular.js:9:9
    at FSReqWrap.oncomplete (fs.js:123:15)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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