cloudfunctions/SegmentPortraitPic/node_modules/tencentcloud-sdk-nodejs/test/tmt.v20180321.test.js
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
const expect = require("chai").expect
const tencentcloud = require("../../tencentcloud-sdk-nodejs")
const client = new tencentcloud.tmt.v20180321.Client({
credential: {
secretId: process.env.secretId,
secretKey: process.env.secretKey,
},
region: "ap-shanghai",
profile: {
signMethod: "TC3-HMAC-SHA256",
httpProfile: {
reqMethod: "POST",
reqTimeout: 30,
endpoint: "cvm.ap-shanghai.tencentcloudapi.com",
},
},
})
describe("tmt.v20180321.test.js", function () {
it("tmt.v20180321.TextTranslate", async function () {
try {
const data = await client.TextTranslate({})
expect(data).to.be.ok
} catch(error) {
expect(error.requestId).to.be.ok
expect(error.code).to.be.ok
}
})
it("tmt.v20180321.ImageTranslate", async function () {
try {
const data = await client.ImageTranslate({})
expect(data).to.be.ok
} catch(error) {
expect(error.requestId).to.be.ok
expect(error.code).to.be.ok
}
})
it("tmt.v20180321.SpeechTranslate", async function () {
try {
const data = await client.SpeechTranslate({})
expect(data).to.be.ok
} catch(error) {
expect(error.requestId).to.be.ok
expect(error.code).to.be.ok
}
})
it("tmt.v20180321.TextTranslateBatch", async function () {
try {
const data = await client.TextTranslateBatch({})
expect(data).to.be.ok
} catch(error) {
expect(error.requestId).to.be.ok
expect(error.code).to.be.ok
}
})
后面还有 11 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
