npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@yaegassy/coc-vitest

v0.3.0

Published

Vitest for coc.nvim

Downloads

19

Readme

coc-vitest

Vitest for coc.nvim

coc-vitest-demo

Install

CocInstall:

:CocInstall @yaegassy/coc-vitest

scoped packages

vim-plug:

Plug 'yaegassy/coc-vitest', {'do': 'yarn install --frozen-lockfile'}

Configuration options

  • vitest.enable: Enable coc-vitest extension, default: true
  • vitest.terminal.enableSplitRight: Use vertical belowright for vitest terminal window, default: false
  • vitest.codelens.enable: Enable codelens, default: true
  • vitest.codelens.title: CodeLens title. Can be changed to any display, default: ">> [Run Vitest]"
  • vitest.watch: Run tests in watch mode, default: false

Commands

:CocCommand [CommandName]

e.g.: :CocCommand vitest.projectTest

  • vitest.projectTest: Run Vitest for current project
  • vitest.fileTest: Run Vitest for current file
  • vitest.singleTest: Run Vitest for single (nearest) test

Example of Vim command and key mapping:

Vim commands can be defined and executed or key mappings can be set and used.

" Run Vitest for current project
command! -nargs=0 Vitest :call CocAction('runCommand', 'vitest.projectTest')

" Run Vitest for current file
command! -nargs=0 VitestCurrent :call  CocAction('runCommand', 'vitest.fileTest', ['%'])

" Run Vitest for single (nearest) test
nnoremap <leader>te :call CocAction('runCommand', 'vitest.singleTest')<CR>

CodeLens (Neovim only)

Feature:

CodeLens appears above the test name in the *.test.ts and *.spec.ts files. Currently, import.meta.vitest is not supported.

coc-settings.json:

By default, codeLens.enable is set to false, which disables it.

Change the setting to true to enable it.

{
  "codeLens.enable": true
}

Example key mapping (CodeLens related):

nmap <silent> gl <Plug>(coc-codelens-action)

Misc:

"CodeLens" does not work with "Vim8" due to coc.nvim specifications.

vitest.singleTest commands are available, so please use them.

Similar coc.nvim extension

Thanks

License

MIT


This extension is built with create-coc-extension