samuelpordeus / vscode-elixir-test Goto Github PK
View Code? Open in Web Editor NEWVisual Studio Code extension to interact with elixir tests
License: MIT License
Visual Studio Code extension to interact with elixir tests
License: MIT License
Hello!
Thanks for the extension. I was wondering if there was a way of saving all files before running? I see myself having to hit save all, all the time before running the tests.
Thanks!
I'm receiving this error whenever I run test at cursor
It would be great to have elixir test available on VSCodium marketplace
Everything is inside one single file, it's becoming hard to maintain this project.
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!
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:
describe
describe "function/artity" do
test "description" do
end
end
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?
Tip π¬:
window.showInformationMessage('content');
Is there an actual way to set a MIX_ENV=test
prefix before the mix test
command?
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.
Discussed on #24
As it is right now, for both commands involving the vs-code terminal, we open a new terminal when there isn't one already opened. But if there is, we don't ensure that it's on the root folder (from the workspace). And that could lead us into trouble.
We need to do something like this:
if not root -> cd to_root
else -> do nothing
Create a command that opens vs-code terminal and run a mix test
on the root folder
When we create a new test file it'll be nice to add a simple template in this file, like:
defmodule Foo.BarTest do
end
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.
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.
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.
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
module.ex
module_test.exs
βοΈmodule_test.exs
module_test_test.exs
βExpected:
module.ex
βοΈThere is a lot of repeated code on the 3 runTest
commands. A refactor would be nice!
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
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.
Create a command that opens vs-code terminal and run on the root folder:
mix test "path-of-the-current-file:line-that-the-cursor-is-on"
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 π
Create a command that opens vs-code terminal and run a mix test "path-of-the-current-file"
on the root folder
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!
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.
There is a shortcut to repeat the last test?
thanks
Hi,
vscode test explorer is a cool extension to visualize the tests.
Is it possible to connected this extension to it ?
Thanks
The value could be editorTextFocus && editorLangId == 'elixir'
Implement integration with mix_test_watcher library to auto test everytime we save the code.
Maybe, we can use the library directly from extension?
The extension stopped working for me, and I believe it was after a VSCodium update.
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)
@GuSilverFlame tried to test it on a simple mix project and it blew everything! π₯
As to enforce a consistent style.
I recently received the update to vscode-elixir-test, and this error happens when I try to run tests:
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.
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:
For that reason, we need to change its name to something more generic, and the chosen name was Elixir Test
!
Love the extension.
I'm running into a bug when I'm using the extension in a vs workspace.
When I jump between implementation and code, the pop-up ("Do you want to create test") shows up every time even though an exist already exists.
When I click create, it switches to the implementation just fine.
See here:
https://recordit.co/NX9OXo8MkL
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.
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?
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
?
If you are willing to solve this issue, update the README as well π¬
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:
vscode-elixir-test/src/commands/jumpToTest.js
Line 100 in c79c607
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.