openai-api-mock 0.1.25 → 0.1.26

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.
@@ -12,7 +12,7 @@ jobs:
12
12
 
13
13
  strategy:
14
14
  matrix:
15
- node-version: [16.x, 18.x, 20.x]
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: Run tests
30
- run: npm test
29
+ - name: Build package
30
+ run: npm run build
31
+
32
+ - name: Run tests
33
+ run: npm test
@@ -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: