Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
add testing
Browse files Browse the repository at this point in the history
  • Loading branch information
patcher9 committed Mar 8, 2024
1 parent 1d995a6 commit 36b2e5f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"stream": "^0.0.2"
},
"devDependencies": {
"@anthropic-ai/sdk": "^0.17.1",
"chai": "^5.0.3",
"cohere-ai": "^7.7.3",
"eslint": "^8.56.0",
Expand Down
20 changes: 20 additions & 0 deletions tests/anthropic.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Anthropic from '@anthropic-ai/sdk';
import {expect} from 'chai';
import DokuMetry from '../src/index.js';

describe('Anthropic Test', () => {
const anthropic = new Anthropic({
apiKey: process.env.ANTHROPIC_API_TOKEN,
});

it('should return a response with type as "message"', async () => {
DokuMetry.init({llm: anthropic, dokuUrl: process.env.DOKU_URL, apiKey: process.env.DOKU_TOKEN, environment: "dokumetry-testing", applicationName: "dokumetry-node-test", skipResp: false});
const message = await anthropic.messages.create({
model: "claude-3-opus-20240229",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello, Doku!" }],
});

expect(message.type).to.equal('message');
}).timeout(10000);
});

0 comments on commit 36b2e5f

Please sign in to comment.