Files
homeassistant-mcp/jest.setup.js
jango-blockchained ada5ea4646 Enhance project structure and testing capabilities
- Updated .dockerignore to include additional logs and IDE files, improving Docker build efficiency.
- Added .eslintrc.json for TypeScript linting configuration, ensuring code quality and consistency.
- Refactored Dockerfile to streamline the build process and utilize a slimmer Node.js image.
- Introduced jest-resolver.cjs and jest.setup.js for improved Jest testing configuration and setup.
- Updated jest.config.js to support ESM and added new test patterns for better test organization.
- Enhanced TypeScript schemas to include new device types (media_player, fan, lock, vacuum, scene, script, camera) for comprehensive validation.
- Added unit tests for device schemas and Home Assistant connection, improving test coverage and reliability.
- Updated README.md with new testing instructions and device control examples, enhancing user guidance.
2024-12-17 15:07:40 +01:00

19 lines
748 B
JavaScript

const jestGlobals = require('@jest/globals');
// Mock semver to avoid the SemVer constructor issue
jestGlobals.jest.mock('semver', () => {
const actual = jestGlobals.jest.requireActual('semver');
return {
...actual,
parse: jestGlobals.jest.fn((version) => ({ version })),
valid: jestGlobals.jest.fn(() => true),
satisfies: jestGlobals.jest.fn(() => true),
gt: jestGlobals.jest.fn(() => true),
gte: jestGlobals.jest.fn(() => true),
lt: jestGlobals.jest.fn(() => false),
lte: jestGlobals.jest.fn(() => false),
eq: jestGlobals.jest.fn(() => true),
neq: jestGlobals.jest.fn(() => false),
SemVer: jestGlobals.jest.fn((version) => ({ version }))
};
});