nobed
v0.1.9
Published
command line tool to remove testbed from angular typescript spec(s)
Readme
Description
Nobed is a command line tool to remove testbed and related code from angular typescript unit spec(s) to speed up spec runs and remove unncessary setup for unit tests.
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TestComponent } from './test.component';
describe('TestComponent', () => {
let component: TestComponent;
let fixture: ComponentFixture<TestComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TestComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(TestComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});becomes this
import { TestComponent } from './test.component';
describe('TestComponent', () => {
let component: TestComponent;
beforeEach(() => {
component = new TestComponent();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});Installation
yarn add nobed --devUsage
modified and/or untracked spec file(s):
yarn run nobedsingle spec file:
yarn run nobed app/components/notes/notes.component.spec.tsentire directory spec files:
yarn run nobed app/componentsContributing
- make a branch based off master
- make desired code changes
- submit your pull request and assign it to a developer who can ship it
Publishing
- make sure master is up-to-date
npm run patch-release
Issues
https://github.com/callrail/nobed/issues
Reporting Issues
- make sure you are on the latest
nobedversion and runyarn installbefore submitting any tickets - create a new issue in Issues tab
