jimexist commented on code in PR #3528:
URL: https://github.com/apache/thrift/pull/3528#discussion_r3295711932
##########
lib/nodets/test/test_driver.ts:
##########
@@ -161,58 +160,58 @@ export function ThriftTestDriverPromise(
);
testCases.deep.forEach(makeAsserter(assert.deepEqual));
- Q.resolve(client.testStruct(testCases.out))
+ Promise.resolve(client.testStruct(testCases.out))
.then(function (response) {
checkRecursively(testCases.out, response, "testStruct");
})
- .fail(fail("testStruct"));
+ .catch(fail("testStruct"));
- Q.resolve(client.testNest(testCases.out2))
+ Promise.resolve(client.testNest(testCases.out2))
.then(function (response) {
checkRecursively(testCases.out2, response, "testNest");
})
- .fail(fail("testNest"));
+ .catch(fail("testNest"));
- Q.resolve(client.testInsanity(testCases.crazy))
+ Promise.resolve(client.testInsanity(testCases.crazy))
.then(function (response) {
checkRecursively(testCases.insanity, response, "testInsanity");
})
- .fail(fail("testInsanity"));
+ .catch(fail("testInsanity"));
- Q.resolve(client.testException("TException"))
+ Promise.resolve(client.testException("TException"))
.then(function (response) {
fail("testException: TException");
})
Review Comment:
Fixed in 7c3f37992: replaced `fail("testException: TException")` (which only
built a callback and never invoked it) with `assert.fail(...)` directly in the
unexpected-resolve branch.
##########
lib/nodets/test/test_driver.ts:
##########
@@ -161,58 +160,58 @@ export function ThriftTestDriverPromise(
);
testCases.deep.forEach(makeAsserter(assert.deepEqual));
- Q.resolve(client.testStruct(testCases.out))
+ Promise.resolve(client.testStruct(testCases.out))
.then(function (response) {
checkRecursively(testCases.out, response, "testStruct");
})
- .fail(fail("testStruct"));
+ .catch(fail("testStruct"));
- Q.resolve(client.testNest(testCases.out2))
+ Promise.resolve(client.testNest(testCases.out2))
.then(function (response) {
checkRecursively(testCases.out2, response, "testNest");
})
- .fail(fail("testNest"));
+ .catch(fail("testNest"));
- Q.resolve(client.testInsanity(testCases.crazy))
+ Promise.resolve(client.testInsanity(testCases.crazy))
.then(function (response) {
checkRecursively(testCases.insanity, response, "testInsanity");
})
- .fail(fail("testInsanity"));
+ .catch(fail("testInsanity"));
- Q.resolve(client.testException("TException"))
+ Promise.resolve(client.testException("TException"))
.then(function (response) {
fail("testException: TException");
})
- .fail(function (err) {
+ .catch(function (err) {
assert.ok(err instanceof TException);
});
- Q.resolve(client.testException("Xception"))
+ Promise.resolve(client.testException("Xception"))
.then(function (response) {
fail("testException: Xception");
})
Review Comment:
Fixed in 7c3f37992: replaced `fail("testException: Xception")` with
`assert.fail(...)` directly so the test now actually fails if the promise
unexpectedly resolves.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]