-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use template.id (which shouldn't change) to detect for equality rather than template.metadata.name (which can and has changed)
- Loading branch information
Showing
7 changed files
with
73 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as assert from 'assert'; | ||
import * as vscode from 'vscode'; | ||
import { Template, TemplateLanguage } from '../src/templates/Template'; | ||
import { TemplateData } from '../src/templates/TemplateData'; | ||
|
||
const templateFilterSetting: string = 'azureFunctions.templateFilter'; | ||
const config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration(); | ||
// tslint:disable-next-line:no-backbone-get-set-outside-model | ||
const oldTemplateFilter: string | undefined = config.get(templateFilterSetting); | ||
|
||
suiteTeardown(async () => { | ||
await config.update(templateFilterSetting, oldTemplateFilter, vscode.ConfigurationTarget.Global); | ||
}); | ||
|
||
suite('Template Data Tests', () => { | ||
const templateData: TemplateData = new TemplateData(); | ||
|
||
test('JavaScript Verified Templates Count', async () => { | ||
await config.update(templateFilterSetting, 'Verified', vscode.ConfigurationTarget.Global); | ||
const templates: Template[] = await templateData.getTemplates(TemplateLanguage.JavaScript); | ||
assert.equal(templates.length, 8); | ||
}); | ||
|
||
test('Java Templates Count', async () => { | ||
const templates: Template[] = await templateData.getTemplates(TemplateLanguage.Java); | ||
assert.equal(templates.length, 4); | ||
}); | ||
}); |