Skip to content

test(form): add export contract tests #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions packages/form/src/exports.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import {
composeReducers,
ConnectArrayDirective,
ConnectArrayTemplate,
ConnectBase,
ConnectDirective,
defaultFormReducer,
FORM_CHANGED,
FormException,
FormStore,
formStoreFactory,
NgReduxFormConnectArrayModule,
NgReduxFormConnectModule,
NgReduxFormModule,
provideReduxForms,
ReactiveConnectDirective,
} from './index';

describe('The @angular-redux/form package exports', () => {
it('should contain the composeReducers function', () => {
expect(composeReducers).toBeDefined();
});

it('should contain the ConnectArrayDirective class', () => {
expect(ConnectArrayDirective).toBeDefined();
});

it('should contain the ConnectArrayTemplate class', () => {
expect(ConnectArrayTemplate).toBeDefined();
});

it('should contain the ConnectBase class', () => {
expect(ConnectBase).toBeDefined();
});

it('should contain the ConnectDirective class', () => {
expect(ConnectDirective).toBeDefined();
});

it('should contain the defaultFormReducer function', () => {
expect(defaultFormReducer).toBeDefined();
});

it('should contain the FORM_CHANGED const', () => {
expect(FORM_CHANGED).toBeDefined();
});

it('should contain the FormException class', () => {
expect(FormException).toBeDefined();
});

it('should contain the FormStore class', () => {
expect(FormStore).toBeDefined();
});

it('should contain the formStoreFactory function', () => {
expect(formStoreFactory).toBeDefined();
});

it('should contain the NgReduxFormConnectArrayModule class', () => {
expect(NgReduxFormConnectArrayModule).toBeDefined();
});

it('should contain the NgReduxFormConnectModule class', () => {
expect(NgReduxFormConnectModule).toBeDefined();
});

it('should contain the NgReduxFormModule class', () => {
expect(NgReduxFormModule).toBeDefined();
});

it('should contain the provideReduxForms function', () => {
expect(provideReduxForms).toBeDefined();
});

it('should contain the ReactiveConnectDirective class', () => {
expect(ReactiveConnectDirective).toBeDefined();
});
});
52 changes: 39 additions & 13 deletions packages/form/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
export * from './compose-reducers';
export * from './form-reducer';
export * from './form-exception';
export * from './form-store';
export * from './configure';
export * from './connect/connect-base';
export * from './connect/connect-reactive';
export * from './connect/connect.directive';
export * from './connect/connect.module';
export * from './connect-array/connect-array-template';
export * from './connect-array/connect-array.directive';
export * from './connect-array/connect-array.module';
export * from './module';
import { composeReducers } from './compose-reducers';
import { provideReduxForms } from './configure';
import { FormException } from './form-exception';
import { defaultFormReducer } from './form-reducer';
import { AbstractStore, FORM_CHANGED, FormStore } from './form-store';
import { formStoreFactory, NgReduxFormModule } from './module';

import { ConnectBase, ControlPair } from './connect/connect-base';
import { ReactiveConnectDirective } from './connect/connect-reactive';
import { ConnectDirective } from './connect/connect.directive';
import { NgReduxFormConnectModule } from './connect/connect.module';

import { ConnectArrayTemplate } from './connect-array/connect-array-template';
import { ConnectArrayDirective } from './connect-array/connect-array.directive';
import { NgReduxFormConnectArrayModule } from './connect-array/connect-array.module';

// Warning: don't do this:
// export * from './foo'
// ... because it breaks rollup. See
// https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
export {
AbstractStore,
composeReducers,
ConnectArrayDirective,
ConnectArrayTemplate,
ConnectBase,
ConnectDirective,
ControlPair,
defaultFormReducer,
FORM_CHANGED,
FormException,
FormStore,
formStoreFactory,
NgReduxFormConnectArrayModule,
NgReduxFormConnectModule,
NgReduxFormModule,
provideReduxForms,
ReactiveConnectDirective,
};