nobed
v0.1.9
Published
command line tool to remove testbed from angular typescript spec(s)
Downloads
5
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 --dev
Usage
modified and/or untracked spec file(s):
yarn run nobed
single spec file:
yarn run nobed app/components/notes/notes.component.spec.ts
entire directory spec files:
yarn run nobed app/components
Contributing
- 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
nobed
version and runyarn install
before submitting any tickets - create a new issue in Issues tab