@applicaster/zapp-react-native-utils
Version:
Applicaster Zapp React Native utilities package
25 lines (19 loc) • 700 B
text/typescript
import { anyTruthy } from "..";
describe("anyTruthy", () => {
it("should return true when at least one value is true", () => {
expect(anyTruthy([false, true, false])).toBe(true);
});
it("should return false when all values are false", () => {
expect(anyTruthy([false, false, false])).toBe(false);
});
it("should return true when all values are true", () => {
expect(anyTruthy([true, true, true])).toBe(true);
});
it("should return false for an empty array", () => {
expect(anyTruthy([])).toBe(false);
});
it("should handle single-element arrays correctly", () => {
expect(anyTruthy([true])).toBe(true);
expect(anyTruthy([false])).toBe(false);
});
});