Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test layer #2101

Merged
merged 1 commit into from Dec 15, 2018
Merged

Add test layer #2101

merged 1 commit into from Dec 15, 2018

Conversation

Fetz
Copy link
Contributor

@Fetz Fetz commented Aug 28, 2018

PR Prelude

Thank you for working on SpaceVim! :)

Please complete these steps and check these boxes before filing your PR:

  • I have read and understood SpaceVim's CONTRIBUTING document.
  • I have read and understood SpaceVim's CODE_OF_CONDUCT document.
  • I have updated the Following-HEAD page for this PR.
  • I understand my PR may be closed if it becomes obvious I didn't actually perform all of these steps.

Why this change is necessary and useful?

[Please explain in detail why the changes in this PR are needed.]
This layer allow to run easily tests without getting out of Vim.

I used as example this commit: afcf906

Related issues: https://github.com/SpaceVim/SpaceVim/issues/2099, vim-test/vim-test#316

Done

  • add English docs test layer
  • add on English list layer docs, the test layer
  • add to doc/SpaceVim.txt the new layer
  • add layer to autoload/SpaceVim/layers the test.vim layer

Missing

  • add Chinese docs test layer
  • add on Chinese list layer docs, the test layer

@Fetz Fetz requested a review from wsdjeg as a code owner August 28, 2018 18:03
@codecov
Copy link

codecov bot commented Aug 28, 2018

Codecov Report

Merging #2101 into master will increase coverage by 0.14%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #2101      +/-   ##
==========================================
+ Coverage    25.6%   25.75%   +0.14%     
==========================================
  Files         276      268       -8     
  Lines       13969    13383     -586     
==========================================
- Hits         3577     3447     -130     
+ Misses      10392     9936     -456

@wsdjeg
Copy link
Member

wsdjeg commented Aug 28, 2018

I have tried this layer.

  1. why vim-test use :!cmd instead of job API. Maybe I will fork this plugin. and make some changes. an option for change how test is runner and how to diaplay stdout will be better.

  2. instead of changing statusline, provide a statusline API will be better.

@Fetz
Copy link
Contributor Author

Fetz commented Aug 29, 2018

@wsdjeg thanks for trying the layer.

Regarding the point 1,2 I can't answer those questions since I'm neither a contributor/collaborator of vim-test and as well I'm not so knowledgable with Vim/NeoVim at the moment, maybe in the future :).

I think would be better to ask those questions on their repo issues.

If you fork and for some reason it can't go to the upstream, I can change it to point to your plugin instead.

By the way, one thing that I wanted to have (still looking for some good alternative) is a tool to alternate between code and the tests. I tried to use https://github.com/uptech/alt but it wasn't working for all the cases. There are some similar plugins or possible solutions on this stackoverflow https://stackoverflow.com/questions/9400966/is-there-a-vim-plugin-for-ruby-which-provides-a-switch-to-from-test-command-ou but they don't look ideal or limited to only ruby

@wsdjeg
Copy link
Member

wsdjeg commented Aug 29, 2018

@Fetz SpaceVim has already include this plugin https://github.com/tpope/vim-projectionist

with this plugin, you can manager the your project via .projections.json in the root of your project.

after that, you can use command :A to jump between src and test file.

@Fetz
Copy link
Contributor Author

Fetz commented Aug 29, 2018

@wsdjeg I could add a new mapping to this layer if makes sense

Mode Key Description Function
normal SPC k t toggle between test and implementation :A

@wsdjeg
Copy link
Member

wsdjeg commented Aug 29, 2018

we have already provide key binding for this feature as I know, it should be SPC j a in current version of SpaceVim.

I want to release v0.9.0 in one mouth, I am not sure if we should merged this layer before this release, as I need to rewrite some api of vim-test.

@wsdjeg
Copy link
Member

wsdjeg commented Dec 15, 2018

can you fix the conflictiong files? I will merge this PR.

@wsdjeg wsdjeg merged commit a7863ae into SpaceVim:master Dec 15, 2018
@wsdjeg
Copy link
Member

wsdjeg commented Dec 15, 2018

Thanks.

@Fetz
Copy link
Contributor Author

Fetz commented Dec 15, 2018

You welcome!

@Fetz Fetz deleted the feat/test-layer branch December 15, 2018 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants