Unit tests for lib/index.js