Skip to content

Commit

Permalink
fix(unit-tests): allow the components to hydrate (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
kensodemann authored and mhartington committed Aug 1, 2019
1 parent 6586dd4 commit 4159e59
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
8 changes: 8 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const micromatch = require('micromatch')
module.exports = {
'*.{ts,tsx}': files => {
const match = micromatch.not(files, '**/__tests__/*.{ts,tsx}')
return match.map(file => 'npm run lint')
}
}

8 changes: 0 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"linters": {
"*.{ts,tsx}": "npm run lint"
},
"ignore": [
"**/__tests__/*.{ts,tsx}"
]
},
"release": {
"branch": "stable",
"verifyConditions": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';

import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';

Expand All @@ -10,16 +10,13 @@ describe('<%= classify(name) %>Component', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
imports: [IonicModule.forRoot()]
}).compileComponents();

beforeEach(() => {
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
});
}));

it('should create', () => {
expect(component).toBeTruthy();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';

import { <%= classify(name) %>Page } from './<%= dasherize(name) %>.page';

Expand All @@ -10,16 +10,13 @@ describe('<%= classify(name) %>Page', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Page ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
imports: [IonicModule.forRoot()]
}).compileComponents();

beforeEach(() => {
fixture = TestBed.createComponent(<%= classify(name) %>Page);
component = fixture.componentInstance;
fixture.detectChanges();
});
}));

it('should create', () => {
expect(component).toBeTruthy();
Expand Down

0 comments on commit 4159e59

Please sign in to comment.