Open myndzi opened 8 years ago
mmm... I like it! Can you change the package.json file in the test folder to either be blank "{}" or remove it altogether. Since the data is being supplied within the test already, it's best not to have a redundant copy.
That confused me for a while. I don't know why the file exists if its contents are ignored. I'd rather NOT mock the data and access the real file than have an ignored file.. what do you think?
The tests are already written with mocks in place... the file is there for the existence check.
Seems like it makes sense to just read the file and skip the entire mocking step tbh, but I'll update it.
The problem then is that you have to have a test file and directory for each test case. You would also then have to read each file to see what the test is actually looking for. With the tests mocked as they are currently, the tests are readable from within the test script itself instead across a variety of files.
Well, if the goal is to not perform integration tests against the file system and fs module, you're probably best off mocking the entire fs portion instead of half-mocking it and having directories laying about. But that's a change for a different PR.
Mmmm... now I'm not sure how to deal with the scoring on this.
I'm thinking that it should probably wrapped up into one test, which checks for the existance of "directories.test" or "./test/".
This PR includes a merge from https://github.com/konobi/kwalitee/pull/17 since the tests wouldn't pass without it.