mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 01:55:40 +00:00
edit sitekey, router pattern matching, sitekey update optimization, rm level delete and level err handling
This commit is contained in:
@@ -18,11 +18,11 @@
|
||||
import {LEVELS, Level} from './index';
|
||||
import {level1, level1visErr, level1diffErr, level2} from '../setupTests';
|
||||
|
||||
const visitorErr = 'visitor count has to greater than previous levels';
|
||||
const difficultyErr = 'difficulty has to greater than previous levels';
|
||||
const visitorErr = 'visitor count should be greater than previous levels';
|
||||
const difficultyErr = 'difficulty should be greater than previous levels';
|
||||
|
||||
const zeroVisError = 'Visitors must be greater than zero';
|
||||
const zeroDiffError = 'Difficulty must be greater than zero';
|
||||
const zeroVisError = 'visitors must be greater than zero';
|
||||
const zeroDiffError = 'difficulty must be greater than zero';
|
||||
|
||||
const zeroVis: Level = {
|
||||
difficulty_factor: 10,
|
||||
@@ -71,12 +71,12 @@ it('LEVELS works', () => {
|
||||
try {
|
||||
LEVELS.add(zeroVis);
|
||||
} catch (e) {
|
||||
expect(e.message).toEqual(zeroVisError);
|
||||
expect(e.message).toContain(zeroVisError);
|
||||
}
|
||||
// difficulty is 0
|
||||
try {
|
||||
LEVELS.add(zeroDiff);
|
||||
} catch (e) {
|
||||
expect(e.message).toEqual(zeroDiffError);
|
||||
expect(e.message).toContain(zeroDiffError);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user