Skip to content

Create angular schematics for shallow-render #76

Closed
@mihalcan

Description

@mihalcan

I'd like to propose to add Angular schematics, so when you create a component with Angular CLI, instead of a default spec file, a shallow-render spec file is generated.

Let's say you execute: ng g c app/shallow-component
It would generate the following spec file:

import { ShallowComponentComponent } from './shallow-component.component';
import { AppModule } from './app.module';
import { Shallow } from 'shallow-render/dist';

describe('ShallowComponentComponent', () => {
  let shallow: Shallow<ShallowComponentComponent>;

  beforeEach(() => {
    shallow = new Shallow(ShallowComponentComponent, AppModule);
  });

  it('should create', async () => {
    const { instance } = await shallow.render();
    expect(instance).toBeTruthy();
  });
});

@getsaf If you are interested, I can help with a PR as I have got a working solution already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions