feat: adding test

This commit is contained in:
crazywoola 2023-05-12 11:27:28 +08:00
parent 2a68bfbc84
commit c6cc1b43c7
3 changed files with 21 additions and 4 deletions

View File

@ -1,6 +1,7 @@
import axios from 'axios'
'use strict';
const axios = require('axios');
const BASE_URL = 'https://api.dify.ai/v1'
const BASE_URL = 'https://api.dify.ai/v1';
const routes = {
application: {
@ -31,7 +32,6 @@ const routes = {
method: 'PATCH',
url: (conversationId) => `/conversations/${conversationId}`,
}
}
export class LangGeniusClient {

View File

@ -14,7 +14,16 @@
"<crazywoola> <<427733928@qq.com>> (https://github.com/crazywoola)"
],
"license": "MIT",
"scripts": {
"test": "jest"
},
"dependencies": {
"axios": "^1.3.5"
},
"devDependencies": {
"@babel/core": "^7.21.8",
"@babel/preset-env": "^7.21.5",
"babel-jest": "^29.5.0",
"jest": "^29.5.0"
}
}
}

View File

@ -0,0 +1,8 @@
import { LangGeniusClient } from '../index';
describe('LangGeniusClient', () => {
it('should be defined', async () => {
const client = new LangGeniusClient('your-api-key');
expect(client).toBeDefined();
});
});