Skip to content

Commit 685fce0

Browse files
committed
add coc-test integration tests and CI
- add integration tests for extension activation, buffer filetype handling and snippet expansion, run through coc-test on nvim/vim - add npm test scripts and GitHub Actions workflow with nvim/vim matrix - add CI status badge to readme and ignore test dir in npm package - export checkBufferVariable and enableSnippetsFiletype for tests - fix TS6 type errors in catch clauses and nvim.call return types
1 parent 16b49ba commit 685fce0

17 files changed

Lines changed: 881 additions & 55 deletions

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
name: coc-test (${{ matrix.editor }})
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
editor: [nvim, vim]
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 22
22+
cache: npm
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Install editors
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y neovim vim
31+
32+
- name: Typecheck
33+
run: npm run lint
34+
35+
- name: Integration tests (${{ matrix.editor }})
36+
run: npm run test:integration:${{ matrix.editor }}

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
src
22
*.map
33
tsconfig.json
4-
tests
4+
test
55
.ignore
66
yarn.lock
77
esbuild.js

Readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Snippets solution for [coc.nvim](https://github.com/neoclide/coc.nvim)
44

5+
[![CI](https://github.com/neoclide/coc-snippets/actions/workflows/ci.yml/badge.svg)](https://github.com/neoclide/coc-snippets/actions/workflows/ci.yml)
6+
57
![2019-03-23 00_09_39](https://user-images.githubusercontent.com/251450/54837017-62891300-4d00-11e9-9e53-49742a1a33f2.gif)
68

79
_Snippet preview requires [neovim 0.4 or latest vim8](https://github.com/neoclide/coc.nvim/wiki/F.A.Q#how-to-make-preview-window-shown-aside-with-pum)_

0 commit comments

Comments
 (0)