ionic-mocks
Simple test doubles for Ionic 3+ using Jasmine Spy Objects
This project is still very early in development and there are several things I'm sorting out. However since this is only meant to be used in your tests it should be safe to pull into a project.
Supported Types
- ActionSheet
- ActionSheetController
- Alert
- AlertController
- App
- Content
- Config
- Events
- Form
- Haptic
- InfiniteScroll
- ItemSliding
- Loading
- LoadingController
- Menu
- MenuController
- Modal
- ModalController
- Platform
- Popover
- PopoverController
- NavController
- Nav
- NavParams
- StatusBar
- Tab
- Tabs
- Toast
- ToastController
- ViewController
Native Plugins
- 3DTouch
- Keyboard
- Network
- Splashscreen
- Network
- ScreenOrientation
Installation
npm install --save-dev ionic-mocks
Examples
;; describe'MyClass',;
Pre-mocked return types
;; describe'MyComponent',;
Override ionic providers in TestingModule
TestBed.configureTestingModule;