ktmouk
ktmouk
TTCTheo's Typesafe Cult
Created by maks on 7/29/2024 in #questions
No typescript error. Why?
Would it be fixed if you remove [x: string]: any?
5 replies
TTCTheo's Typesafe Cult
Created by Muhct on 7/14/2024 in #questions
Using hardcoded data for comparison in unit tests with toEqual?
In that case, I would shorten the dummy data and write it directly into the test instead of splitting the file. Do you really need very long dummy data?
describe('Helpers', () => {
test('removes scattered zeros using cleanIndices', () => {
const result = Helpers.cleanIndices([0, { down: 4719, left: 4718, right: 4720, id: 1, up: 4721 }, 0]);
expect(result).toEqual([{ down: 4719, left: 4718, right: 4720, id: 1, up: 4721 }]);
});
});
describe('Helpers', () => {
test('removes scattered zeros using cleanIndices', () => {
const result = Helpers.cleanIndices([0, { down: 4719, left: 4718, right: 4720, id: 1, up: 4721 }, 0]);
expect(result).toEqual([{ down: 4719, left: 4718, right: 4720, id: 1, up: 4721 }]);
});
});
8 replies