GithubHelp home page GithubHelp logo

linux-china / vitest-jetbrains-plugin Goto Github PK

View Code? Open in Web Editor NEW
52.0 8.0 6.0 1.85 MB

Vitest JetBrains plugin

Home Page: https://plugins.jetbrains.com/plugin/19220-vitest-runner

License: Apache License 2.0

Kotlin 98.86% TypeScript 1.14%
vitest

vitest-jetbrains-plugin's Introduction

vitest-jetbrains-plugin

Deprecated: from WebStorm 2022.3 Beta, Vitest support by default. Please refer https://blog.jetbrains.com/webstorm/2022/11/webstorm-2022-3-beta/#Vitest_support

A simple WebStorm plugin to run Vitest tests.

  • Green Run icon means to run once only
  • Vitest Run icon to debug test or run test with watch mode
  • Test failure detection to remark run icon as red
  • Vitest json reporter integration by .vitest-result.json file
  "scripts": {
    "test": "vitest --watch",
    "webstorm-integration": "vitest --watch --reporter=dot --reporter=json --outputFile=.vitest-result.json",
  },
  • Vitest toolWindow to display test statistics from .vitest-result.json file

Please install Awesome Console for code link/navigation from console.

How Vitest Runner plugin resolves working directory?

  • If workspaces declared in package.json, and working directory is package's directory.
  • Vitest Runner will resolve proximate package.json for Vitest tested file, and working directory may be project's root directory or subdirectory of subproject.

Attention: for mono repository with subprojects independent, working directory will be subproject's directory, and Vitest Runner will use vite.config.js inside subproject.

Vitest debug support

  • How about --coverage support? Please add c8 dependency in package.json and reopen the project.
{
  "devDependencies": {
   "c8": "^7.12.0"
  }
}

Screenshot

Vitest

Attention

This plugin just a temp solution before official Vitest support from WebStorm. I think JetBrains people will do this job, and they know Vitest is great framework. For Vitest support in WebStorm, please vote here: https://youtrack.jetbrains.com/issue/WEB-54437

Vitest global support

Please enable globals: true for test in Vitest configuration file.

// vite.config.ts
import {defineConfig} from 'vitest/config'

export default defineConfig({
    test: {
        globals: true,
    },
})

Exclude jest: jest is removed from the devDependencies, anyway, jest still resolved and installed by co dependency during npm install. You can use following solution to exclude jest:

"scripts": {
    "postinstall": "rm -rf node_modules/jest*; rm -rf node_modules/@jest"
}

Attention: Please reload(close/open) project if you enable globals: true first time.

Installation

References

vitest-jetbrains-plugin's People

Contributors

actions-user avatar david-mueller avatar ewoelfel avatar linux-china avatar userquin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vitest-jetbrains-plugin's Issues

Not showing up in IntelliJ

Hi,

I just installed the plugin in IntelliJ-Ultimate 2021.3.3 and restarted the idea.
I open up a index.test.tsx or index.spec.tsx but I only see the cypress and jest options to run the test.
The icons as shown in the screenshot do not present themselves, and the run configuration does not show an entry for vitest either. I've tried both version 0.2.1 and 0.2.2 of the plugin.

Am I maybe missing a configuration step?

Gerard.

Version 0.6.1 not working with aliases

when alias used in test - plugin gives error -> "Error: [vite-node] Failed to load @/generated/types"

checked on 0.6.0 - everything is good there. Vitest - latest version.

Config -

