Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
svipas committed Dec 4, 2019
1 parent 73f5b5d commit d514bfa
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/test/suite/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@ import * as assert from 'assert';
import { ExtensionData, getAllExtensionsData, getExtensionIdFromDescription } from '../../extension';

suite('Control Snippets', () => {
test('getAllExtensionsData()', () => {
it('returns all values as defined', async () => {
const extensionsData = await getAllExtensionsData();
extensionsData.forEach(ext => {
const isAllValuesDefined = Object.keys(ext).every(key => ext[key as keyof ExtensionData] != null);
assert(isAllValuesDefined, 'missing properties');
});
test('getAllExtensionsData()', async () => {
const extensionsData = await getAllExtensionsData();
extensionsData.forEach(ext => {
const isAllValuesDefined = Object.keys(ext).every(key => ext[key as keyof ExtensionData] != null);
assert(isAllValuesDefined, 'missing properties');
});
});

test('getExtensionIdFromDescription()', () => {
it('returns extension id from description', () => {
const builtin = 'vscode.bat (built-in) 🔋';
assert.strictEqual(getExtensionIdFromDescription(builtin), 'vscode.bat');
const builtin = 'vscode.bat (built-in) 🔋';
assert.strictEqual(getExtensionIdFromDescription(builtin), 'vscode.bat');

const installed = 'ms-vscode.Go (installed) 🔌';
assert.strictEqual(getExtensionIdFromDescription(installed), 'ms-vscode.Go');
});
const installed = 'ms-vscode.Go (installed) 🔌';
assert.strictEqual(getExtensionIdFromDescription(installed), 'ms-vscode.Go');
});
});

0 comments on commit d514bfa

Please sign in to comment.