🧪 A Japa extension for VSCode

Overview

🧪 Japa extension for VSCode


Features

  • Run tests without typing anything. Either with a shortcut, or via Code Lenses
  • Support multiple workspaces
  • Support Javascript, Typescript, ESM, CJS
  • Works with Adonis.js projects using Japa

Demo

Configuration

  • tests.npmScript: The npm script to run when executing tests. Defaults to test

    i.e if you set it to test:unit, the extension will run npm run test:unit --flags when executing tests

  • tests.enableCodeLens: Show CodeLenses above each test. Defaults to true

  • tests.watchMode: Run tests in watch mode when executed via shortcut/codelens. Defaults to false

  • misc.useUnixCd: Use Unix-style cd for windows terminals ( Useful when using Cygwin or Git Bash )

Keybindings

  • ctrl+shift+t: Run the test at the cursor position
  • ctrl+shift+f: Run the test file in the active editor

These keybindings can be easily changed in your VSCode configuration :

  • F1 -> Preferences: Open Keyboard Shortcuts
  • Type japa-vscode in the search bar
  • Change the japa-vscode.runTest or japa-vscode.runTestFile keybindings

Contributing

  • See contributing guide
  • Clone the project and open it in VS Code
  • Run npm install
  • Press F5 to open a new VSCode window with your extension loaded.
  • You can relaunch the extension from the debug toolbar after changing code in src/index.ts.
  • You can also reload (Ctrl+R or Cmd+R on Mac) the VS Code window with your extension to load your changes.
Comments
  • Cannot provide custom file matching pattern

    Cannot provide custom file matching pattern

    When I run my tests from the terminal I can rely on the files param for example like this:

    configure({
      ...processCliArgs(process.argv.slice(2)),
      ...{
        files: ['test/**/*.e2e-spec.ts'],
        ...
      },
    });
    

    But code lenses do not show up on those files because I can't set the same pattern to match for the extension.

    enhancement 
    opened by darioielardi 5
  • Error when executing a test that have a `$` in the title

    Error when executing a test that have a `$` in the title

    @Julien-R44 thank you for the fix, the error is gone, however, when it comes to specific test, it shows "NO TESTS EXECUTED"

    image

    Note: Runnig the test for the entire file works fine.

    Originally posted by @Melchyore in https://github.com/Julien-R44/japa-vscode/issues/1#issuecomment-1235405599

    bug 
    opened by Julien-R44 4
  • Wrongly escape quotes when running a unique test

    Wrongly escape quotes when running a unique test

    Hi,

    I just got bamboozled for a couple of hours by a bug when trying to run a unique test in a file. Here an exemple :

    test("Can't do something", ({ assert }) => {
        assert.isTrue(false)
    })
    

    When clicking the "Run the below test" button, the terminal will execute the command npm run test -- --files "tests/functional/myfile.spec.ts" --tests "Can\'t do something"

    as a result the terminal shows NO TESTS EXECUTED

    Indeed, the right command should be npm run test -- --files "tests/functional/myfile.spec.ts" --tests "Can't do something"

    bug 
    opened by Cobs 2
  • CodeLense buttons do not display anymore

    CodeLense buttons do not display anymore

    Just realized that codelens buttons to execute a test or a group have all disappeared.

    The codeLens option in the settings is still enabled Tried to reinstall the extention but no luck. using version 1.0.1 Any idea why ?

    bug 
    opened by Cobs 1
  • [Suggestion]: Integrate with Test Explorer

    [Suggestion]: Integrate with Test Explorer

    Hi!

    Wouldn't it be nice to have this integrate with the immensely popular plugin Test Explorer UI? There are integrations for every major test framework, so there's plenty of exisiting code to build upon.

    Just leaving this here :)

    opened by juni0r 3
