mirror of https://github.com/langgenius/dify.git
feat: setup test env
This commit is contained in:
parent
c6cc1b43c7
commit
c614daae54
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"presets": ["@babel/preset-env"]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
'use strict';
|
import axios from 'axios'
|
||||||
const axios = require('axios');
|
|
||||||
|
|
||||||
const BASE_URL = 'https://api.dify.ai/v1';
|
const BASE_URL = 'https://api.dify.ai/v1'
|
||||||
|
|
||||||
const routes = {
|
const routes = {
|
||||||
application: {
|
application: {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,14 @@
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest"
|
"test": "jest",
|
||||||
|
"test:coverage": "jest --coverage",
|
||||||
|
"test:watch": "jest --watchAll"
|
||||||
|
},
|
||||||
|
"jest": {
|
||||||
|
"transform": {
|
||||||
|
"^.+\\.[t|j]sx?$": "babel-jest"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.3.5"
|
"axios": "^1.3.5"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { LangGeniusClient } from '../index';
|
import { LangGeniusClient } from "..";
|
||||||
|
|
||||||
describe('LangGeniusClient', () => {
|
describe('Client', () => {
|
||||||
it('should be defined', async () => {
|
test('should create a client', () => {
|
||||||
const client = new LangGeniusClient('your-api-key');
|
const client = new LangGeniusClient('test');
|
||||||
expect(client).toBeDefined();
|
expect(client).toBeDefined();
|
||||||
});
|
})
|
||||||
});
|
});
|
||||||
Loading…
Reference in New Issue