1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-23 01:27:14 +02:00
pigallery2/test/common/unit/BackendText.spec.ts

21 lines
588 B
TypeScript
Raw Normal View History

2019-12-29 11:24:47 +02: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);
});
});