Skip to content

Commit c4c2252

Browse files
tests: added unit tests
1 parent 4552ed6 commit c4c2252

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

test/extensions.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
'use strict';
2+
3+
const { assert } = require('chai');
4+
const manifest = require('../package.json');
5+
6+
suite('Included Extensions Tests', () => {
7+
const extensions = manifest.extensionPack;
8+
9+
test('Should have the correct number of extensions', () => {
10+
assert.deepEqual(extensions.length, 4);
11+
});
12+
13+
test('Should include Python extension', () => {
14+
assert.isTrue(extensions.includes('ms-python.python'));
15+
});
16+
17+
test('Should include IntelliCode extension', () => {
18+
assert.isTrue(extensions.includes('VisualStudioExptTeam.vscodeintellicode'));
19+
});
20+
21+
test('Should include Python Test Adapter extension', () => {
22+
assert.isTrue(extensions.includes('LittleFoxTeam.vscode-python-test-adapter'));
23+
});
24+
25+
test('Should include Test Explorer extension', () => {
26+
assert.isTrue(extensions.includes('hbenl.vscode-test-explorer'));
27+
});
28+
});

test/metadata.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
'use strict';
2+
3+
const { assert } = require('chai');
4+
const manifest = require('../package.json');
5+
6+
suite('Metadata Tests:', () => {
7+
test('Should have the correct name', () => {
8+
assert.deepEqual(manifest.name, 'python-pack');
9+
});
10+
11+
test('Should have the correct display name', () => {
12+
assert.deepEqual(manifest.displayName, 'Python Extension Pack');
13+
});
14+
15+
test('Should have the correct description', () => {
16+
assert.deepEqual(manifest.description, 'Extension Pack for Python');
17+
});
18+
19+
test('Should have the correct publisher', () => {
20+
assert.deepEqual(manifest.publisher, 'Swellaby');
21+
});
22+
23+
test('Should have correct extension categories', () => {
24+
assert.isTrue(manifest.categories.includes('Extension Packs'));
25+
});
26+
27+
test('Should have correct keywords', () => {
28+
assert.deepEqual(manifest.keywords.length, 1);
29+
assert.isTrue(manifest.keywords.includes('python'));
30+
});
31+
32+
test('Should have the correct icon', () => {
33+
assert.deepEqual(manifest.icon, 'images/icon.png');
34+
});
35+
36+
test('Should have the correct gallery banner', () => {
37+
const galleryBanner = manifest.galleryBanner;
38+
assert.deepEqual(galleryBanner.color.toLowerCase(), '#b7410e');
39+
assert.deepEqual(galleryBanner.theme, 'dark');
40+
});
41+
42+
test('Should have correct VS Code engine', () => {
43+
assert.deepEqual(manifest.engines.vscode, '^1.0.0');
44+
});
45+
});

0 commit comments

Comments
 (0)