Skip to content

Commit d5b8ced

Browse files
committed
test: Add integration tests
Just a dummy for now
1 parent 4224dc5 commit d5b8ced

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

.devcontainer/Dockerfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22

33
# Instructions:
44
# docker build -t vscode-qttest .
5-
# docker run -it -v /data/sources/copilot/vscode-qttest/:/vscode-qttest/ --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --ulimit nofile=1024:4096 -u 1000:1000 vscode-qttest
5+
# docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -v /data/sources/copilot/vscode-qttest/:/vscode-qttest/ --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --ulimit nofile=1024:4096 -u 1000:1000 vscode-qttest
66
# cd /vscode-qttest/
77

88
FROM ubuntu:23.04
99
MAINTAINER Sergio Martins ([email protected])
1010

1111
ENV TZ=Europe/Berlin
1212
ENV LC_CTYPE=C.UTF-8
13+
ENV DISPLAY=:0
1314

1415
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
1516

1617
## Installs node 18v
17-
RUN apt update -qq && apt install build-essential software-properties-common lld git cmake ninja-build nodejs qtbase5-dev qt5-qmake -y
18+
RUN apt update -qq && apt install build-essential software-properties-common lld git cmake ninja-build nodejs qtbase5-dev qt5-qmake libnss3-dev -y
1819
RUN apt install npm -y
1920

2021
# Install tsc globally, for convenience
@@ -24,3 +25,5 @@ RUN npm install typescript -g
2425
# RUN npm install yo generator-code -g
2526

2627
RUN npm install @vscode/vsce -g
28+
29+
RUN apt install libasound2-dev -y

.vscode-test.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const { defineConfig } = require('@vscode/test-cli');
2+
3+
module.exports = defineConfig({ files: 'out/test/**/*.test.js' });

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"compile": "tsc -p ./",
2626
"watch": "tsc -watch -p ./",
2727
"pretest": "npm run compile && npm run lint",
28-
"lint": "eslint src --ext ts"
28+
"lint": "eslint src --ext ts",
29+
"test": "vscode-test"
2930
},
3031
"devDependencies": {
3132
"@types/glob": "^8.0.1",

src/test/suite/extension.test.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as assert from 'assert';
2+
import * as vscode from 'vscode';
3+
4+
suite('Extension Test Suite', () => {
5+
suiteTeardown(() => {
6+
vscode.window.showInformationMessage('All tests done!');
7+
});
8+
9+
test('Sample test', () => {
10+
assert.strictEqual(-1, [1, 2, 3].indexOf(5));
11+
assert.strictEqual(-1, [1, 2, 3].indexOf(0));
12+
});
13+
});

0 commit comments

Comments
 (0)