1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/test/common/unit/BackendText.spec.ts

21 lines
588 B
TypeScript
Raw Normal View History

2019-12-29 17:24:47 +08:00
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);
});
});