modified find main file pattern to a regex
added mocha test for find main file