looks `resolve` is a dulicate function for each test case, we should extract to a function and put on top of this file.