expo-srcpush
Version:
Expo module for Source Push, a service for over-the-air updates in React Native applications.
44 lines (36 loc) • 1.51 kB
text/typescript
import { PluginConfigType } from '../src/pluginConfig';
describe('PluginConfigType', () => {
it('should have valid ios configuration', () => {
const iosConfig: PluginConfigType['ios'] = {
CodePushDeploymentKey: 'test-ios-key',
};
expect(iosConfig.CodePushDeploymentKey).toBe('test-ios-key');
});
it('should have valid android configuration', () => {
const androidConfig: PluginConfigType['android'] = {
CodePushDeploymentKey: 'test-android-key',
CodePushPublicKey: 'test-public-key',
};
expect(androidConfig.CodePushDeploymentKey).toBe('test-android-key');
expect(androidConfig.CodePushPublicKey).toBe('test-public-key');
});
});
describe('PluginConfigType edge cases', () => {
it('should allow missing CodePushPublicKey for android', () => {
const androidConfig: PluginConfigType['android'] = {
CodePushDeploymentKey: 'test-android-key',
};
expect(androidConfig.CodePushDeploymentKey).toBe('test-android-key');
expect(androidConfig.CodePushPublicKey).toBeUndefined();
});
it('should not allow missing CodePushDeploymentKey for ios', () => {
// @ts-expect-error
const iosConfig: PluginConfigType['ios'] = {};
expect(iosConfig.CodePushDeploymentKey).toBeUndefined();
});
it('should not allow missing CodePushDeploymentKey for android', () => {
// @ts-expect-error
const androidConfig: PluginConfigType['android'] = {};
expect(androidConfig.CodePushDeploymentKey).toBeUndefined();
});
});