Skip to content

Commit

Permalink
Merge branch 'lightweightify' of github.com:lathonez/clicker
Browse files Browse the repository at this point in the history
  • Loading branch information
lathonez committed Apr 20, 2016
2 parents 423a473 + 30b1bc9 commit 440ac08
Show file tree
Hide file tree
Showing 34 changed files with 722 additions and 1,050 deletions.
16 changes: 6 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Configuration
# Configuration
#

language: android
Expand All @@ -24,6 +24,7 @@ addons:
- g++-4.8

sudo: required
dist: trusty

branches:
only:
Expand All @@ -40,15 +41,12 @@ before_install:
- sudo apt-get install -y nodejs # android language and can't pick it in yml
- sudo npm update -g npm
- sudo npm install -g cordova ionic
# Everything below here is installing latest chrome
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
- sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- sudo apt-get update
- sudo apt-get install -y google-chrome-stable
# Install the last version of Chrome that supports 12.04, we're stuck here for now because of sudo + android
- wget http://mirror.pcbeta.com/google/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_49.0.2623.87-1_amd64.deb
- sudo dpkg -i google-chrome-stable_49.0.2623.87-1_amd64.deb || true
- sudo apt-get -f install

install:
# Hack for phantom 403
- mkdir /tmp/phantomjs && wget -O /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
- npm install
- ionic state restore # install cordova stuff from package.json
- npm run webdriver-update
Expand All @@ -70,8 +68,6 @@ after_failure:
- cat /home/travis/build/lathonez/clicker/ionic_serve.log

after_success:
# push compiled TS to test folder in git for reference in coveralls
- .travis/push_built_tests.sh
# Send coverage info off to cloud ppl
- cat coverage/lcov.info | ./node_modules/.bin/codecov

Expand Down
22 changes: 0 additions & 22 deletions .travis/push_built_tests.sh

This file was deleted.

204 changes: 204 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
<a name="1.0.0"></a>
# 1.0.0 (2016-04-20)

### Features

