Port code grant parsing test cases to Mocha.