Added test that function throws errors. Updated package.json