rvagg/learnyounode — pull request #61 by ThibWeb (2013-12-24 08:07:59+00:00)
Title: Add test case from make_it_modular to filtered_ls

Here is a (really) small PR.

I was struggling to pass the `make_it_modular` challenge because it states that _"This problem is the same as the previous but introduces the concept of modules."_ and my program had a bug which was not reported in `filtered_ls`. I just added the right test case (one more file named like the tested file extension, `dat`) to make it fail in `filtered_ls` too.

Here is an extract of the solution that was passing in `filtered_ls` but not in `make_it_modular`:

files.forEach(function (file) {
if (file.split('.').pop() === extension) {
console.log(file);
}
});

If `file === extension`, then `file.split('.').pop() === extension` and this solution fails.

It failed only in `make_it_modular` because the test cases where:

files = [
'learnyounode.dat'
, 'learnyounode.txt'
, 'learnyounode.sql'
, 'api.html'
, 'README.md'
, 'CHANGELOG.md'
, 'LICENCE.md'
, 'md'
, 'data.json'
, 'data.dat'
, 'words.dat'
, 'w00t.dat'
, 'w00t.txt'
, 'wrrrrongdat'
]