Skip to content

Commit 2c84306

Browse files
committed
add test
1 parent eab3c70 commit 2c84306

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

playground/javascript/node/recommend.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const searchQuery = process.env.SEARCH_QUERY || 'test_query';
1010
// Init client with appId and apiKey
1111
const client = recommendClient(appId, apiKey);
1212

13-
async function testRecommend() {
13+
async function testGetRecommendations() {
1414
try {
1515
const res = await client.getRecommendations({
1616
requests: [
@@ -23,14 +23,20 @@ async function testRecommend() {
2323
],
2424
});
2525

26-
console.log(`[OK]`, res);
26+
console.log('[OK] GetRecommendations', res);
2727
} catch (e) {
2828
if (e instanceof ApiError) {
2929
return console.log(`[${e.status}] ${e.message}`, e.stackTrace);
3030
}
3131

32-
console.log('[ERROR]', e);
32+
console.log('[ERROR] GetRecommendations', e);
3333
}
3434
}
3535

36+
37+
38+
async function testRecommend() {
39+
await testGetRecommendations();
40+
}
41+
3642
testRecommend();
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[
2+
{
3+
"testName": "batch recommend rules",
4+
"parameters": {
5+
"indexName": "indexName",
6+
"model": "related-products"
7+
},
8+
"request": {
9+
"path": "/1/indexes/indexName/related-products/recommend/rules/batch",
10+
"method": "POST",
11+
"body": {
12+
"rules": []
13+
}
14+
}
15+
}
16+
]

0 commit comments

Comments
 (0)