Giter Site home page Giter Site logo

vscode-elixir-test's Introduction

Hi there πŸ‘‹

vscode-elixir-test's People

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

Watchers

 avatar  avatar

vscode-elixir-test's Issues

Handle terminal already running command / multiple terminals

Hi! This extension is super handy!

This is just a small improvement suggestion - I'm not familiar with extension development so I'm not sure how difficult it would be.

Use case

I often have two terminal panes open, and one of them is often already running a command - iex, psql, etc. I'm not sure how this plugin chooses which terminal to use (first, maybe?) but if I execute any of the "run test" commands, it has a chance to try to inject the mix test ... command into my running application.

Suggested changes

  • It would probably be a good idea to have the extension refuse to insert text into a terminal pane when that terminal pane is already running a command (other than the shell). One can imagine potentially disastrous scenarios where commands are executed in unexpected environments.
  • If more than one terminal is open, perhaps loop through the open terminals until a "valid candidate" (i.e., not running another command already) is found.

Support multiple projects

I'm working in a multi-project setting, like so:

root (no mix file)
- ProjectA (mix project)
- ProjectB (mix project)
- ProjectC (no mix project)

When I run the tests in ProjectA or ProjectB I'm getting:
** (Mix) Could not find a Mix.Project, please ensure you are running Mix in a directory with a mix.exs file

I'm assuming this is because it's looking for the mix file in the root.

When I cd into the project directory it works. It's just a shame I have to switch back and forth.

It would be great to support mono repos with multiple mix projects in it.

Thoughts?

Extension opens a different test file

I have the following project structure:

lib/
  api.ex
tools/
  api.ex

The lib/api.ex file doesn't have any test file. But if I try to open it, the extension will open the test for tools/api.ex

Would be convenient to manage the create test template via config

Even just using something like

defmodule <%= @module_name %> do
  @moduledoc """
  Test for `<%= @module_name %>`.
  """
  
  use ExUnit.Case, async: true

  alias <%= @module_name %> 

<% for {module, fun, arity} <- @mfas do %> 
  describe ".<%= fun_name %>/<%= arity %>" do
    test "given valid params" do
      assert <%= @module_alias %>.<%= fun_name %>() == true
    end
  end
<% end>
end

Wrong path separator when running through WSL

I'm on Windows (don't ask) running WSL (with Ubuntu) and VSCode.

As VSCode is running as a Windows application (but using the linux filesystem), the generated path when using the command 'Elixir Test: Run all tests on file' contains all backslashes. This doesn't work as the linux filesystem expects forward slashes.

Is it possible to make the path separator configurable as a setting? Or maybe use the already existing setting explorer.copyRelativePathSeparator?

Create tests

I didn't touch the test suite that the vs-code extensions boilerplate gave me. Would be really nice to have some tests kicking on πŸ˜ƒ

This extension hates the name "testing"

If I have a module in a directory called "testing", vscode-elixir-test wants to create test files in lib/PROJECT/libing.

And then after successfully moving the files to the right directory, trying to jump back runs into the same issue.

Should we change the focus to the terminal?

We always change the focus to the terminal if we run a command to run the tests and at least for my flow where I like to iterate quickly (do a change, run the test, do another change ad infinitum...) is kind of an annoyance to have to focus on the test file.

Maybe we should provide some sort of config for this behavior?

Terminal does not open when running a test

With version 1.8.x, when I try to run a test, the terminal does not open. I have to manually open it in order to see the test run. I like to keep side panels closed when I'm not using them. After downgrading to version 1.7.1, the terminal opens automatically.

Umbrella: run test for individual apps or all apps

When running the test suite on a umbrella app, I want to be able to run mix test in the current app or in the umbrella's root.

I usually run tests for individual apps during development and run tests for the whole project before pushing code.

Run tests in folder

I saw it in the extension Rails Test Runner and I think it'll be a good idea to implement it in this extension as well, take a look:

It appears when I right-click in some folder of the project

image

TypeError: Cannot read properties of undefined (reading 'length')

I recently received the update to vscode-elixir-test, and this error happens when I try to run tests:

CleanShot 2023-11-20 at 16 51 46@2x

In Extension Host:

2023-11-20 16:51:39.616 [error] TypeError: Cannot read properties of undefined (reading 'length')
    at mix (/Users/mstratto/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/helpers/mix.js:7:47)
    at Object.testPath (/Users/mstratto/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/helpers/mix.js:36:10)
    at /Users/mstratto/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/commands/runTestFile.js:5:46
    at Object.onTestFile (/Users/mstratto/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/helpers/test.js:39:17)
    at Object.handler (/Users/mstratto/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/commands/runTestFile.js:5:8)
    at /Users/mstratto/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/extension.js:13:25

