         task.resolve(nil)
         task.continueWith { context in
             continued = true
-        }
-        task.waitUntilCompleted()
+        }.waitUntilCompleted()
         XCTAssertTrue(continued, "continuation closure should run.")
     }
 

                XCTFail("previous result shoule be String.")
            }
            return nil
        }
        
        task.waitUntilCompleted()
    }
    
    func testRejectShouldCauseError() {

                XCTFail("previous result shoule be Int.")
            }
            return nil
        }.waitUntilCompleted()
    }
    
    func testReturnValueShouldBeResult() {
