modelmix 3.8.0 → 3.8.4

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,73 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * ModelMix Test Runner
5
+ *
6
+ * This is the main entry point for running the comprehensive test suite.
7
+ * It includes tests for:
8
+ * - JSON schema generation and structured outputs
9
+ * - Provider fallback chains
10
+ * - Different providers (OpenAI, Anthropic, Google, etc.)
11
+ * - File operations and template system
12
+ * - Image processing and multimodal support
13
+ * - MCP (Model Context Protocol) integration
14
+ * - Rate limiting with Bottleneck
15
+ * - Integration tests and edge cases
16
+ */
17
+
18
+ const { spawn } = require('child_process');
19
+ const path = require('path');
20
+
21
+ const testFiles = [
22
+ 'json.test.js',
23
+ 'fallback.test.js',
24
+ 'templates.test.js',
25
+ 'images.test.js',
26
+ ];
27
+
28
+ console.log('🧬 ModelMix Test Suite Runner');
29
+ console.log('==============================');
30
+ console.log(`Running ${testFiles.length} test suites...\n`);
31
+
32
+ function runTests() {
33
+ const args = [
34
+ '--timeout', '10000',
35
+ '--recursive',
36
+ 'test/**/*.test.js'
37
+ ];
38
+
39
+ const child = spawn('npx', ['mocha', ...args], {
40
+ cwd: process.cwd(),
41
+ stdio: 'inherit'
42
+ });
43
+
44
+ child.on('close', (code) => {
45
+ if (code === 0) {
46
+ console.log('\nāœ… All tests passed!');
47
+ console.log('\nTest Coverage:');
48
+ console.log('- āœ… JSON Schema Generation');
49
+ console.log('- āœ… Provider Fallback Chains');
50
+ console.log('- āœ… Multiple Providers (OpenAI, Anthropic, Google, etc.)');
51
+ console.log('- āœ… File Operations & Templates');
52
+ console.log('- āœ… Image Processing & Multimodal');
53
+ console.log('- āœ… MCP Integration');
54
+ console.log('- āœ… Rate Limiting with Bottleneck');
55
+ console.log('- āœ… Integration & Edge Cases');
56
+ } else {
57
+ console.error(`\nāŒ Tests failed with exit code ${code}`);
58
+ process.exit(code);
59
+ }
60
+ });
61
+
62
+ child.on('error', (err) => {
63
+ console.error('āŒ Failed to start test runner:', err);
64
+ process.exit(1);
65
+ });
66
+ }
67
+
68
+ // Run the tests
69
+ if (require.main === module) {
70
+ runTests();
71
+ }
72
+
73
+ module.exports = { runTests, testFiles };