Skip to content

Commit f0237e5

Browse files
committed
added jest test suite and example test
1 parent 3c8a8b7 commit f0237e5

17 files changed

+4860
-1447
lines changed

Diff for: .gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
.DS_Store
12
node_modules
3+
*.log
4+
tmp
5+
6+
# build
27
.vscode-test/
38
*.vsix
9+
dist
10+
11+
# tests
12+
coverage

Diff for: .vscode/launch.json

+26-21
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,30 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
{
66
"version": "0.2.0",
7-
"configurations": [
8-
{
9-
"name": "Extension",
10-
"type": "extensionHost",
11-
"request": "launch",
12-
"runtimeExecutable": "${execPath}",
13-
"args": [
14-
"--extensionDevelopmentPath=${workspaceFolder}"
15-
]
16-
},
17-
{
18-
"name": "Extension Tests",
19-
"type": "extensionHost",
20-
"request": "launch",
21-
"runtimeExecutable": "${execPath}",
22-
"args": [
23-
"--extensionDevelopmentPath=${workspaceFolder}",
24-
"--extensionTestsPath=${workspaceFolder}/test"
25-
]
26-
}
27-
]
7+
"configurations": [
8+
{
9+
"name": "Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"runtimeExecutable": "${execPath}",
13+
"args": [
14+
"--disable-extensions",
15+
"--extensionDevelopmentPath=${workspaceRoot}",
16+
"${workspaceRoot}/test-project"
17+
],
18+
"preLaunchTask": "build"
19+
},
20+
{
21+
"name": "Extension Tests",
22+
"type": "extensionHost",
23+
"request": "launch",
24+
"runtimeExecutable": "${execPath}",
25+
"args": [
26+
"--disable-extensions",
27+
"--extensionDevelopmentPath=${workspaceRoot}",
28+
"--extensionTestsPath=${workspaceRoot}/dist/test"
29+
],
30+
"preLaunchTask": "build"
31+
}
32+
]
2833
}

Diff for: .vscode/tasks.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "build",
8+
// we want to run npm
9+
"command": "npm",
10+
// the command is a shell script
11+
"type": "shell",
12+
// show the output window only if unrecognized errors occur.
13+
"presentation": {
14+
"reveal": "silent"
15+
},
16+
// we run the custom script "compile" as defined in package.json
17+
"args": [
18+
"run",
19+
"build"
20+
],
21+
}
22+
]
23+
}

Diff for: CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# vs-code-toggl-extension
1+
# Changelog - Toggl Extension for VSCode
22

33
All notable changes to this project will be documented here. The format is based
44
on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project

Diff for: README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# vs-code-toggl-extension
1+
# Toggl Extension for VSCode
22

33
Track your working hours in Toggl directly in your VS Code.
44

@@ -34,10 +34,22 @@ the code, you have to execute `Reload Window` to see the changes.
3434

3535
A guide about "Creating a VS Code Extension" can be found [here](https://code.visualstudio.com/api).
3636

37+
## How to test
38+
39+
Either open the debug tab in your VS Code and start the `Extension Test` task,
40+
or run `npm t` in the terminal. When you run it in the terminal, make sure no
41+
other VS Code instance is running.
42+
43+
[Jest](https://jestjs.io/) is used for testing, and the implementation is
44+
[inspired by the Unibeautify/vscode package](https://github.com/Unibeautify/vscode/tree/82e360ff73516c213fea0fa6c2740f0cd53d581b/test).
45+
3746
## Licence
3847

3948
[MIT](./LICENCE)
4049

50+
This extension is not affiliated, associated, authorized, endorsed by or in any
51+
way officially connected to Toggl ([toggl.com](https://toggl.com)).
52+
4153
## Maintainers
4254

4355
<table>

Diff for: babel.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
targets: {
7+
node: 'current',
8+
},
9+
},
10+
],
11+
],
12+
}

Diff for: jsconfig.json

-13
This file was deleted.

0 commit comments

Comments
 (0)