import { transformStringToBoolean } from './transformStringToBoolean'; describe('#transformStringToBoolean', () => { test.each([ ['true', true], ['True', true], ['TRUE', true], ['yes', true], ['checked', true], ['是', true], ['已勾选', true], ['1', true], ['2', true], ['0.1', true], ['false', false], ['0', false], ['', false], ])('should parse %p to %p', (input, output) => { const result = transformStringToBoolean(input); expect(result).toBe(output); }); });