xref: /expo/apps/test-suite/tests/SMS.web.js (revision 1d192e13)
1import * as SMS from 'expo-sms';
2import { Platform } from 'react-native';
3
4import { expectMethodToThrowAsync } from '../TestUtils';
5
6export const name = 'SMS';
7
8export function test({ describe, it, expect }) {
9  describe(`sendSMSAsync()`, () => {
10    it(`is unavailable`, async () => {
11      const error = await expectMethodToThrowAsync(SMS.sendSMSAsync);
12      expect(error.code).toBe('E_SMS_UNAVAILABLE');
13    });
14  });
15
16  describe(`isAvailableAsync()`, () => {
17    it(`is not supported on ${Platform.OS}`, async () => {
18      expect(await SMS.isAvailableAsync()).toBe(false);
19    });
20  });
21}
22