Skip to content
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

initial karma webpack #131

Closed
wants to merge 41 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5220cef
initial karma webpack
cescoferraro Aug 13, 2016
770edce
Awesome Typescript dependencie + webpack gulp task
cescoferraro Aug 14, 2016
60a19a0
gulp-util + mistakes
cescoferraro Aug 14, 2016
7615fcf
blank line breaks linting
cescoferraro Aug 14, 2016
2547377
single-run issue
cescoferraro Aug 14, 2016
6dccfdf
test
tja4472 Aug 14, 2016
c0ed6f0
ngrx page added.
tja4472 Aug 14, 2016
c284d7d
downgrade awesome-typescript
cescoferraro Aug 14, 2016
dd1242d
Adding screenshots to e2e tests
chron0 Aug 17, 2016
7156927
Tidying up, readme, CL
lathonez Aug 17, 2016
239e718
Merge branch 'chron0-master'
lathonez Aug 17, 2016
7fa4a20
CL [ci skip]
lathonez Aug 17, 2016
445953c
ngrx stage 1.
tja4472 Aug 19, 2016
2bb6549
ngrx - no storage.
tja4472 Aug 19, 2016
ac85b5c
ngrx with sqlstorage.
tja4472 Aug 20, 2016
f287790
ngrx references added.
tja4472 Aug 20, 2016
d5a6486
Tidy.
tja4472 Aug 20, 2016
66efea7
Merge branch 'ngrx' of C:\VSCode\Ionic2\github\clicker into ngrx
tja4472 Aug 21, 2016
0b09b98
Linting
tja4472 Aug 21, 2016
02be4ca
Update test.
tja4472 Aug 21, 2016
0823756
ngrx references updated.
tja4472 Aug 21, 2016
ab2cd9a
merging ngrx into main app
lathonez Aug 24, 2016
d48362b
Merge branch 'tja4472-ngrx'
lathonez Aug 24, 2016
8fd86e5
CL [ci skip]
lathonez Aug 24, 2016
a3a5d12
readme [ci skip]
lathonez Aug 24, 2016
13cd0b9
single ts modules + TestComponentBuilder + debug
cescoferraro Aug 24, 2016
56fa24a
correct webpack.config.js
cescoferraro Aug 25, 2016
696569c
initial karma webpack
cescoferraro Aug 13, 2016
26b261a
Awesome Typescript dependencie + webpack gulp task
cescoferraro Aug 14, 2016
5b2f295
gulp-util + mistakes
cescoferraro Aug 14, 2016
deb8166
blank line breaks linting
cescoferraro Aug 14, 2016
daff423
single-run issue
cescoferraro Aug 14, 2016
17b22cf
downgrade awesome-typescript
cescoferraro Aug 14, 2016
eb8d970
single ts modules + TestComponentBuilder + debug
cescoferraro Aug 24, 2016
4a85dce
correct webpack.config.js
cescoferraro Aug 25, 2016
2fd4c44
rebased
cescoferraro Aug 25, 2016
95910fa
rebased
cescoferraro Aug 25, 2016
6020f81
linting issues
cescoferraro Aug 25, 2016
808bc23
addProviders can't be called
cescoferraro Aug 25, 2016
f1a9253
isolate failing tests
cescoferraro Aug 26, 2016
cbfb88d
fix addProviders can't be called
cescoferraro Aug 26, 2016
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
64 changes: 32 additions & 32 deletions app/components/clickerButton/clickerButton.spec.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
// import { beforeEach, beforeEachProviders, describe, expect, it } from '@angular/core/testing';
// import { provide } from '@angular/core';
// import { asyncCallbackFactory, injectAsyncWrapper, providers, TestUtils } from '../../../test/diExports';
// import { ClickersServiceMock } from '../../services/mocks';
// import { ClickerButton } from './clickerButton';
// import { ClickersService } from '../../services';
import { beforeEach, beforeEachProviders, describe, expect, it } from '@angular/core/testing';
import { provide } from '@angular/core';
import { asyncCallbackFactory, injectAsyncWrapper, providers, TestUtils } from '../../../test/diExports';
import { ClickersServiceMock } from '../../services/mocks';
import { ClickerButton } from './clickerButton';
import { ClickersService } from '../../services';
// import { TestComponentBuilder } from '@angular/compiler/testing';
// import {addProviders} from '@angular/core/testing';

// this.fixture = null;
// this.instance = null;
this.fixture = null;
this.instance = null;

// let clickerButtonProviders: Array<any> = [
// provide(ClickersService, { useClass: ClickersServiceMock }),
let clickerButtonProviders: Array<any> = [
provide(ClickersService, { useClass: ClickersServiceMock }),

// ];
];

// describe('ClickerButton', () => {
describe('ClickerButton', () => {

// let beforeEachFn: Function = ((testSpec) => {
// addProviders([{ provide: TestComponentBuilder, useClass: null }]);
// testSpec.instance['clicker'] = { name: 'TEST CLICKER' };
// testSpec.instance['clicker'].getCount = function (): number { return 10; };
// });
let beforeEachFn: Function = ((testSpec) => {
// addProviders([{ provide: TestComponentBuilder, useClass: null }]);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting this line make the error go away

testSpec.instance['clicker'] = { name: 'TEST CLICKER' };
testSpec.instance['clicker'].getCount = function (): number { return 10; };
});

// beforeEachProviders(() => providers.concat(clickerButtonProviders));
// beforeEach(injectAsyncWrapper(asyncCallbackFactory(ClickerButton, this, false, beforeEachFn)));
beforeEachProviders(() => providers.concat(clickerButtonProviders));
beforeEach(injectAsyncWrapper(asyncCallbackFactory(ClickerButton, this, false, beforeEachFn)));

// it('initialises', () => {
// expect(this.instance).not.toBeNull();
// });
it('initialises', () => {
expect(this.instance).not.toBeNull();
});

// it('displays the clicker name and count', () => {
// this.fixture.detectChanges();
// expect(this.fixture.nativeElement.querySelectorAll('.button-inner')[0].innerHTML).toEqual('TEST CLICKER (10)');
// });
it('displays the clicker name and count', () => {
this.fixture.detectChanges();
expect(this.fixture.nativeElement.querySelectorAll('.button-inner')[0].innerHTML).toEqual('TEST CLICKER (10)');
});

// it('does a click', (done) => {
// this.fixture.detectChanges();
// this.instance.doClick.subscribe(done);
// TestUtils.eventFire(this.fixture.nativeElement.querySelectorAll('button')[0], 'click');
// });
// });
it('does a click', (done) => {
this.fixture.detectChanges();
this.instance.doClick.subscribe(done);
TestUtils.eventFire(this.fixture.nativeElement.querySelectorAll('button')[0], 'click');
});
});