openai-api-mock 0.1.25 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/test.yml +6 -3
- package/{readme.md → README.md} +7 -0
- package/dist/index.cjs +2265 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +2265 -0
- package/dist/index.js.map +1 -0
- package/jest.config.js +2 -2
- package/package.json +15 -6
- package/src/index.js +3 -5
- package/vite.config.js +37 -0
|
@@ -12,7 +12,7 @@ jobs:
|
|
|
12
12
|
|
|
13
13
|
strategy:
|
|
14
14
|
matrix:
|
|
15
|
-
node-version: [
|
|
15
|
+
node-version: [18.x, 20.x]
|
|
16
16
|
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@v4
|
|
@@ -26,5 +26,8 @@ jobs:
|
|
|
26
26
|
- name: Install dependencies
|
|
27
27
|
run: npm ci
|
|
28
28
|
|
|
29
|
-
- name:
|
|
30
|
-
run: npm
|
|
29
|
+
- name: Build package
|
|
30
|
+
run: npm run build
|
|
31
|
+
|
|
32
|
+
- name: Run tests
|
|
33
|
+
run: npm test
|
package/{readme.md → README.md}
RENAMED
|
@@ -23,8 +23,15 @@ npm install -D openai-api-mock
|
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Usage
|
|
26
|
+
|
|
27
|
+
The module supports both ESM and CommonJS imports:
|
|
28
|
+
|
|
26
29
|
```js
|
|
30
|
+
// ESM
|
|
27
31
|
import { mockOpenAIResponse } from 'openai-api-mock';
|
|
32
|
+
|
|
33
|
+
// CommonJS
|
|
34
|
+
const { mockOpenAIResponse } = require('openai-api-mock');
|
|
28
35
|
```
|
|
29
36
|
|
|
30
37
|
Then, call the mockOpenAIResponse function to set up the mock response:
|