Skip to content

Commit 4c27a0f

Browse files
committed
test: refactor completions at position into seperate file to enable testing
1 parent 939b552 commit 4c27a0f

15 files changed

+629
-560
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# ignore files that have typescript import
22
typescript/**
33
src/configurationType.ts
4+
src/configurationTypeCache.jsonc
45
playground.ts

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Pull Request CI
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
test:
7+
strategy:
8+
matrix:
9+
os: [ubuntu-latest]
10+
fail-fast: true
11+
runs-on: ${{ matrix.os }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Cache pnpm modules
15+
uses: actions/cache@v2
16+
with:
17+
path: ~/.pnpm-store
18+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
19+
restore-keys: |
20+
${{ runner.os }}-
21+
- uses: pnpm/action-setup@v2.0.1
22+
with:
23+
version: latest
24+
run_install: |
25+
args: [--frozen-lockfile, --strict-peer-dependencies]
26+
- run: pnpm lint
27+
- run: pnpm build
28+
- run: pnpm test-plugin
29+
# - uses: GabrielBB/xvfb-action@v1.6
30+
# with:
31+
# run: pnpm integration-test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ out
1111
.cache
1212
src/generated.ts
1313
src/configurationType.js
14+
src/configurationTypeCache.jsonc
1415

1516
coverage
1617
*.lcov

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"bierner.comment-tagged-templates"
4+
]
5+
}

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
"scripts": {
3434
"start": "vscode-framework start",
3535
"build": "vscode-framework build && node buildTsPlugin.mjs",
36+
"test": "pnpm test-plugin",
37+
"test-plugin": "vitest --globals",
3638
"watch-plugin": "tsc -p typescript -w",
3739
"lint": "eslint src/**"
3840
},
@@ -43,14 +45,17 @@
4345
"@zardoy/tsconfig": "^1.3.1",
4446
"esbuild": "^0.14.38",
4547
"fs-extra": "^10.1.0",
46-
"typescript-essential-plugins": "workspace:*",
48+
"type-fest": "^2.13.1",
4749
"typed-jsonfile": "^0.2.1",
4850
"typescript": "^4.5.4",
51+
"typescript-essential-plugins": "workspace:*",
52+
"vitest": "^0.15.1",
4953
"vscode-manifest": "^0.0.4"
5054
},
5155
"dependencies": {
5256
"@types/lodash": "^4.14.182",
5357
"@vscode/emmet-helper": "^2.8.4",
58+
"@zardoy/utils": "^0.0.6",
5459
"@zardoy/vscode-utils": "^0.0.14",
5560
"chokidar": "^3.5.3",
5661
"eslint": "^8.7.0",

playground.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const replacement = '||'
77
const pos = testString.indexOf(replacement)
88
testString = testString.slice(0, pos) + testString.slice(pos + replacement.length)
99
const filePath = '/test.ts'
10-
const languageService = createLanguageService({
10+
const { languageService } = createLanguageService({
1111
[filePath]: testString,
1212
})
1313

0 commit comments

Comments
 (0)