How to use the expo-location.reverseGeocodeAsync function in expo-location

To help you get started, we’ve selected a few expo-location examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / expo-location_v5.x.x / flow_v0.104.x- / test_expo-location.js View on Github external
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);
    });
  });
github flow-typed / flow-typed / definitions / npm / expo-location_v5.x.x / flow_v0.104.x- / test_expo-location.js View on Github external
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,
    });