test: { alias: { '@': resolve(__dirname, './src'), },

Monorepo issue with workspace directory

Hey @linux-china

First of all, a huge thank you for this marvelous plugin.

In monorepos the cli don't run in the workspace directory but in the root which creates some issues. It's stange because when looking at the code it should actually work: https://github.com/linux-china/vitest-jetbrains-plugin/blob/main/src/main/kotlin/com/github/linuxchina/jetbrains/plugins/vitest/VitestBaseRunLineMarkerProvider.kt#L62

I'm using latest PhpStorm 2022.2.1 with latest vitest plugin.

Tested on this repo: https://github.com/belgattitude/nextjs-monorepo-example.

.
├── apps
│   └── nextjs-app      
│       ├── next.config.mjs
│       ├── package.json        
│       ├── tsconfig.json      
│       └── vitest.config.ts   ## CONFIG FOR  NEXTJS_APP WORKSPACE
│
├── packages
│   ├── core-lib                 
│   │   ├── src/
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   └── tsconfig.json
│   │   └── vitest.config.json   ## CONFIG FOR  CORE_LIB WORKSPACE
│   └── ui-lib                 
├── .yarnrc.yml
└── package.json        

Is it an issue on your side too ?

PS: a picture

image

When running the same command from the cli but in the workspace folder, it works

cd packages/core-lib/
/home/sebastien/.nvm/versions/node/v16.17.0/bin/yarn exec -- vitest -t usePromise packages/core-lib/src/hooks/__tests__/use-promise.test.tsx

No test files found

When add include, cause an exception to trigger:

export default defineConfig({
    test: {
+       // cause an exception to trigger
+       include: ['./playground/**/*.spec.[tj]s'],
        testTimeout: timeout,
        hookTimeout: timeout,
        globals: true,
        reporters: 'dot',
    },
    esbuild: {
        target: 'node14'
    }
})

Error log:

npm exec -- vitest run -t test1 __tests__/auto-script-jsx.spec.js

 RUN  v0.18.1 E:/Desktop/Task/07-cdp-cfe/xzq-vite-plugins/playground/auto-script
-jsx

filter:  __tests__/auto-script-jsx.spec.js
include: ./playground/**/*.spec.[tj]s
exclude:  **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,out
put,temp}/**
watch exclude:  **/node_modules/**, **/dist/**

No test files found, exiting with code 1

More info:

image
image
image

Support for node v14

Hi,
is it possible to support node version 14.x as well with this plugin?
We would love to use this plugin, but cannot easily upgrade our node version yet.

The issue is currently, that your plugin runs the tests as:
npm exec -- vitest run -t "Require Test" tests/unit/main.spec.ts

Which fails with under nodejs v.14:

Usage: npm
where is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, fund, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm -h quick help on
npm -l display full usage info
npm help search for help on
npm help npm involved overview

The working version for node v.14 would be:
npx vitest run -t "Require Test" tests/unit/main.spec.ts

Can you please add support for this?

Yarn 3 no node_modules

When using Yarn 3 package manager with PnP there is no nodes_modules so there is the following error when clicking the vitest icons in IDE

Error running 'vitest -t 'Top bar' src/components/__tests__/the-top-bar.spec.test.ts'

Cannot run program "node_modules/.bin/vitest" (in directory "/home/rom1/Projects/daia-ihm"): error=2, No such file or directory

Configurable vitest config

Thanks for the plugin!

With jest we were able to provide a custom configuration file and custom arguments in the Run/Debug configurations.

Example:
image

The use-case is that we would like to have two different vitest configs, one for unit tests and one for integration tests as they do different things (e.g. integration tests need more global setup + longer test timeouts + other things).

Is it possible to support this in the plugin as well?

Debug-Icon creates wrong config when workspace is other than root

Hey,

thank you for your great work on this. I really like the plugin, however we have a repository that has the frontend-code under /frontend which the plugin does not respect when searching for the node_modules/vitest/vitest.mjs file.
In this case we manually have to add the right directory in the generated config.

[crash] ClassCastException after installing

After I installed the plugin (and did NOT restart WebStorm as I was not prompted to), I opened a test file to see if the plugin was loaded correctly. The run and watch icons took a second to show, then WebStorm reported the following stacktrace in its "IDE Internal Errors" window.

WebStorm 2022.1.1
Build #WS-221.5591.52, built on May 10, 20
Runtime version: 11.0.14.1+1-b2043.45 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
OS: Garuda Linux

java.lang.ClassCastException: class java.lang.String cannot be cast to class com.github.linuxchina.jetbrains.plugins.vitest.AssertionResult (java.lang.String is in module java.base of loader 'bootstrap'; com.github.linuxchina.jetbrains.plugins.vitest.AssertionResult is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @5b8f57ac)
	at com.github.linuxchina.jetbrains.plugins.vitest.ui.VitestTreeCellRender.getTreeCellRendererComponent(VitestToolWindowFactory.kt:132)
	at com.intellij.ui.tree.ui.DefaultTreeUI.getRenderer(DefaultTreeUI.java:166)
	at com.intellij.ui.tree.ui.DefaultTreeUI$2.getNodeDimensions(DefaultTreeUI.java:509)
	at java.desktop/javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:493)
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.updatePreferredSize(VariableHeightLayoutCache.java:1344)
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache.updateNodeSizes(VariableHeightLayoutCache.java:903)
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache.invalidateSizes(VariableHeightLayoutCache.java:371)
	at java.desktop/javax.swing.plaf.basic.BasicTreeUI.setCellRenderer(BasicTreeUI.java:465)
	at java.desktop/javax.swing.plaf.basic.BasicTreeUI$Handler.propertyChange(BasicTreeUI.java:3816)
	at com.intellij.ui.tree.ui.DefaultTreeUI$5.propertyChange(DefaultTreeUI.java:616)
	at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:341)
	at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:333)
	at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:266)
	at java.desktop/java.awt.Component.firePropertyChange(Component.java:8756)
	at java.desktop/javax.swing.JTree.setCellRenderer(JTree.java:776)
	at com.github.linuxchina.jetbrains.plugins.vitest.ui.VitestToolWindowPanel.vitestTree(VitestToolWindowFactory.kt:85)
	at com.github.linuxchina.jetbrains.plugins.vitest.ui.VitestToolWindowPanel.<init>(VitestToolWindowFactory.kt:40)
	at com.github.linuxchina.jetbrains.plugins.vitest.ui.VitestToolWindowFactory.createToolWindowContent(VitestToolWindowFactory.kt:29)
	at com.intellij.openapi.wm.impl.ToolWindowImpl.createContentIfNeeded$intellij_platform_ide_impl(ToolWindowImpl.kt:529)
	at com.intellij.openapi.wm.impl.ToolWindowImpl.scheduleContentInitializationIfNeeded$intellij_platform_ide_impl(ToolWindowImpl.kt:508)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.doShowWindow(ToolWindowManagerImpl.kt:921)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.showToolWindowImpl(ToolWindowManagerImpl.kt:861)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.activateToolWindow$intellij_platform_ide_impl(ToolWindowManagerImpl.kt:586)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.activateToolWindow$intellij_platform_ide_impl$default(ToolWindowManagerImpl.kt:565)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.activated$intellij_platform_ide_impl(ToolWindowManagerImpl.kt:1930)
	at com.intellij.toolWindow.StripeButton$1.actionPerformed(StripeButton.kt:59)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:401)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6654)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
	at com.intellij.toolWindow.StripeButton.processMouseEvent(StripeButton.kt:248)
	at java.desktop/java.awt.Component.processEvent(Component.java:6419)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2793)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:743)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:803)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:119)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Not working with $ in file names

I'm using Vitest with Remix.
In Remix, you should use the $ in the file name to define variables in the URLs.
My files files are called for example: posts.$postId.tsx. So, my test files are called posts.$postId.test.tsx
With that file name, I become the following error:

filter:  app/routes/posts..test.tsx
include: **/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}
exclude:  **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**
watch exclude:  **/node_modules/**, **/dist/**

No test files found, exiting with code 1

As a workaround, I renamed my test file to posts.test.tsx
I believe this can be fixed to avoid the workaround

0.6.6 source branch/ tag missing

The jetbrains plugin marketplace versions show 0.6.6 available but there is no corresponding branch/ tag on repository.

Can you please push/ link source where that is?

support vitest globals

We want to be able to support the way vitest is introduced globally
希望支持全局vitest的方式

vite.config.ts

/// <reference types="vitest" />
/// <reference types="vitest/globals" />
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [vue()],
	test: {
		environment: 'jsdom',
		globals: true,
	},
})

add support for debugging tests

In IntelliJ (or Webstorm), it is possible to debug Jest tests by choosing the debug option from the dropdown menu. This allows you to set breakpoints, step through the code, etc.

Would it be possible to support debugging for Vitest tests?

Using configured nodejs interpreter

This plugin uses the system node js interpreter and does not utilize the project-configured nodejs interpreter. Thus, when my system is version 12 (other projects I work on demand it), vitest will not run as it requires at least 14 (which I have configured in my webstorm project configuration).

Intellisense/Auto-completion

A lot of the jest assertions do not appear in the intellisense/autocompletion, and mark themselves as unresolved functions as per the screenshot below:
image

Is there something more i need to do here to get this to work?

Backticks used within `it()` throws an error while running single `it()`

Hello!
I see an error when I have backtics inside the it() section and I want to run just one test:

  it('should allow to use backticks `here`', () => {
    // test code
  });

As a workaround I need to run whole describe() section (where I'm not using backticks)

npm exec -- vitest run -t "should allow to use backticks `here" src/my-test.tsx
sh: -c: line 0: unexpected EOF while looking for matching ``'
sh: -c: line 1: syntax error: unexpected end of file

Process finished with exit code 2.

image

read `vitest.config` for monorepos

Hi, thank you so much for this

I am reading .env.test files in my tests like this in vitest.config.ts:

import { defineConfig, loadEnv } from "vite"

// noinspection JSUnusedGlobalSymbols
export default defineConfig(({ mode }) => {
  const env = loadEnv(mode, process.cwd(), "")
  Object.assign(process.env, env)
  return {}
})

but my env vars are not loaded when running vitest with this plugin

Any help appreciated

gutter icons only on js and jsx files

Hello, for some reason the icons to start the tests are only displayed in .js and .jsx files. My setup looks like this:

vite.config.js:
test: { globals: true, },

tsconfig.json:
"compilerOptions": { "types": [ "vitest/globals"] }, "include": [ "src", "node_modules/vitest/globals.d.ts" ]

Can't find tests with ' in their names

If I have a test case with name prefixes strings that don't have the prefix yet for example, and then click on run single test button on that test, vitest will quit with

filter:  have, the, prefix, yet packages/web-app/src/shared/helpers/routeHelper.test.ts
include: **/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}
exclude:  **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**
watch exclude:  **/node_modules/**, **/dist/**

No test files found, exiting with code 1 

I assume ' symbol messes up command line arguments somewhere. Why are they not wrapped and is it possible to wrap them, so I don't have to change my test names?

Custom timezone for tests when running from intellij IDEA

I am trying to migrate tests from jest to vitest. For all of my tests I need to use UTC timezone. Currently, I was able to achieve it by TZ=UTC in package.json (refer: vitest-dev/vitest#1575 (comment)).

"scripts": {
    "dev": "vite",
    "serve": "vite preview",
    "build": "vite build",
    "test": "TZ=UTC vitest run",
    "test:watch": "TZ=UTC vitest"
  }

My all the tests pass successfully when I am running the tests from CLI by using npm test. But when it comes to run tests from intellij looks like the tests aren't picking the timezone information from package.json. Is it expected behaviour?

I am using v0.6.6 of vitest runner and IntelliJ IDEA 2022.2.3.

Not working with WSL (Windows Subsystem for Linux)

Hello

It looks like it doesn't work with WSL. I got the following error message:

Cannot run program "\wsl$\Ubuntu\home\mishaa\dev\deepvue\node_modules.bin\vitest.CMD" (in directory "\wsl$\Ubuntu\home\mishaa\dev\deepvue"): CreateProcess error=2, Le fichier spécifié est introuvable

I'm using this template : https://github.com/antfu/vitesse-lite for Vue 3 and Vitest test framework. It's working good with CLI.
I'm under the last version of PHPStorm. Same error with Webstorm.

The basic tere is here :

import { describe, expect, it } from 'vitest'

describe('Hi', () => {
  it('should works', () => {
    expect(1 + 1).toEqual(2)
  })
})

image

image

image

Is it support test at debug mode

I have not tested this plugin at all but want ask you first, is it can run at debug mode or any plan to do it rn?, if so, the plugin so desirable

Problems with debugger

Estou com problemas para rodar o debugger

image

node_modules/vitest/vitest.mjs run --threads false --coverage -t should return an entity with errors src/@core/company/application/use-case/update-company.use-case.spec.ts
Debugger listening on ws://127.0.0.1:45253/92ab3c49-bf70-4b84-bf71-cb5e52b09cba
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
^C
Process finished with exit code 130 (interrupted by signal 2: SIGINT)

Add support for PhpStorm 2023.1

In PhpStorm 2023.1 I get an incompatibility warning:
Incompatible: requires IDE build 223.* or earlier

Can you add support for 2023.1?

Using the test runner in PHPStorm does not work (WSL)

Running npm exec -- vitest run -t test tests/Frontend/Views/HelloWorld.spec.ts works fine as shown below.
image

But when I try to run through the green arrow in the gutter, I get the following error:
image

"CMD.EXE was started with the above path as the current directory."
The command also being run is npm.cmd exec ... instead of npm exec ...

I'm using the latest version of Vitest Runner (0.6.1) and on PhpStorm 2022.1

resolve path is inconsistent

In the first picture, I run from the package through webstorm, and the path is shown in the red box

// package.json
script:{
 test: "vitest"
}

WeChat1213d882640252bd32af69671ee41a29

In the second picture, I run from the vitest icon on the left, and the path is inconsistent with the picture one
1679930238434

When test's description/single one contains `(/)` it is skipped, when `(/` it does not run

IMPORTANT: It's only when I use the plugin and click on the icon to run the tests. When I run them in the terminal, all is fine.


Description

Skipping

I wanted to add some extra info in the description, e.g.:

describe('foo (bar / baz)', () => ...)

Screenshot 2022-09-15 at 19 43 46

When I run it, the whole suite (and tests in it) are skipped.

Not running

When if the description contains only (/ it does not run.

Screenshot 2022-09-15 at 19 43 56

Reproduction

Skipping

import { describe, it, expect } from 'vitest';

describe("Anything (/)", () => {
  it("should not be skipped", () => {
    expect(1).toEqual(2); // <-- it will not fail as the whole suit is skipped
  });
});

describe("It can have more text in it (like/this)", () => {
  it("should not be skipped", () => {
    expect(1).toEqual(2); // <-- it will not fail as the whole suit is skipped
  });
});

Not running

import { describe, it, expect } from 'vitest';

describe("Anything (/", () => {
  it("should run this test", () => {
    expect(1).toEqual(2); // <-- it will not fail as the whole suit is not run
  });
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.