Skip to content

Commit

Permalink
feat: switch to undici and add ava unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Dec 5, 2022
1 parent af46206 commit 56a4f82
Show file tree
Hide file tree
Showing 9 changed files with 632 additions and 57 deletions.
2 changes: 1 addition & 1 deletion src/example.ts → demo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dotenv from 'dotenv-safe'
import { oraPromise } from 'ora'

import { ChatGPTAPI } from './chatgpt-api'
import { ChatGPTAPI } from './src'

dotenv.config()

Expand Down
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,23 @@
"prepare": "husky install",
"pre-commit": "lint-staged",
"test": "run-p test:*",
"test:unit": "ava",
"test:prettier": "prettier '**/*.{js,jsx,ts,tsx}' --check"
},
"dependencies": {
"eventsource-parser": "^0.0.5",
"expiry-map": "^2.0.0",
"node-fetch": "2",
"remark": "^14.0.2",
"strip-markdown": "^5.0.0",
"undici": "^5.13.0",
"uuid": "^9.0.0"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
"@types/node": "^18.11.9",
"@types/node-fetch": "2",
"@types/uuid": "^9.0.0",
"ava": "^5.1.0",
"del-cli": "^5.0.0",
"dotenv-safe": "^8.2.0",
"husky": "^8.0.2",
Expand All @@ -65,6 +67,14 @@
"prettier --write"
]
},
"ava": {
"extensions": {
"ts": "module"
},
"nodeArguments": [
"--loader=tsx"
]
},
"keywords": [
"openai",
"chatgpt",
Expand Down
Loading

0 comments on commit 56a4f82

Please sign in to comment.