Phase 1: Add ESLint/Prettier config + baseline auto-fixes
This commit is contained in:
@@ -37,25 +37,25 @@ describe('evaluateHealth', () => {
|
||||
|
||||
test('returns false when expectedBodyPattern regex does not match', () => {
|
||||
expect(healthChecker.evaluateHealth(200, 'error occurred', {
|
||||
expectedBodyPattern: 'ok|healthy'
|
||||
expectedBodyPattern: 'ok|healthy',
|
||||
})).toBe(false);
|
||||
});
|
||||
|
||||
test('returns true when expectedBodyPattern regex matches', () => {
|
||||
expect(healthChecker.evaluateHealth(200, 'status: healthy', {
|
||||
expectedBodyPattern: 'healthy'
|
||||
expectedBodyPattern: 'healthy',
|
||||
})).toBe(true);
|
||||
});
|
||||
|
||||
test('returns false when expectedBodyContains text is missing', () => {
|
||||
expect(healthChecker.evaluateHealth(200, 'some response', {
|
||||
expectedBodyContains: 'healthy'
|
||||
expectedBodyContains: 'healthy',
|
||||
})).toBe(false);
|
||||
});
|
||||
|
||||
test('returns true when expectedBodyContains text is present', () => {
|
||||
expect(healthChecker.evaluateHealth(200, 'service is healthy', {
|
||||
expectedBodyContains: 'healthy'
|
||||
expectedBodyContains: 'healthy',
|
||||
})).toBe(true);
|
||||
});
|
||||
|
||||
@@ -64,21 +64,21 @@ describe('evaluateHealth', () => {
|
||||
expect(healthChecker.evaluateHealth(200, 'healthy ok', {
|
||||
expectedStatusCodes: [200],
|
||||
expectedBodyPattern: 'healthy',
|
||||
expectedBodyContains: 'ok'
|
||||
expectedBodyContains: 'ok',
|
||||
})).toBe(true);
|
||||
|
||||
// Status fails
|
||||
expect(healthChecker.evaluateHealth(500, 'healthy ok', {
|
||||
expectedStatusCodes: [200],
|
||||
expectedBodyPattern: 'healthy',
|
||||
expectedBodyContains: 'ok'
|
||||
expectedBodyContains: 'ok',
|
||||
})).toBe(false);
|
||||
|
||||
// Body pattern fails
|
||||
expect(healthChecker.evaluateHealth(200, 'error', {
|
||||
expectedStatusCodes: [200],
|
||||
expectedBodyPattern: 'healthy',
|
||||
expectedBodyContains: 'error'
|
||||
expectedBodyContains: 'error',
|
||||
})).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user