change tap to nodeunit and add test coverage