lambder 1.0.129 → 1.0.131

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.
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Example test file demonstrating MSW integration with Lambder
3
+ *
4
+ * To run this test:
5
+ * 1. Install MSW: npm install --save-dev msw
6
+ * 2. Remove the .skip from test cases
7
+ * 3. Run: npm test
8
+ *
9
+ * This file is skipped by default since MSW is an optional dependency
10
+ */
11
+
12
+ import { describe, it, expect } from 'vitest';
13
+ import type { ApiContractShape } from '../src/index.js';
14
+
15
+ // Define test API contract
16
+ const testApiContract = {
17
+ 'test.echo': {
18
+ input: { message: '' as string },
19
+ output: { echo: '' as string }
20
+ },
21
+ 'test.add': {
22
+ input: { a: 0 as number, b: 0 as number },
23
+ output: { result: 0 as number }
24
+ },
25
+ 'test.getUser': {
26
+ input: { userId: '' as string },
27
+ output: { id: '' as string, name: '' as string }
28
+ }
29
+ } satisfies ApiContractShape;
30
+
31
+ type TestApiContract = typeof testApiContract;
32
+
33
+ describe('Lambder MSW Integration (Requires MSW to be installed)', () => {
34
+ it('should verify MSW utilities are exported', async () => {
35
+ // This test just verifies the exports exist
36
+ // Actual MSW functionality requires MSW to be installed
37
+ const lambder = await import('../dist/index.js');
38
+
39
+ expect(lambder.mockLambderApi).toBeDefined();
40
+ expect(lambder.mockLambderApiError).toBeDefined();
41
+ expect(lambder.mockLambderSessionExpired).toBeDefined();
42
+ expect(lambder.mockLambderNotAuthorized).toBeDefined();
43
+ expect(lambder.mockLambderVersionExpired).toBeDefined();
44
+ });
45
+ });