Giter VIP home page Giter VIP logo

avajavascripttestrunnerrunconfigurationgenerator's Introduction

AVA Test Run Configuration Generator

Build Version Downloads

Generates a run configuration for AVA JavaScript test runner

This is a workaround while we wait for proper AVA support, see https://youtrack.jetbrains.com/issue/WEB-21788.

Usage

Place caret inside a test and press ctrl + alt + shift + a.
This should generate and start a new run configuration.
If caret is outside of a test it should generate and start a run configuration for the file.

Plugin source code

Installation

  • Using IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for " AVA Test Run Configuration Generator Changelog " > Install Plugin

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...


Plugin based on the IntelliJ Platform Plugin Template.

avajavascripttestrunnerrunconfigurationgenerator's People

Contributors

actions-user avatar blackhole1 avatar dependabot[bot] avatar eirikb avatar github-actions[bot] avatar umaaz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

avajavascripttestrunnerrunconfigurationgenerator's Issues

Use nearest package for working dir

when install ava to root project, run ava will start from root dir, this is unspected, using npm mode is start from correct working dir, but the dir of test is incorrect(still relative to root project).

image

ava should start from nearest package.json.

[feat request]: support setting

I would like to have a AVA Test Script under the Other Settings category in settings

Because I don't actually expect him to use node_modules/.bin/ava

I want it to be a customizable one so that I can set it to yarn run test:local

Because in my project, I will have a lot of preparation work to do before I do unit testing.

see: https://github.com/netless-io/flat-server/blob/main/package.json#L10


I tried to write a UI, but I gave up... Because I am not familiar with writing UI in java at all.

I spent at least 3 hours on this...

Run configuration for IntelliJ IDEA disappears after IDE restart

First of all - thanks for making this happen as there is no going back to Jest after I started to use AvaJS and I really don't want to switch IntelliJ IDEA🙏

Screenshot 2023-01-05 at 8 10 46

By default the Ava test runner points to node_modules/ava/cli.js which is not found from my npm project even though I've installed the avajs npm module successfully. The avajs executable is found from node_modules/.bin/ava which I've configured in my IDE to be able to run my tests.

However, every time I restart IntelliJ IDEA the default configuration is restore and avajs executable is again pointing to that missing executable node_modules/ava/cli.js. I remember this was working in the past and I didn't have to re-configure after IDE restart.

ava is shell, but plugin treat it as js

pnpm, monorepo, ava 4.3.3

basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1032:15)
    at Module._compile (node:internal/modules/cjs/loader:1067:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)

maybe caused by pnpm inject NODE_PATH

the ava is

#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -z "$NODE_PATH" ]; then
  export NODE_PATH="/ROOT/node_modules/.pnpm/node_modules"
else
  export NODE_PATH="$NODE_PATH:/ROOT/node_modules/.pnpm/node_modules"
fi
if [ -x "$basedir/node" ]; then
  exec "$basedir/node"  "$basedir/../ava/entrypoints/cli.mjs" "$@"
else
  exec node  "$basedir/../ava/entrypoints/cli.mjs" "$@"
fi

AVA 4

In AVA 4, cli.js doesnt seem to exist.

Support IntelliJ 2021.2

In IntelliJ 2021.2 can not search out this plugin in plugin marketplace, and install manually will meets error like:
image

Support WS-222

Installing the version from the store installs version 1.4.1. When trying to install version 1.8.0 from a file, the following error is displayed:

Error example

Plugin doesn't properly support tests with trailing spaces

When I name my test like this: (with a trailing space)

import test from 'ava';

test('name ',async  t => {
  t.is('bar', 'bar');
});

and I try to run it with ava -m "name " it doesn't find the test

  × Couldn’t find any matching tests

To properly run it, you need to pass it without the space: ava -m "name". The plugin should remove the spaces from the test name.

Additionally, when there are two spaces in the test name:

test('foo   bar',async  t => {
  t.is('bar', 'bar');
});

You need to call it with just one space: ava -m "foo bar". Calling it as-is, ava -m "foo bar", then it will fail too.

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.