Downgrading to version 1.7.1 resolves the problem.

Add to Open VSX Registry

It would be great if this were listed on the Open VSX Registry. This allows other editors such as Oni Vim use the extension. I think anyone can add this to the registry, but this may be something that you want to control.

Consider more "jumps"? Maybe in a new extension?

I just discovered this extension over the weekend and am loving it.

I do wonder if there is value in moving the jumping behavior into it's own extension? Thinking aloud, maybe I'd want to jump from a controller to a view or from a method to a template?

Not sure if I'll have an opportunity to help out but wanted to share my thoughts. Thanks again!

Default keybinding to run tests conflicts with built-in shortcut

On Linux and Windows, the keyboard binding ctrl + shift + k is already mapped by default in VS Code as "Delete Line". I use this shortcut all the time. I'm on Linux.

I just installed the Elixir Test extension and it broke my keybinding.

Consider changing the default keybinding? Otherwise users have to know to re-map it.

Tests do not run - TypeError: Cannot read properties of undefined (reading 'replace')

The extension stopped working for me, and I believe it was after a VSCodium update.

Steps to reproduce

  1. Have VSCodium 1.84.2 and elixir-text 1.8.1 installed.
  2. Try to "Run all tests on file".

Expected behavior

  • Tests should run.

Actual behavior

  • I see an error (under "Extension Host") stating the following:
2023-11-29 23:01:09.229 [error] TypeError: Cannot read properties of undefined (reading 'replace')
    at Re.sendText (vscode-file://vscode-app/opt/vscodium-bin/resources/app/out/vs/workbench/workbench.desktop.main.js:2610:2043)
    at s.$sendText (vscode-file://vscode-app/opt/vscodium-bin/resources/app/out/vs/workbench/workbench.desktop.main.js:1687:61417)

Jump between test file and actual file not working im module name also contains "Test"

When in a file wrong_test_file_extension.ex and trying to jumpo to wrong_test_file_extension_test.exs, it tries to jump somewhere it can't find (probably wrong_file_extension_test.exs ).

It is probably this part of the code that is responsible, since it just assumes that nothing will ever have "_test" in the filename anywhere except an actual test:

const strippedFileName = fileName.replace('_test', '');

Optionally use a preferred terminal

Sometimes I trigger the shortcut to run the test, but my terminal is attached to a iex, tig or something else, and it does not work because it tries to run the mix command inside the iex, for example.

Could the extension open a new terminal when it's the case? It can be an optional flag on the extension config.

Create elixir test snippets

Currently we don't have snippets when typing any test syntax to create tests on elixir.

It would be good to have some snippets when typing describe, or test, for example to already create a block of a test example. Something like:

  • When typing describe
describe "function/artity" do
  test "description" do
  
  end
end

Update "Elixir Jump to Test" extension into "Elixir Test"

Let's pivot our extension and do some epic changes πŸ’₯!

We are planning to add a few more features related to test to this extension:

  • Run test that the cursor is currently on
  • Run all tests on the currently opened file
  • Run the whole test suite

For that reason, we need to change its name to something more generic, and the chosen name was Elixir Test!

Create a logo for the extension

Our beloved extension does not have a logo πŸ™

This StackOverflow answer here explains how to add one.

If you are willing to create a logo and add it, that would be very nice 😬

Open VSX Listing: Signing the Publisher Agreement

Thank you for being part of the Open VSX community by adding your extensions to the Open VSX Registry. Please note that the service was recently transferred to the Eclipse Foundation and urgent action on your part is needed so we can continue to list your extensions. To ensure uninterrupted service, please sign the Eclipse Publisher Agreement as soon as possible.

Regrettably, if not soon, your extensions will be delisted and will no longer appear on the site nor be available via the API. If you sign at a later date, your extensions will then be re-activated. The signing process is explained in the Wiki (steps 1 and 2).

Please also note that all extensions MUST have a license in order to be listed.

Claiming ownership of the namespace for your extension(s): We also recommend you do this. To find out how to do this, see:
https://github.com/eclipse/openvsx/wiki/Namespace-Access

Useful links:
Eclipse Publisher Agreement
Eclipse Foundation Open VSX Registry Frequently Asked Questions (FAQ)

More details are in these recent blog posts:
https://blogs.eclipse.org/post/brian-king/open-vsx-registry-under-new-management
https://blogs.eclipse.org/post/brian-king/new-era-open-vsx-registry

Today, there’s growing momentum around open source tools and technologies that support Visual Studio (VS) Code extensions. Leading global organizations are adopting these tools and technologies. This momentum has spurred demand for a marketplace without restrictions and limitations. Thanks for joining us on this journey as we continue to build the Open VSX community.
We look forward to continued innovation from you in 2021!

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.