-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change test templates to be without TestBed
* Add option to use test bed templates for specs * By default use templates with no test bed for better performance and focus on unit testing functions * Add a more generic arrayUnionOverride function to use in generator. * Update readme and contributing * Update package version and changelog
- Loading branch information
1 parent
5ad14d6
commit 0c895e9
Showing
16 changed files
with
194 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
// Settings | ||
// From package.json/contributes/configuration/properties | ||
import * as vscode from 'vscode'; | ||
|
||
export const getSetting_customTemplateFolder = () => | ||
getExtensionSetting<string | null | undefined>('customTemplateFolder'); | ||
|
||
export const getSetting_defaultSpecsUseTestBed = () => | ||
getExtensionSetting<boolean | undefined>('defaultSpecsUseTestBed'); | ||
|
||
export const getSetting_generateSpec = () => | ||
getExtensionSetting<boolean | undefined>('generateSpec'); | ||
|
||
export const getSetting_generateStories = () => | ||
getExtensionSetting<boolean | undefined>('generateStories'); | ||
|
||
function getExtensionSettings(): vscode.WorkspaceConfiguration { | ||
return vscode.workspace.getConfiguration('angular-files-generator'); | ||
} | ||
|
||
function getExtensionSetting<T>(settingKey: string): T | undefined { | ||
return getExtensionSettings().get(settingKey); | ||
} | ||
|
||
function getExtensionSettings(): vscode.WorkspaceConfiguration { | ||
return vscode.workspace.getConfiguration('angular-files-generator'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; | ||
|
||
import { {{upperCamelCaseName}}Component } from './{{dashCaseName}}.component'; | ||
import { {{upperCamelCaseName}}Module } from './{{dashCaseName}}.module'; | ||
|
||
describe('{{upperCamelCaseName}}Component', () => { | ||
let component: {{upperCamelCaseName}}Component; | ||
let fixture: ComponentFixture<{{upperCamelCaseName}}Component>; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [{{upperCamelCaseName}}Module], | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent({{upperCamelCaseName}}Component); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; | ||
|
||
import { {{upperCamelCaseName}}Directive } from './{{dashCaseName}}.directive'; | ||
|
||
describe('{{upperCamelCaseName}}Directive', () => { | ||
let directive: {{upperCamelCaseName}}Directive; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [{{upperCamelCaseName}}Directive], | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
directive = TestBed.inject({{upperCamelCaseName}}Directive); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(directive).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { {{upperCamelCaseName}}Module } from './{{dashCaseName}}.module'; | ||
|
||
describe('{{upperCamelCaseName}}Module', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [{{upperCamelCaseName}}Module], | ||
}); | ||
}); | ||
|
||
it('should create', () => { | ||
const module: {{upperCamelCaseName}}Module = TestBed.inject({{upperCamelCaseName}}Module); | ||
expect(module).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { {{upperCamelCaseName}}Service } from './{{dashCaseName}}.service'; | ||
|
||
describe('{{upperCamelCaseName}}Service', () => { | ||
let service: {{upperCamelCaseName}}Service; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject({{upperCamelCaseName}}Service); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.