Releases(1.0.1)
  • 1.0.1(Nov 12, 2022)

    When assertion imports were used in a test file, it caused the extension to crash. Like :

    import json from './foo.json' assert { type: 'json' }
    

    This version fixes that

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Sep 27, 2022)

    • Japa snippets from Adonis Vscode extension has been moved in this extension.
    • Fix bug when trying to run a test that contains double quotes

    Full Changelog: https://github.com/Julien-R44/japa-vscode/compare/0.0.7...1.0.0

    Source code(tar.gz)
    Source code(zip)
  • 0.0.7(Sep 8, 2022)

    Tests Explorer

    Your tests are now displayed in the VScode testing tab. This is the first step toward integration with the Testing API. For the moment this is only for navigation. Soon we will be able to run tests directly from this sidebar. image

    Custom glob pattern

    Added this in the extension configuration :

    tests.filePattern: The glob pattern to use when searching for tests. Defaults to **/*.{test,spec}.{ts,js}

    Commits

    • Add tests in testing explorer (c60e874)
    • Add tests.filePattern configuration item (c4f26df)
    Source code(tar.gz)
    Source code(zip)
  • 0.0.6(Sep 6, 2022)

    What's changed

    • Added a command that rerun the last executed test ( F1 > Run Latest test ). Also binded on ctrl+alt+q shortcut
    • Also clear the console before executing test and preserve focus in the text editor
    Source code(tar.gz)
    Source code(zip)
  • 0.0.5(Sep 2, 2022)

    • Fix executing tests titles that contains characters that must be escaped ( like $ or ' )
    • Fix executing tests on PowerShell terminal

    Full Changelog: https://github.com/Julien-R44/japa-vscode/compare/0.0.3...0.0.5

    Source code(tar.gz)
    Source code(zip)
  • 0.0.3(Sep 2, 2022)

    🧪 Introducing the VSCode extension for Japa !

    The extension provides code lenses above each of your tests so that you can run them in one click. Can also run all the tests in the file without typing anything

    Also provide shortcuts for running them quickly. ⚡

    japax_gif

    This works with "raw" Node/Japa projects but also with Adonis.js projects. ESM, CJS, Typescript/Javascript are supported.

    For now, it's pretty simple. But later the idea is to integrate it with the Testing API of VSCode.

    Please note that this is a pre-release. It's very likely that you encounter some issues, so please report them on GitHub !

    Source code(tar.gz)
    Source code(zip)
Owner
Julien Ripouteau
Freelance developer, @adonisjs core member
Julien Ripouteau
A small CLI utility to configure Japa inside an existing Node.js project

A small CLI utility to configure Japa inside an existing Node.js project

Japa.dev 5 Mar 11, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Assertions package for Japa. Built on top of Chai.Assert

@japa/assert Assertion library built on top of Chai.assert An assertion library built on top of Chai.assert with small tweaks and additional features

Japa.dev 7 May 4, 2022
VSCode extension that creates overlay for your Broadcasting Software of choice.

BSOverlay VSCode extension that creates an overlay for your Broadcasting Software of choice. Documentation Please refer to the Wiki Section. Installin

chocoearly44 4 Sep 30, 2022
A vscode extension to quickly print variable, variable type, tensor shape etc by using shortcuts

Quick Python Print This repo is inspired by "Python Quick Print". "Python Quick Print" can quickly print out variables on the console by using shortcu

weida wang 5 Oct 28, 2022
VSCode extension for managing text selection.

Selection Manager This Visual Studio Code extension will allow you to manage selected text. The aim of this extension is to increase productivity by u

Sanel Hadžini 2 Apr 12, 2022
VSCode extension for the rickroll-lang programming language (incomplete)

Rickroll-Lang VSCode Extension The Rick Roll programming language is a rickroll based, process oriented, dynamic, strong, esoteric programming languag

Siddhesh Zantye 6 Oct 10, 2022
NextJS VScode extension to visualize component tree.

Nexus A component tree extension for NextJS Report Bugs · Request Features Table of Contents About The Project Built With Installation Getting Started

OSLabs Beta 62 Nov 24, 2022
JSDoc generator for JavaScript, TypeScript using AI. (VSCode extension)

JSDoc generator for JavaScript, TypeScript using AI. (VSCode extension)

Amir Reza Dalir 3 Aug 18, 2022
💻 VSCode Extension for AdonisJS

?? Official AdonisJS extension for VSCode Features Use all Adonis Assembler commands ( make:* ) Migrate and seed your database ( db:*, migration:* ) V

Julien Ripouteau 50 Nov 9, 2022
VSCode extension with helpful code snippets for SolidJS.

Solid Snippets VSCode extension with helpful code snippets for SolidJS. GET THE EXTENSION Snippets Trigger Content Languages JSX sinput→ Input two-way

SolidJS Community 11 Dec 8, 2022
Optimized dracula theme vscode extension for flutter, web, electron and golang development.

Optimized Dracula Theme A color theme inspired by dracula color theme. This color theme is not based on dracula color theme. The color styles are simi

wuchuran 1 Jul 11, 2022
a vscode extension for http response data auto transform ts type.

Api2ts 这是一个自动将 http 的响应数据转化为 ts 的类型,使用 json-to-ts 做的。 Features 框选配置项后,使用快捷键 alt+Q : 请求参数配置文件 在根目录下创建 Api2ts.config.json 文件,配置项如下: { "baseURL": "http

phy-lei 6 Jun 30, 2022
An enhanced VSCode extension for the Move programming language.

Move Analyzer Plus Provides language support for the Move programming language. Install on the VSCode Extension Marketplace: Move Analyzer Plus on the

The Moving Company 10 Aug 12, 2022
Simple and intuitive API Client made into a VSCode extension 😊

REST API Client Simple and intuitive API Client made into a VSCode extension. Visual Studio Marketplace • Repository • Releases Visual Studio Code ext

REST API Client 19 Dec 23, 2022
🔎 (Draft!) VSCode extension to show the search results in a tree view

vscode-search-tree ?? (Draft!) VSCode extension to show the search results in a tree view The work on this extension is on-pause for now since VSCode

Oleksii Trekhleb 16 Sep 7, 2022
Lightweight VSCode extension for Ruby.

vscode-ruby-light Lightweight VSCode extension for Ruby. Install Install via Visual Studio Marketplace: Ruby Light - Visual Studio Marketplace For Dia

Ryo Nakamura 23 Jan 2, 2023
A VSCode extension to execute terminal command in multiple directories.

SiteFlex ?? Introduction The emergence of microservices and microfrontends posed a real threat on lazy programmers. Consider this scenario, you have m

CuteTN 3 Sep 6, 2022