Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should passes when used properly', () => {
reverseGeocodeAsync({
latitude: 1,
longitude: 1,
}).then(result => {
const address = result[0];
(address.city: string);
(address.street: string);
(address.region: string);
(address.country: string);
(address.postalCode: string);
// $ExpectError: check any
(address.name: number);
});
});
it('should raise an error when call function with invalid arguments', () => {
// $ExpectError: first argument is required
reverseGeocodeAsync();
// $ExpectError: first must be an object
reverseGeocodeAsync(123);
// $ExpectError: object do not include required props `latitude,longitude`
reverseGeocodeAsync({});
// $ExpectError: `abc` is extra props
reverseGeocodeAsync({
latitude: 1,
longitude: 1,
abc: 1,
});
reverseGeocodeAsync({
// $ExpectError: `latitude` must be a number
latitude: 'nned number',
longitude: 1,
});