Update index.js

Add test for empty file. On failure, test will timeout waiting for close event. On success, close event will be called for empty file.