Skip to content

Instantly share code, notes, and snippets.

@xtreme-steve-elliott
xtreme-steve-elliott / Steve_s Custom Live Templates.xml
Last active June 19, 2020 17:18
IntelliJ Live Templates for generating: - TypeScript describe block with basic test, TestBed and fixture.detectChanges() - JUnit 5 test class w/ display name - JUnit 5 nested class w/ display name, - JUnit 5 test w/ display name. Place it in the `/templates` directory of your IntelliJ and restart.
<templateSet group="Steve's Custom Live Templates">
<template name="cdescr" value="import {async, ComponentFixture, TestBed} from '@angular/core/testing';&#10;import {NoopAnimationsModule} from '@angular/platform-browser/animations';&#10;&#10;describe($CLASS_NAME$.name, () =&gt; {&#10; let component: $CLASS_NAME$;&#10; let fixture: ComponentFixture&lt;$CLASS_NAME$&gt;;&#10;&#10; beforeEach(async(() =&gt; {&#10; TestBed.configureTestingModule({&#10; declarations: [&#10; $CLASS_NAME$&#10; ],&#10; providers: [],&#10; imports: [&#10; NoopAnimationsModule&#10; ]&#10; }).compileComponents();&#10; }));&#10;&#10; beforeEach(() =&gt; {&#10; fixture = TestBed.createComponent($CLASS_NAME$);&#10; component = fixture.componentInstance;&#10; fixture.detectChanges();&#10; });&#10;&#10; it('should create', () =&gt; {&#10; expect(component).toBeTruthy();&#10; });&#10;});&#10;