Skip to content

Commit 7b74107

Browse files
committed
feat: add CI workflow for automated testing and update .gitignore
1 parent 395076a commit 7b74107

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

.github/ workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [16.x]
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v2
22+
23+
- name: Set up Node.js
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
28+
- name: Install dependencies
29+
run: npm install
30+
31+
- name: Compile the extension
32+
run: npm run compile
33+
34+
- name: Run tests
35+
run: npm test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ logs/
1010

1111
# VS Code
1212
.vscode/
13+
.vscode-test/
14+
out/
1315

1416
# Build directories
1517
dist/

src/test/extension.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,17 @@ suite('Extension Test Suite', () => {
3737
assert.notStrictEqual(isMagentoProject, undefined, "Settings section 'magentoLogViewer' is not added");
3838
});
3939

40+
test('Extension should prompt if it is a Magento project', async () => {
41+
const configuration = vscode.workspace.getConfiguration('magentoLogViewer');
42+
const isMagentoProject = configuration.get('isMagentoProject');
43+
assert.strictEqual(isMagentoProject, 'Please select', "Extension did not prompt if it is a Magento project");
44+
});
45+
46+
test('Extension should have logo in activity bar', async () => {
47+
const activityBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 100);
48+
activityBarItem.text = '$(magento-logfile-viewer-logo)';
49+
activityBarItem.show();
50+
assert.strictEqual(activityBarItem.text, '$(magento-logfile-viewer-logo)', "Logo is not present in the activity bar");
51+
});
52+
4053
});

0 commit comments

Comments
 (0)