[
  {
    "path": ".editorconfig",
    "content": "# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs\n# editorconfig.org\n\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\n\n# We recommend you to keep these unchanged\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false"
  },
  {
    "path": ".gitignore",
    "content": "# Specifies intentionally untracked files to ignore when using Git\n# http://git-scm.com/docs/gitignore\n\n*~\n*.sw[mnpcod]\n*.log\n*.tmp\n*.tmp.*\nlog.txt\n*.sublime-project\n*.sublime-workspace\n.vscode/\nnpm-debug.log*\n\n.idea/\n.sass-cache/\n.tmp/\n.versions/\ncoverage/\ndist/\nnode_modules/\ntmp/\ntemp/\nhooks/\nplatforms/\nplugins/\nplugins/android.json\nplugins/ios.json\nwww/\n$RECYCLE.BIN/\n\n.DS_Store\nThumbs.db\nUserInterfaceState.xcuserstate\n\n\\.sourcemaps/\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright 2015-present Drifty Co.\nhttp://drifty.com/\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "> **2018-03-28:** We have a [pull request for updating to Karma 2](https://github.com/ionic-team/ionic-unit-testing-example/pull/87) awaiting review. If you can take the time to install this update and let us know if it works for you, that would be very helpful. Comments are welcome!\n\n# Ionic Unit Testing Example\n\n**This repository is an example project that gives guidance on setting up your Ionic application for unit testing and end-to-end (E2E) testing.** We have been told the folks at Ionic will be adding testing features to new projects in the future. But until then, feel free to borrow from this project as needed.\n\nSpecial thanks to all of the contributors. With the exception of the Ionic team's updates to the framework, this project is stable. If you have a suggestion, feel free to update code and make a pull request. Find a problem or bug, feel free to file a detailed issue. \n\n## How to Configure Your Ionic Application for Testing\n\nRead [this tutorial](https://leifwells.github.io/2017/08/27/testing-in-ionic-configure-existing-projects-for-testing/) for instructions on how to apply the testing configuration in this project to your own project. \n\n## Mocking Classes for Ionic\nWhen a developer unit tests a component, the objective is to isolate that component as much as possible. In the case of an Ionic page, you may have Ionic components like `NavController`, `LoadingContoller`, or `Platform`. Adding these components means adding pieces of the Ionic framework to your test, thus not isolating the component. As part of this example, the file `test-config/mocks-ionic.ts` is provided for creating simple mocks for many of the classes in Ionic that you may need. You may use the classes from this file in test files inside the `TestBed.configureComponent()` method argument's `provider` array as seen in our [example unit test file](https://github.com/ionic-team/ionic-unit-testing-example/blob/master/src/app/app.component.spec.ts).\n\nThere are other mocking options that should be mentioned:\n**[ionic-mocks](https://github.com/stonelasley/ionic-mocks)**\n**[ionic-test-doubles](https://github.com/DomesticApp/ionic-test-doubles)**\n\nAlso worth mentioning is [ionic-native-mocks](https://github.com/chrisgriffith/ionic-native-mocks) which can be helpful when mocks for Ionic Native classes used in your project are needed.\n\nGetting Started with this Project\n-----------\n\nTo get started, clone this repo, and run `npm install` in the root directory.\n\n```sh\ngit clone https://github.com/ionic-team/ionic-unit-testing-example.git\ncd ionic-unit-testing-example\nnpm install\n```\nThen, you should run `ionic serve` to make sure the project loads.\n\n### Unit Tests\n\nTo run the tests, run `npm run test`.\n\nSee the example test in `src/app/app.component.spec.ts` for an example of a component test.\n\n### End-To-End Tests (Browser-Only)\n\nTo serve the app, run `ionic serve`.\n\nTo run the end-to-end tests, run (while the app is being served) `npm run e2e`.\n\nSee the example end-to-end test in `e2e/app.e2e-spec.ts`.\n\nUPDATES:\n--------\n### **2018-02-25: Updated to Ionic 3.9.2**\nUpdated project to use the latest version Ionic and dependencies. Take a look at the [`package.json`](https://github.com/ionic-team/ionic-unit-testing-example/blob/master/package.json) for more details.\n\n### **2017-09-05: Added Code Coverage Functionality**\n\nThanks to @lathonez, we now have functioning code coverage functionality. With this update, developers can run `npm run test-coverage` which will run the project's unit tests with Karma and produce documentation that gives guidance on how well the project's tests cover the code.\n\n![Example Image of Completed Code Coverage](https://user-images.githubusercontent.com/1648535/30074946-54a36e50-9241-11e7-9ca8-6263d0353c58.png)\n\nThe documentation is created inside the `/coverage` folder (ignored by git).\n\n## Looking for Version 2?\n\nIf you are using Ionic v2, please see our [ionic-v2-branch](https://github.com/ionic-team/ionic-unit-testing-example/tree/ionic-v2-branch).\n\n## Credits\n\nThis repository is based on the awesome [unit testing example](https://github.com/roblouie/unit-testing-demo) from [@roblouie](https://github.com/roblouie/) :thumbsup:\n\nPast Updates\n==========\n\n### **2017-08-26: Update to `ionic-angular` version 3.6.0**\n\nWe updated the project to `ionic-angular` version `3.6.0`. Developers wishing to use this should also update Ionic CLI for a better experience. With today's update, this project is now at version `0.0.5`.\n\n## **Added: Fix for assets not being found by Karma**\n\nThanks to [@datencia](https://github.com/datencia) for providing an update to our Karma configuration that properly sets the Karma base path so that image assets can be found during testing. This fix should also work any JSON data files you might want to use for testing. He also provided an image and updated our sample unit test spec file that tests that the image is found. \n\n#### **Added: Update code to match Ionic templates**\n\nThanks (again) to [@danielsogl](https://github.com/danielsogl/) for providing a code update to the project so that our code matches code created by using the `ionic start` command. Having this code properly match is important as it provides the best practice guidance for handling application start up.\n\n#### *2017-05-28: Update to Version 3.3.0*\n\nThanks to [@danielsogl](https://github.com/danielsogl/) for getting us up-to-date with Ionic 3.3.0, Angular 4.1.2 and Ionic Native 3.10.2.\n\nThanks to [@johnstonbl01](https://github.com/johnstonbl01/) for adding a couple of mocks that prevent us from seeing some unnecessary warning messages.\n\n#### *2017-05-12: Update to Version 3* \n\nWe've updated this repo to use Ionic v3.2.1 and Ionic CLI v3.0.0.\n\nIf you already have this repository downloaded on your system, after you sync with our Master branch make certain you delete your `node_modules` folder and then run `npm install`.\n\nAlso, since we've updated to Ionic CLI v3.0.0, you will need to update your version as well:\n```\nnpm remove -g ionic\nnpm install -g ionic\n```\nIf you run `ionic -v` it should return `3.0.0` (or better, depending on what has been released.\n"
  },
  {
    "path": "config.xml",
    "content": "<?xml version='1.0' encoding='utf-8'?>\n<widget id=\"io.ionic.starter\" version=\"0.0.1\" xmlns=\"http://www.w3.org/ns/widgets\" xmlns:cdv=\"http://cordova.apache.org/ns/1.0\">\n    <name>Ionic Unit and E2E Tests</name>\n    <description>An awesome Ionic/Cordova app.</description>\n    <author email=\"hi@ionicframework\" href=\"http://ionicframework.com/\">Ionic Framework Team</author>\n    <content src=\"index.html\" />\n    <access origin=\"*\" />\n    <allow-navigation href=\"http://ionic.local/*\"/>\n    <allow-intent href=\"http://*/*\" />\n    <allow-intent href=\"https://*/*\" />\n    <allow-intent href=\"tel:*\" />\n    <allow-intent href=\"sms:*\" />\n    <allow-intent href=\"mailto:*\" />\n    <allow-intent href=\"geo:*\" />\n    <platform name=\"android\">\n        <allow-intent href=\"market:*\" />\n    </platform>\n    <platform name=\"ios\">\n        <allow-intent href=\"itms:*\" />\n        <allow-intent href=\"itms-apps:*\" />\n    </platform>\n    <preference name=\"webviewbounce\" value=\"false\" />\n    <preference name=\"UIWebViewBounce\" value=\"false\" />\n    <preference name=\"DisallowOverscroll\" value=\"true\" />\n    <preference name=\"android-minSdkVersion\" value=\"16\" />\n    <preference name=\"BackupWebStorage\" value=\"none\" />\n\n    <!--\n      Change these to configure how the splashscreen displays and fades in/out.\n      More info here: https://github.com/apache/cordova-plugin-splashscreen\n    -->\n    <preference name=\"SplashMaintainAspectRatio\" value=\"true\" />\n    <preference name=\"FadeSplashScreenDuration\" value=\"300\" />\n    <preference name=\"SplashShowOnlyFirstTime\" value=\"false\" />\n    <feature name=\"StatusBar\">\n        <param name=\"ios-package\" onload=\"true\" value=\"CDVStatusBar\" />\n    </feature>\n\n    <plugin name=\"ionic-plugin-keyboard\" spec=\"~2.2.1\"/>\n    <plugin name=\"cordova-plugin-whitelist\" spec=\"1.3.1\"/>\n    <plugin name=\"cordova-plugin-statusbar\" spec=\"2.2.1\"/>\n    <plugin name=\"cordova-plugin-device\" spec=\"1.1.4\"/>\n    <plugin name=\"cordova-plugin-splashscreen\" spec=\"~4.0.1\"/>\n</widget>\n"
  },
  {
    "path": "e2e/app.e2e-spec.ts",
    "content": "import { Page } from './app.po';\n\ndescribe('App', () => {\n  let page: Page;\n\n  beforeEach(() => {\n    page = new Page();\n  });\n\n  describe('default screen', () => {\n    beforeEach(() => {\n      page.navigateTo('/');\n    });\n\n    it('should have a title saying Page One', () => {\n      page.getPageOneTitleText().then(title => {\n        expect(title).toEqual('Page One');\n      });\n    });\n  })\n});\n"
  },
  {
    "path": "e2e/app.po.ts",
    "content": "import { browser, by, element } from 'protractor';\n\nexport class Page {\n\n  navigateTo(destination) {\n    return browser.get(destination);\n  }\n\n  getTitle() {\n    return browser.getTitle();\n  }\n\n  getPageOneTitleText() {\n    return element(by.tagName('page-page1')).element(by.tagName('ion-title')).element(by.css('.toolbar-title')).getText();\n  }\n}\n"
  },
  {
    "path": "e2e/tsconfig.e2e.json",
    "content": "{\n  \"extends\": \"../tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"../out-tsc/e2e\",\n    \"baseUrl\": \"./\",\n    \"module\": \"commonjs\",\n    \"target\": \"es5\",\n    \"typeRoots\": [\n      \"../node_modules/@types\"\n    ]\n  }\n}\n"
  },
  {
    "path": "ionic.config.json",
    "content": "{\n  \"name\": \"ionic-unit-testing-example\",\n  \"app_id\": \"\",\n  \"type\": \"ionic-angular\",\n  \"integrations\": {}\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"ionic-unit-testing-example\",\n  \"author\": \"Ionic Framework\",\n  \"homepage\": \"https://ionicframework.com/\",\n  \"private\": true,\n  \"scripts\": {\n    \"clean\": \"ionic-app-scripts clean\",\n    \"build\": \"ionic-app-scripts build\",\n    \"ionic:build\": \"ionic-app-scripts build\",\n    \"ionic:serve\": \"ionic-app-scripts serve\",\n    \"test\": \"karma start ./test-config/karma.conf.js\",\n    \"test-ci\": \"karma start ./test-config/karma.conf.js --single-run\",\n    \"test-coverage\": \"karma start ./test-config/karma.conf.js --coverage\",\n    \"e2e\": \"npm run e2e-update && npm run e2e-test\",\n    \"e2e-test\": \"protractor ./test-config/protractor.conf.js\",\n    \"e2e-update\": \"webdriver-manager update --standalone false --gecko false\"\n  },\n  \"dependencies\": {\n    \"@angular/common\": \"5.0.3\",\n    \"@angular/compiler\": \"5.0.3\",\n    \"@angular/compiler-cli\": \"5.0.3\",\n    \"@angular/core\": \"5.0.3\",\n    \"@angular/forms\": \"5.0.3\",\n    \"@angular/http\": \"5.0.3\",\n    \"@angular/platform-browser\": \"5.0.3\",\n    \"@angular/platform-browser-dynamic\": \"5.0.3\",\n    \"@ionic-native/core\": \"4.4.0\",\n    \"@ionic-native/splash-screen\": \"4.4.0\",\n    \"@ionic-native/status-bar\": \"4.4.0\",\n    \"@ionic/storage\": \"2.1.3\",\n    \"ionic-angular\": \"3.9.2\",\n    \"ionicons\": \"3.0.0\",\n    \"rxjs\": \"5.5.2\",\n    \"sw-toolbox\": \"3.6.0\",\n    \"zone.js\": \"0.8.18\"\n  },\n  \"devDependencies\": {\n    \"@angular/cli\": \"1.4.8\",\n    \"@ionic/app-scripts\": \"3.1.8\",\n    \"@types/jasmine\": \"^2.5.41\",\n    \"@types/node\": \"^8.0.45\",\n    \"angular2-template-loader\": \"^0.6.2\",\n    \"html-loader\": \"^0.5.1\",\n    \"istanbul-instrumenter-loader\": \"^3.0.0\",\n    \"jasmine\": \"^2.5.3\",\n    \"jasmine-spec-reporter\": \"^4.1.0\",\n    \"karma\": \"^1.5.0\",\n    \"karma-chrome-launcher\": \"^2.0.0\",\n    \"karma-coverage-istanbul-reporter\": \"^1.3.0\",\n    \"karma-jasmine\": \"^1.1.0\",\n    \"karma-jasmine-html-reporter\": \"^0.2.2\",\n    \"karma-sourcemap-loader\": \"^0.3.7\",\n    \"karma-webpack\": \"^2.0.3\",\n    \"null-loader\": \"^0.1.1\",\n    \"protractor\": \"^5.1.1\",\n    \"ts-loader\": \"^3.0.3\",\n    \"ts-node\": \"^3.0.2\",\n    \"typescript\": \"2.4.2\"\n  },\n  \"version\": \"0.0.7\",\n  \"description\": \"An Ionic project\"\n}\n"
  },
  {
    "path": "src/app/app.component.spec.ts",
    "content": "import { async, TestBed } from '@angular/core/testing';\nimport { IonicModule, Platform } from 'ionic-angular';\n\nimport { StatusBar } from '@ionic-native/status-bar';\nimport { SplashScreen } from '@ionic-native/splash-screen';\n\nimport { MyApp } from './app.component';\nimport {\n  PlatformMock,\n  StatusBarMock,\n  SplashScreenMock\n} from '../../test-config/mocks-ionic';\n\ndescribe('MyApp Component', () => {\n  let fixture;\n  let component;\n\n  beforeEach(async(() => {\n    TestBed.configureTestingModule({\n      declarations: [MyApp],\n      imports: [\n        IonicModule.forRoot(MyApp)\n      ],\n      providers: [\n        { provide: StatusBar, useClass: StatusBarMock },\n        { provide: SplashScreen, useClass: SplashScreenMock },\n        { provide: Platform, useClass: PlatformMock }\n      ]\n    })\n  }));\n\n  beforeEach(() => {\n    fixture = TestBed.createComponent(MyApp);\n    component = fixture.componentInstance;\n  });\n\n  it('should be created', () => {\n    expect(component instanceof MyApp).toBe(true);\n  });\n\n  it('should have two pages', () => {\n    expect(component.pages.length).toBe(2);\n  });\n\n});\n"
  },
  {
    "path": "src/app/app.component.ts",
    "content": "import { Component, ViewChild } from '@angular/core';\nimport { SplashScreen } from '@ionic-native/splash-screen';\nimport { StatusBar } from '@ionic-native/status-bar';\nimport { Nav, Platform } from 'ionic-angular';\n\n\n@Component({\n  templateUrl: 'app.html'\n})\nexport class MyApp {\n  @ViewChild(Nav) nav: Nav;\n\n  rootPage: any = 'Page1';\n\n  pages: Array<{ title: string, component: any }>;\n\n  constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {\n    // used for an example of ngFor and navigation\n    this.pages = [\n      { title: 'Page One', component: 'Page1' },\n      { title: 'Page Two', component: 'Page2' }\n    ];\n\n  }\n\n  ionViewDidLoad() {\n    this.platform.ready().then(() => {\n      // Okay, so the platform is ready and our plugins are available.\n      // Here you can do any higher level native things you might need.\n      this.statusBar.styleDefault();\n      this.splashScreen.hide();\n    });\n  }\n\n  openPage(page) {\n    // Reset the content nav to have just this page\n    // we wouldn't want the back button to show in this scenario\n    this.nav.setRoot(page.component);\n  }\n}\n"
  },
  {
    "path": "src/app/app.html",
    "content": "<ion-menu [content]=\"content\">\n  <ion-header>\n    <ion-toolbar>\n      <ion-title>Menu</ion-title>\n    </ion-toolbar>\n  </ion-header>\n\n  <ion-content>\n    <ion-list>\n      <button menuClose ion-item *ngFor=\"let p of pages\" (click)=\"openPage(p)\">\n        {{p.title}}\n      </button>\n    </ion-list>\n  </ion-content>\n\n</ion-menu>\n\n<ion-nav [root]=\"rootPage\" #content swipeBackEnabled=\"false\"></ion-nav>\n"
  },
  {
    "path": "src/app/app.module.ts",
    "content": "import { ErrorHandler, NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { SplashScreen } from '@ionic-native/splash-screen';\nimport { StatusBar } from '@ionic-native/status-bar';\nimport { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';\n\nimport { MyApp } from './app.component';\n\n@NgModule({\n  declarations: [\n    MyApp\n  ],\n  imports: [\n    BrowserModule,\n    IonicModule.forRoot(MyApp)\n  ],\n  bootstrap: [IonicApp],\n  entryComponents: [\n    MyApp\n  ],\n  providers: [\n    StatusBar,\n    SplashScreen,\n    { provide: ErrorHandler, useClass: IonicErrorHandler }\n  ]\n})\nexport class AppModule { }\n"
  },
  {
    "path": "src/app/app.scss",
    "content": "// http://ionicframework.com/docs/v2/theming/\n\n\n// App Global Sass\n// --------------------------------------------------\n// Put style rules here that you want to apply globally. These\n// styles are for the entire app and not just one component.\n// Additionally, this file can be also used as an entry point\n// to import other Sass files to be included in the output CSS.\n//\n// Shared Sass variables, which can be used to adjust Ionic's\n// default Sass variables, belong in \"theme/variables.scss\".\n//\n// To declare rules for a specific mode, create a child rule\n// for the .md, .ios, or .wp mode classes. The mode class is\n// automatically applied to the <body> element in the app.\n"
  },
  {
    "path": "src/app/main.ts",
    "content": "import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app.module';\n\nplatformBrowserDynamic().bootstrapModule(AppModule);\n"
  },
  {
    "path": "src/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\" dir=\"ltr\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>Ionic App</title>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\">\n  <meta name=\"format-detection\" content=\"telephone=no\">\n  <meta name=\"msapplication-tap-highlight\" content=\"no\">\n\n  <link rel=\"icon\" type=\"image/x-icon\" href=\"assets/icon/favicon.ico\">\n  <link rel=\"manifest\" href=\"manifest.json\">\n  <meta name=\"theme-color\" content=\"#4e8ef7\">\n\n  <!-- cordova.js required for cordova apps -->\n  <script src=\"cordova.js\"></script>\n\n  <!-- un-comment this code to enable service worker\n  <script>\n    if ('serviceWorker' in navigator) {\n      navigator.serviceWorker.register('service-worker.js')\n        .then(() => console.log('service worker installed'))\n        .catch(err => console.error('Error', err));\n    }\n  </script>-->\n\n  <link href=\"build/main.css\" rel=\"stylesheet\">\n\n</head>\n<body>\n\n  <!-- Ionic's root component and where the app will load -->\n  <ion-app></ion-app>\n\n  <!-- The polyfills js is generated during the build process -->\n  <script src=\"build/polyfills.js\"></script>\n\n  <!-- The vendor js is generated during the build process\n       It contains all of the dependencies in node_modules -->\n  <script src=\"build/vendor.js\"></script>\n\n  <!-- The main bundle js is generated during the build process -->\n  <script src=\"build/main.js\"></script>\n\n</body>\n</html>\n"
  },
  {
    "path": "src/manifest.json",
    "content": "{\n  \"name\": \"Ionic\",\n  \"short_name\": \"Ionic\",\n  \"start_url\": \"index.html\",\n  \"display\": \"standalone\",\n  \"icons\": [{\n    \"src\": \"assets/imgs/logo.png\",\n    \"sizes\": \"512x512\",\n    \"type\": \"image/png\"\n  }],\n  \"background_color\": \"#4e8ef7\",\n  \"theme_color\": \"#4e8ef7\"\n}"
  },
  {
    "path": "src/pages/page1/page1.html",
    "content": "<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name=\"menu\"></ion-icon>\n    </button>\n    <ion-title>Page One</ion-title>\n  </ion-navbar>\n</ion-header>\n\n<ion-content padding>\n  <h3>Ionic Menu Starter</h3>\n\n  <img src=\"assets/icon/favicon.ico\" alt=\"\" />\n\n  <p>\n    If you get lost, the <a href=\"http://ionicframework.com/docs/v2\">docs</a> will show you the way.\n  </p>\n\n  <button ion-button secondary menuToggle>Toggle Menu</button>\n</ion-content>\n"
  },
  {
    "path": "src/pages/page1/page1.module.ts",
    "content": "import { NgModule } from '@angular/core';\nimport { IonicPageModule } from 'ionic-angular';\nimport { Page1 } from './page1';\n\n@NgModule({\n  declarations: [\n    Page1,\n  ],\n  imports: [\n    IonicPageModule.forChild(Page1),\n  ],\n})\nexport class Page1Module {}\n"
  },
  {
    "path": "src/pages/page1/page1.scss",
    "content": "page-page1 {\n\n}\n"
  },
  {
    "path": "src/pages/page1/page1.spec.ts",
    "content": "import { async, ComponentFixture, TestBed } from '@angular/core/testing';\nimport { By }           from '@angular/platform-browser';\nimport { DebugElement } from '@angular/core';\nimport { Page1 } from './page1';\nimport { IonicModule, Platform, NavController} from 'ionic-angular/index';\nimport { StatusBar } from '@ionic-native/status-bar';\nimport { SplashScreen } from '@ionic-native/splash-screen';\n\ndescribe('Page1', () => {\n  let de: DebugElement;\n  let comp: Page1;\n  let fixture: ComponentFixture<Page1>;\n\n  beforeEach(async(() => {\n    TestBed.configureTestingModule({\n      declarations: [Page1],\n      imports: [\n        IonicModule.forRoot(Page1)\n      ],\n      providers: [\n        NavController\n      ]\n    });\n  }));\n\n  beforeEach(() => {\n    fixture = TestBed.createComponent(Page1);\n    comp = fixture.componentInstance;\n    de = fixture.debugElement.query(By.css('h3'));\n  });\n\n  it('should create component', () => expect(comp).toBeDefined());\n\n  it('should have expected <h3> text', () => {\n    fixture.detectChanges();\n    const h3 = de.nativeElement;\n    expect(h3.innerText).toMatch(/ionic/i,\n      '<h3> should say something about \"Ionic\"');\n  });\n\n  it('should show the favicon as <img>', () => {\n    fixture.detectChanges();\n    const img: HTMLImageElement = fixture.debugElement.query(By.css('img')).nativeElement;\n    expect(img.src).toContain('assets/icon/favicon.ico');\n  });\n});\n"
  },
  {
    "path": "src/pages/page1/page1.ts",
    "content": "import { Component } from '@angular/core';\nimport { IonicPage, NavController } from 'ionic-angular';\n\n@IonicPage()\n@Component({\n  selector: 'page-page1',\n  templateUrl: 'page1.html'\n})\nexport class Page1 {\n\n  constructor(public navCtrl: NavController) {\n\n  }\n\n}\n"
  },
  {
    "path": "src/pages/page2/page2.html",
    "content": "<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name=\"menu\"></ion-icon>\n    </button>\n    <ion-title>Page Two</ion-title>\n  </ion-navbar>\n</ion-header>\n\n<ion-content>\n  <ion-list>\n    <button ion-item *ngFor=\"let item of items\" (click)=\"itemTapped($event, item)\">\n      <ion-icon [name]=\"item.icon\" item-start></ion-icon>\n      {{item.title}}\n      <div class=\"item-note\" item-end>\n        {{item.note}}\n      </div>\n    </button>\n  </ion-list>\n  <div *ngIf=\"selectedItem\" padding>\n    You navigated here from <b>{{selectedItem.title}}</b>\n  </div>\n</ion-content>\n"
  },
  {
    "path": "src/pages/page2/page2.module.ts",
    "content": "import { NgModule } from '@angular/core';\nimport { IonicPageModule } from 'ionic-angular';\n\nimport { Page2 } from './page2';\n\n@NgModule({\n  declarations: [\n    Page2,\n  ],\n  imports: [\n    IonicPageModule.forChild(Page2),\n  ],\n})\nexport class Page2Module { }\n"
  },
  {
    "path": "src/pages/page2/page2.scss",
    "content": "page-page2 {\n\n}\n"
  },
  {
    "path": "src/pages/page2/page2.ts",
    "content": "import { Component } from '@angular/core';\nimport { IonicPage, NavController, NavParams } from 'ionic-angular';\n\n@IonicPage()\n@Component({\n  selector: 'page-page2',\n  templateUrl: 'page2.html'\n})\nexport class Page2 {\n  selectedItem: any;\n  icons: string[];\n  items: Array<{ title: string, note: string, icon: string }>;\n\n  constructor(public navCtrl: NavController, public navParams: NavParams) {\n    // If we navigated to this page, we will have an item available as a nav param\n    this.selectedItem = navParams.get('item');\n\n    // Let's populate this page with some filler content for funzies\n    this.icons = ['flask', 'wifi', 'beer', 'football', 'basketball', 'paper-plane',\n      'american-football', 'boat', 'bluetooth', 'build'];\n\n    this.items = [];\n    for (let i = 1; i < 11; i++) {\n      this.items.push({\n        title: 'Item ' + i,\n        note: 'This is item #' + i,\n        icon: this.icons[Math.floor(Math.random() * this.icons.length)]\n      });\n    }\n  }\n\n  itemTapped(event, item) {\n    // That's right, we're pushing to ourselves!\n    this.navCtrl.push('Page2', {\n      item: item\n    });\n  }\n}\n"
  },
  {
    "path": "src/service-worker.js",
    "content": "/**\n * Check out https://googlechrome.github.io/sw-toolbox/docs/master/index.html for\n * more info on how to use sw-toolbox to custom configure your service worker.\n */\n\n\n'use strict';\nimportScripts('./build/sw-toolbox.js');\n\nself.toolbox.options.cache = {\n  name: 'ionic-cache'\n};\n\n// pre-cache our key assets\nself.toolbox.precache(\n  [\n    './build/main.js',\n    './build/main.css',\n    './build/polyfills.js',\n    'index.html',\n    'manifest.json'\n  ]\n);\n\n// dynamically cache any other local assets\nself.toolbox.router.any('/*', self.toolbox.cacheFirst);\n\n// for any other requests go to the network, cache,\n// and then only use that cached resource if your user goes offline\nself.toolbox.router.default = self.toolbox.networkFirst;"
  },
  {
    "path": "src/theme/variables.scss",
    "content": "// Ionic Variables and Theming. For more info, please see:\n// http://ionicframework.com/docs/v2/theming/\n$font-path: \"../assets/fonts\";\n\n@import \"ionic.globals\";\n\n\n// Shared Variables\n// --------------------------------------------------\n// To customize the look and feel of this app, you can override\n// the Sass variables found in Ionic's source scss files.\n// To view all the possible Ionic variables, see:\n// http://ionicframework.com/docs/v2/theming/overriding-ionic-variables/\n\n\n\n\n// Named Color Variables\n// --------------------------------------------------\n// Named colors makes it easy to reuse colors on various components.\n// It's highly recommended to change the default colors\n// to match your app's branding. Ionic uses a Sass map of\n// colors so you can add, rename and remove colors as needed.\n// The \"primary\" color is the only required color in the map.\n\n$colors: (\n  primary:    #387ef5,\n  secondary:  #32db64,\n  danger:     #f53d3d,\n  light:      #f4f4f4,\n  dark:       #222\n);\n\n\n// App iOS Variables\n// --------------------------------------------------\n// iOS only Sass variables can go here\n\n\n\n\n// App Material Design Variables\n// --------------------------------------------------\n// Material Design only Sass variables can go here\n\n\n\n\n// App Windows Variables\n// --------------------------------------------------\n// Windows only Sass variables can go here\n\n\n\n\n// App Theme\n// --------------------------------------------------\n// Ionic apps can have different themes applied, which can\n// then be future customized. This import comes last\n// so that the above variables are used and Ionic's\n// default are overridden.\n\n@import \"ionic.theme.default\";\n\n\n// Ionicons\n// --------------------------------------------------\n// The premium icon font for Ionic. For more info, please see:\n// http://ionicframework.com/docs/v2/ionicons/\n\n@import \"ionic.ionicons\";\n\n\n// Fonts\n// --------------------------------------------------\n\n@import \"roboto\";\n@import \"noto-sans\";\n"
  },
  {
    "path": "test-config/karma-test-shim.js",
    "content": "Error.stackTraceLimit = Infinity;\n\nrequire('core-js/es6');\nrequire('core-js/es7/reflect');\n\nrequire('zone.js/dist/zone');\nrequire('zone.js/dist/long-stack-trace-zone');\nrequire('zone.js/dist/proxy');\nrequire('zone.js/dist/sync-test');\nrequire('zone.js/dist/jasmine-patch');\nrequire('zone.js/dist/async-test');\nrequire('zone.js/dist/fake-async-test');\n\nvar appContext = require.context('../src', true, /\\.spec\\.ts/);\n\nappContext.keys().forEach(appContext);\n\nvar testing = require('@angular/core/testing');\nvar browser = require('@angular/platform-browser-dynamic/testing');\n\ntesting.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());\n"
  },
  {
    "path": "test-config/karma.conf.js",
    "content": "var webpackConfig = require('./webpack.test.js');\n\nmodule.exports = function(config) {\n  var _config = {\n    basePath: '../',\n\n    frameworks: ['jasmine'],\n\n    files: [\n      {\n        pattern: './test-config/karma-test-shim.js',\n        watched: true\n      },\n      {\n        pattern: './src/assets/**/*',\n        watched: false,\n        included: false,\n        served: true,\n        nocache: false\n      }\n    ],\n\n    proxies: {\n      '/assets/': '/base/src/assets/'\n    },\n\n    preprocessors: {\n      './test-config/karma-test-shim.js': ['webpack', 'sourcemap']\n    },\n\n    webpack: webpackConfig,\n\n    webpackMiddleware: {\n      stats: 'errors-only'\n    },\n\n    webpackServer: {\n      noInfo: true\n    },\n\n    browserConsoleLogOptions: {\n      level: 'log',\n      format: '%b %T: %m',\n      terminal: true\n    },\n\n    coverageIstanbulReporter: {\n      reports: [ 'html', 'lcovonly' ],\n      fixWebpackSourcePaths: true\n    },\n\n    reporters: config.coverage ? ['kjhtml', 'dots', 'coverage-istanbul'] : ['kjhtml', 'dots'],\n    port: 9876,\n    colors: true,\n    logLevel: config.LOG_INFO,\n    autoWatch: true,\n    browsers: ['Chrome'],\n    singleRun: false\n  };\n\n  config.set(_config);\n};\n"
  },
  {
    "path": "test-config/mocks-ionic.ts",
    "content": "import { StatusBar } from '@ionic-native/status-bar';\nimport { SplashScreen } from '@ionic-native/splash-screen';\n\nexport class PlatformMock {\n  public ready(): Promise<string> {\n    return new Promise((resolve) => {\n      resolve('READY');\n    });\n  }\n\n  public getQueryParam() {\n    return true;\n  }\n\n  public registerBackButtonAction(fn: Function, priority?: number): Function {\n    return (() => true);\n  }\n\n  public hasFocus(ele: HTMLElement): boolean {\n    return true;\n  }\n\n  public doc(): HTMLDocument {\n    return document;\n  }\n\n  public is(): boolean {\n    return true;\n  }\n\n  public getElementComputedStyle(container: any): any {\n    return {\n      paddingLeft: '10',\n      paddingTop: '10',\n      paddingRight: '10',\n      paddingBottom: '10',\n    };\n  }\n\n  public onResize(callback: any) {\n    return callback;\n  }\n\n  public registerListener(ele: any, eventName: string, callback: any): Function {\n    return (() => true);\n  }\n\n  public win(): Window {\n    return window;\n  }\n\n  public raf(callback: any): number {\n    return 1;\n  }\n\n  public timeout(callback: any, timer: number): any {\n    return setTimeout(callback, timer);\n  }\n\n  public cancelTimeout(id: any) {\n    // do nothing\n  }\n\n  public getActiveElement(): any {\n    return document['activeElement'];\n  }\n}\n\nexport class StatusBarMock extends StatusBar {\n  styleDefault() {\n    return;\n  }\n}\n\nexport class SplashScreenMock extends SplashScreen {\n  hide() {\n    return;\n  }\n}\n\nexport class NavMock {\n \n  public pop(): any {\n    return new Promise(function(resolve: Function): void {\n      resolve();\n    });\n  }\n \n  public push(): any {\n    return new Promise(function(resolve: Function): void {\n      resolve();\n    });\n  }\n \n  public getActive(): any {\n    return {\n      'instance': {\n        'model': 'something',\n      },\n    };\n  }\n \n  public setRoot(): any {\n    return true;\n  }\n\n  public registerChildNav(nav: any): void {\n    return ;\n  }\n\n}\n\nexport class DeepLinkerMock {\n\n}"
  },
  {
    "path": "test-config/protractor.conf.js",
    "content": "// Protractor configuration file, see link for more information\n// https://github.com/angular/protractor/blob/master/lib/config.ts\n\nconst { SpecReporter } = require('jasmine-spec-reporter');\n\nexports.config = {\n  allScriptsTimeout: 11000,\n  specs: [\n    '../e2e/**/*.e2e-spec.ts'\n  ],\n  capabilities: {\n    'browserName': 'chrome'\n  },\n  directConnect: true,\n  baseUrl: 'http://localhost:8100/',\n  framework: 'jasmine',\n  jasmineNodeOpts: {\n    showColors: true,\n    defaultTimeoutInterval: 30000,\n    print: function() {}\n  },\n  onPrepare() {\n    require('ts-node').register({\n      project: 'e2e/tsconfig.e2e.json'\n    });\n    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));\n  }\n};\n"
  },
  {
    "path": "test-config/webpack.test.js",
    "content": "var webpack = require('webpack');\nvar path = require('path');\n\nmodule.exports = {\n  devtool: 'inline-source-map',\n\n  resolve: {\n    extensions: ['.ts', '.js']\n  },\n\n  module: {\n    rules: [{\n        test: /\\.ts$/,\n        loaders: [{\n          loader: 'ts-loader'\n        }, 'angular2-template-loader']\n      },\n      {\n        test: /.+\\.ts$/,\n        exclude: /(index.ts|mocks.ts|\\.spec\\.ts$)/,\n        loader: 'istanbul-instrumenter-loader',\n        enforce: 'post',\n        query: {\n          esModules: true\n        }\n      },\n      {\n        test: /\\.html$/,\n        loader: 'html-loader?attrs=false'\n      },\n      {\n        test: /\\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,\n        loader: 'null-loader'\n      }\n    ]\n  },\n\n  plugins: [\n    new webpack.ContextReplacementPlugin(\n      // The (\\\\|\\/) piece accounts for path separators in *nix and Windows\n      /(ionic-angular)|(angular(\\\\|\\/)core(\\\\|\\/)@angular)/,\n      root('./src'), // location of your src\n      {} // a map of your routes\n    )\n  ]\n};\n\nfunction root(localPath) {\n  return path.resolve(__dirname, localPath);\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"allowSyntheticDefaultImports\": true,\n    \"declaration\": false,\n    \"emitDecoratorMetadata\": true,\n    \"experimentalDecorators\": true,\n    \"lib\": [\n      \"dom\",\n      \"es2015\"\n    ],\n    \"module\": \"es2015\",\n    \"moduleResolution\": \"node\",\n    \"sourceMap\": true,\n    \"target\": \"es5\"\n  },\n  \"include\": [\n    \"src/**/*.ts\"\n  ],\n  \"exclude\": [\n    \"node_modules\",\n    \"src/**/*.spec.ts\"\n  ],\n  \"compileOnSave\": false,\n  \"atom\": {\n    \"rewriteTsconfig\": false\n  }\n}\n"
  },
  {
    "path": "tslint.json",
    "content": "{\n  \"rules\": {\n    \"no-duplicate-variable\": true,\n    \"no-unused-variable\": [\n      true\n    ]\n  },\n  \"rulesDirectory\": [\n    \"node_modules/tslint-eslint-rules/dist/rules\"\n  ]\n}\n"
  },
  {
    "path": "typings/cordova-typings.d.ts",
    "content": "\n/// <reference path=\"../.vscode/typings/cordova-ionic/plugins/keyboard.d.ts\"/>\n/// <reference path=\"../.vscode/typings/jquery/jquery.d.ts\"/>"
  }
]