* **Unit Test**: [Lightweightify](https://github.com/lathonez/clicker/issues/68) ([commitHash](https://github.com/lathonez/clicker/commit/commitHash))

### BREAKING CHANGES

Lightweightify is a major refactor to the framework. See [the issue](https://github.com/lathonez/clicker/issues/68) for further info.

**The main changes are listed below**
* unit tests are now bundled into `test.bundle.js`
* sourcemaps are now produced @ `test.bundle.js.map`
* coverage is remapped onto source Typescript meaning that transpiled javascript is no longer pushed to `./coverage/source`
* gulpfile.ts has had a [large refactor](https://github.com/lathonez/clicker/commit/3119b92) away from the ng2-seed style and back toward what everyone else seems to be doing
* `app.stub.ts` has been renamed and largely re-written in `app.stub.js`, as was required by a change in the process

**The following files have been removed as they are no longer required**
* .travis/push_built_tests.sh
* coverage/source/**.js
* test/ionic-angular.js
* test/test-main.js

**Migration**

I strongly suggest adopting the new framework as it brings with it many benefits. I will update this if firsthand information is forthcoming
* nuke the `./test` and replace it with the new version. Note that any proxies for external modules in `karma.conig.js` are no longer required, thus there should be no project specifics in that folder
* remove the `export function main()` wrapper from your `*.spec`: [example](https://github.com/lathonez/clicker/commit/f1b72ee)
* merge `package.json` (just for dependencies), some have been removed, some added. Note dependencies are now documented in README.md

Hopefully that should be it.

<a name="0.12.0"></a>
# 0.12.0 (2016-04-13)

### Features

* **Deps**: Merge PR [#71](https://github.com/lathonez/clicker/pull/71) correcting `ionic-gulp-webpack` dependency ([efc9cdf](https://github.com/lathonez/clicker/commit/efc9cdf))
* **Update**: Upgrade deps (angular2, etc) to latest Ionic 2.0.0.beta.4 ([5649061](https://github.com/lathonez/clicker/commit/5649061))

<a name="0.11.0"></a>
# 0.11.0 (2016-03-25)

### Bug Fixes

* **Docs**: Add "two shell windows" to README.md after someone misread it ([69b5ccb](https://github.com/lathonez/clicker/commit/69b5ccb))
* **Travis**: Adding install for Phantom manually to get around this 403 in Travis ([aa6173a](https://github.com/lathonez/clicker/commit/aa6173a))

### Features

* **Update**: Merge PR [#62](https://github.com/lathonez/clicker/pull/62) update to Ionic 2.0.0.beta.3 ([f2f66d9](https://github.com/lathonez/clicker/commit/f2f66d9))

<a name="0.10.1"></a>
# 0.10.1 (2016-03-22)

### Bug Fixes

* **Deps**: Merge PR [#60](https://github.com/lathonez/clicker/pull/60) missing `gulp-util` ([4398038](https://github.com/lathonez/clicker/commit/4398038))

<a name="0.10.0"></a>
# 0.10.0 (2016-03-18)

### Bug Fixes

* **E2E**: Use sendKeys workaround to send delayed keystrokes for randomly failing e2e ([642973d](https://github.com/lathonez/clicker/commit/642973d))
* **Build**: Merge PR [#56](https://github.com/lathonez/clicker/pull/56) remove `;` ([9ecdbf4](https://github.com/lathonez/clicker/commit/9ecdbf4))

### Features

* **Travis**: Testing e2e in Travis ([4a6f5eb](https://github.com/lathonez/clicker/commit/4a6f5eb))
* **Unit Test**: DOM test skeleton for @Page Clicker List ([65bf5d5](https://github.com/lathonez/clicker/commit/65bf5d5))

<a name="0.9.0"></a>
# 0.9.0 (2016-03-12)

### Features

* **Build**: Hook into Ionic's gulpfile directly and remove ionic-app-lib ([6a4b17c](https://github.com/lathonez/clicker/commit/6a4b17c))

<a name="0.8.0"></a>
# 0.8.0 (2016-03-11)

### Features

* **E2E**: Merge PR [#50](https://github.com/lathonez/clicker/pull/50) containing e2e tests with protractor ([440d463](https://github.com/lathonez/clicker/commit/440d463))

<a name="0.7.0"></a>
# 0.7.0 (2016-03-09)

### Bug Fixes

* **Update**: Fixing CSS references broken in upgrade (again) ([40d682c](https://github.com/lathonez/clicker/commit/40d682c))

### Features

* **Update**: Upgrade deps (angular2, etc) to latest Ionic 2.0.0.beta.2 ([1e9cc11](https://github.com/lathonez/clicker/commit/1e9cc11))
* **E2E**: Starting groundwork for e2e testing based on ng2 seed ([36572b6](https://github.com/lathonez/clicker/commit/36572b6))

<a name="0.6.1"></a>
# 0.6.1 (2016-03-06)

### Bug Fixes

* **Build**: Count source and target files in buildlocker rather than relying on existance of a specific file in the target ([6137fd8](https://github.com/lathonez/clicker/commit/6137fd8))

<a name="0.6.0"></a>
# 0.6.0 (2016-03-05)

### Bug Fixes

* **Travis**: Ionic Framework .beta.18 was broken on Travis ([#24](https://github.com/lathonez/clicker/issues/24)), upgrade to .19 ([6003691](https://github.com/lathonez/clicker/commit/6003691))
* **Update**: Upgrade angular2 to beta.9 which supports typescript 1.8.* ([#9](https://github.com/lathonez/clicker/issues/9) ([d46f017])

### Features

* **Build**: Using Ionic's build tools in `ionic-app-lib` ([9005006](https://github.com/lathonez/clicker/commit/9005006))
* **Unit Test**: Enable form tests again after our PR is merged into Ionic ([#12](https://github.com/lathonez/clicker/issues/12)) ([aa726486](https://github.com/lathonez/clicker/commit/aa726486))
* **Build**: Improve workaround for `ionic-angular/index` by creating own references in `ionic-angular.js` ([#27](https://github.com/lathonez/clicker/issues/27)) ([21ba465](https://github.com/lathonez/clicker/commit/21ba465))

<a name="0.5.1"></a>
# 0.5.1 (2016-03-03)

### Bug Fixes

* **Update**: Update webpack css font reference ([#28](https://github.com/lathonez/clicker/pull/28)) ([c333f56](https://github.com/lathonez/clicker/commit/c333f56))

<a name="0.5.0"></a>
# 0.5.0 (2016-03-02)

### Features

* **Build**: Move conifg to `./test` ([#27](https://github.com/lathonez/clicker/issues/26)) ([f78363d](https://github.com/lathonez/clicker/commit/f78363d))
* **Update**: Update to Ionic 2.0.0.beta.1 ([#25](https://github.com/lathonez/clicker/issues/25)) ([67bad59](https://github.com/lathonez/clicker/commit/67bad59))
* **Build**: Use Cordova Hooks to prevent test files from ending up inside the apk ([82be26a](https://github.com/lathonez/clicker/commit/82be26a))

<a name="0.4.0"></a>
# 0.4.0 (2016-02-25)

### Bug Fixes

* **Deps**: Use explicit versioning in npm ([#17]](https://github.com/lathonez/clicker/issues/17)) ([90f677d](https://github.com/lathonez/clicker/commit/90f677d))

### Features

* **Deps**: Dependency Badge ([#13](https://github.com/lathonez/clicker/issues/13)) ([b30e24d](https://github.com/lathonez/clicker/commit/b30e24d))
* **Deps**: Migrate from tsd to typings ([#10](https://github.com/lathonez/clicker/issues/10)) ([120c02e](https://github.com/lathonez/clicker/commit/120c02e))
* **Build**: Move spec to source directory ([#11](https://github.com/lathonez/clicker/issues/11)) ([3d3650f4](https://github.com/lathonez/clicker/commit/3d3650f4))

<a name="0.3.1"></a>
# 0.3.1 (2016-02-24)

### Bug Fixes

* **Build**: Merge PR [#8](https://github.com/lathonez/clicker/pull/8) Fixing test file name ([f524bcf](https://github.com/lathonez/clicker/commit/f524bcf))

<a name="0.3.0"></a>
# 0.3.0 (2016-02-19)

### Bug Fixes

* **Unit Test**: Previously using a bunch of hacks accessing private control variables ([cc5c0a5](https://github.com/lathonez/clicker/commit/cc5c0a5))
* **App**: Need to use one or the other when typing ([cc2d919](https://github.com/lathonez/clicker/commit/cc2d919))

### Features

* **App**: Update tslint to enforce strict typing and change typescript to be strictly typed ([cc2d919](https://github.com/lathonez/clicker/commit/cc2d919))

<a name="0.2.0"></a>
# 0.2.0 (2016-02-18)

### Bug Fixes

* **Unit Test**: Misconfiguration in Karma ([5af7958](https://github.com/lathonez/clicker/commit/5af7958))
* **Unit Test**: Previously using toBeDefined, but they will always be defined! ([d8e1cf5](https://github.com/lathonez/clicker/commit/d8e1cf5))

### Features

* **Unit Test**: Using Angular2's DI to test component's in the DOM ([07f60bf](https://github.com/lathonez/clicker/commit/07f60bf))
* **App**: Utility function should be placed in `.catch` in any promise to debug errors ([0621169](https://github.com/lathonez/clicker/commit/07f60bf))

<a name="0.1.0"></a>
# 0.1.0 (2016-02-17)

### Bug Fixes

* **Update**: CSS was broken in Ionic upgrade ([98c13c4](https://github.com/lathonez/clicker/commit/98c13c4))
* **Update**: Icons were broken in Ionic upgrade ([c954c15](https://github.com/lathonez/clicker/commit/c954c15))

### Features

* **Update**: Upgrade deps (angular2, etc) to Ionic 2.0.0.beta.0 ([830ae8b](https://github.com/lathonez/clicker/commit/830ae8b))
* **App**: Adding MIT License ([a3475cf](https://github.com/lathonez/clicker/commit/a3475cf))

<a name="0.0.1"></a>
# 0.0.1 (2016-01-08)

### Features

* **App**: ([f8865b0](https://github.com/lathonez/clicker/commit/f8865b0))
* **Travis**: Build and deploy using Travis CI ([fb045f6](https://github.com/lathonez/clicker/commit/fb045f6))
* **Unit Test**: Initial unit test set up now working ([04a1028](https://github.com/lathonez/clicker/commit/04a1028))
* **App**: Clickers functionality including local storage ([9d04f8d](https://github.com/lathonez/clicker/commit/9d04f8d))
* **App**: Skeleton app using `ionic start --v2 --ts clickers` ([8bde84f](https://github.com/lathonez/clicker/commit/8bde84f))
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ npm test # run unit tests

## Debug Unit tests
```bash
npm run test.watch # in one window - build all the tests and start watching for changes
npm run watch # in one window - build all the tests and start watching for changes
npm run karma # start karma in debug mode: mutli run Chrome, hit `debug` to get going
```

Expand All @@ -46,5 +46,39 @@ Issues and PRs are welcome, see the [roadmap sticky](https://github.com/lathonez

## Acks

* This project is essentially a fork of [Angular 2 Seed](https://github.com/mgechev/angular2-seed) and would not be possible without it
* @ric9176 and @DanielaGSB for E2E tests (#50)
* This started out as a fork of [Angular 2 Seed](https://github.com/mgechev/angular2-seed) and would not be possible without it
* @bengro for the lightweightify inspiration (#68)
* @ric9176 and @DanielaGSB for E2E tests (#50)
* [Everyone else](https://github.com/lathonez/clicker/graphs/contributors) for the advice, help, PRs etc

## Changelog

See the changelog [here](https://github.com/lathonez/clicker/CHANGELOG.md)

## Dependencies

External dependencies are listed here to justify their inclusion and to enable their removal if you aren't using the related functionality.

* codecov.io: sending unit test coverage reports to codecov.io
* gulp-load-plugins: helper to load other gulp plugins easily
* gulp-rename: rename a file in gulp, used to patch Ionic's app decorator
* gulp-tslint: access tslint from gulp
* gulp-typescript: transpile typescript in gulp
* gulp-util: logging in gulp
* istanbul: unit test coverage reporter
* jasmine-spec-reporter: e2e coverage reporter
* karma: unit test runner
* karma-chrome-launcher: allows using chrome with Karma - chrome is used in Travis
* karma-coverage: unit test coverage reporter
* karma-jasmine: jasmine framework for Karma
* karma-mocha-reporter: mocha progress reporter for Karma
* karma-phantomjs-launcher: allows using phantom with Karma
* phantomjs-prebuilt: phantom headless browser
* protractor: e2e test runner
* remap-istanbul: remap unit test coverage using sourcemaps
* traceur: needed to prevent errors in Phantom
* ts-node: transpile gulpfile
* tslint: static code analysis for typescript
* tslint-eslint-rules: eslint rules plugin for tslint
* typescript: transpile e2e tests
* typings: type definitions manager
46 changes: 21 additions & 25 deletions app/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,30 @@ function getComponentStub(name: string): any {
return component;
}

export function main(): void {
'use strict';

describe('ClickerApp', () => {
describe('ClickerApp', () => {

beforeEach(() => {
let ionicApp: IonicApp = new IonicApp(null, null, null);
let platform: Platform = new Platform();
clickerApp = new ClickerApp(ionicApp, platform);
});
beforeEach(() => {
let ionicApp: IonicApp = new IonicApp(null, null, null);
let platform: Platform = new Platform();
clickerApp = new ClickerApp(ionicApp, platform);
});

it('initialises with two possible pages', () => {
expect(clickerApp['pages'].length).toEqual(2);
});
it('initialises with two possible pages', () => {
expect(clickerApp['pages'].length).toEqual(2);
});

it('initialises with a root page', () => {
expect(clickerApp['rootPage']).not.toBe(null);
});
it('initialises with a root page', () => {
expect(clickerApp['rootPage']).not.toBe(null);
});

it('initialises with an app', () => {
expect(clickerApp['app']).not.toBe(null);
});
it('initialises with an app', () => {
expect(clickerApp['app']).not.toBe(null);
});

it('opens a page', () => {
spyOn(clickerApp['app'], 'getComponent').and.callFake(getComponentStub);
clickerApp.openPage(clickerApp['pages'][1]);
expect(clickerApp['app'].getComponent).toHaveBeenCalledWith('leftMenu');
expect(clickerApp['app'].getComponent).toHaveBeenCalledWith('nav');
});
it('opens a page', () => {
spyOn(clickerApp['app'], 'getComponent').and.callFake(getComponentStub);
clickerApp.openPage(clickerApp['pages'][1]);
expect(clickerApp['app'].getComponent).toHaveBeenCalledWith('leftMenu');
expect(clickerApp['app'].getComponent).toHaveBeenCalledWith('nav');
});
}
});

0 comments on commit 440ac08

Please sign in to comment.