You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2023/03/17 09:24:16 UTC

[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #1661: feat(bindings/nodejs): Migrate to BDD test

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


##########
bindings/nodejs/tests/binding.js:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const assert = require('assert')
+const { Operator } = require('../index.js')
+const { Given, When, Then, } = require('@cucumber/cucumber')
+
+Given('A new OpenDAL Blocking Operator', () => {
+    this.op = new Operator("memory")
+});
+
+When('Blocking write path {string} with content {string}', (path, content) => {
+    this.op.writeSync(path, content)
+});
+
+Then('The blocking file {string} should exist', (path) => {
+    this.op.statSync(path)
+});
+
+Then('The blocking file {string} entry mode must be file', (path) => {
+    let meta = this.op.statSync(path);
+    assert(meta.isFile())
+});
+
+Then('The blocking file {string} content length must be "{int}"', (path, size) => {
+    let meta = this.op.statSync(path);

Review Comment:
   How about setting up a formatter and integrating it into the CI in another pull request? Reviewing format-related issues can be tedious.



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org