mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
21 lines
588 B
TypeScript
21 lines
588 B
TypeScript
|
import {expect} from 'chai';
|
||
|
import {backendTexts} from '../../../src/common/BackendTexts';
|
||
|
|
||
|
|
||
|
describe('BackendText', () => {
|
||
|
it('should all number be unique', () => {
|
||
|
const numbers: number[] = [];
|
||
|
const getNumbers = (obj: any) => {
|
||
|
for (const key of Object.keys(obj)) {
|
||
|
if (typeof obj[key] === 'object') {
|
||
|
getNumbers(obj[key]);
|
||
|
continue;
|
||
|
}
|
||
|
expect(numbers.indexOf(obj[key])).to.be.equal(-1, 'duplicate backend number id found:' + obj[key]);
|
||
|
numbers.push(obj[key]);
|
||
|
}
|
||
|
};
|
||
|
getNumbers(backendTexts);
|
||
|
});
|
||
|
});
|