Xuanwo commented on code in PR #2969:
URL: 
https://github.com/apache/incubator-opendal/pull/2969#discussion_r1308499470


##########
bindings/nodejs/tests/binding.js:
##########
@@ -75,6 +75,12 @@ Then('The async file {string} must have content {string}', 
async function (path,
   assert(bs.toString() == content)
 })
 
-Then('The presign operation should success or raise exception Unsupported', 
function () {
-  // TODO: please implement me.
+Then('The presign operation should success or raise exception Unsupported', 
async function () {
+  try {
+    await this.op.presignStat('path', 1000)
+    await this.op.presignRead('path', 1000)
+    await this.op.presignWrite('path', 1000)
+  } catch (e) {
+    assert.ok(e.message.includes('Unsupported'))

Review Comment:
   > This is the flexibility of JavaScript. 😢
   
   More like a design issue about napi-rs. JavaScript itself returns error as a 
value instead of string.



##########
bindings/nodejs/tests/binding.js:
##########
@@ -75,6 +75,12 @@ Then('The async file {string} must have content {string}', 
async function (path,
   assert(bs.toString() == content)
 })
 
-Then('The presign operation should success or raise exception Unsupported', 
function () {
-  // TODO: please implement me.
+Then('The presign operation should success or raise exception Unsupported', 
async function () {
+  try {
+    await this.op.presignStat('path', 1000)
+    await this.op.presignRead('path', 1000)
+    await this.op.presignWrite('path', 1000)
+  } catch (e) {
+    assert.ok(e.message.includes('Unsupported'))

Review Comment:
   > This is the flexibility of JavaScript. 😢
   
   More like a design issue about napi-rs. JavaScript itself returns error as a 
value instead of string.



-- 
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]

Reply via email to