Comments (11)
I would be interested it looking into what automated testing could be applied.
from spaceship-prompt.
shunit2 seems to be a good option. bhilburn/powerlevel9k theme has a test suit with shunit2. There is also a discussion about testing themes in here by @denysdovhan
Huge change to theme is being developed with #78 . So, It might be better to hold off testing until it's merged.
from spaceship-prompt.
I'm not sure about unit testing library. Don't know how to implement tests properly. Actually, I was wondering about creating unified code base in one of high level scripting languages, like Python or JavaScript. Beside single code base there should be a loaders (adapters) for different shells. On my opinion, with that approach we can achieve few important benefits:
- single code base
- additional support of other shells
- better language (to be honest, zsh is not an example of good language)
- tests
- async operation -> performance
That's just an idea, but here is my attempt with default Oh-My-Zsh theme — robbyrussell. What do you think?
from spaceship-prompt.
@denysdovhan what is the speed like with the rewritten JS version of robbyrussel?
from spaceship-prompt.
@jwkicklighter we didn't achieve significant performance speed up.
from spaceship-prompt.
@salmanulfarzy @maximbaz I'd like to pay your attention to this issue since it should have top priority for us. Spaceship has a lot of sections and it's easy to break something without noticing. We should finally find the way to test Spaceship at least for basic functionality.
from spaceship-prompt.
@denysdovhan I was more concerned with it being less performant, which I guess it isn't based on your comment
from spaceship-prompt.
I've no idea where to begin from and what to test. There isn't much to take reference from prompts that are tested. But following the powerlevel9K path, Made a single passing test about char
section and confused about how to proceed. If this the right approach, I can make a WIP pull request that we can further work.
ZUnit looks promising with powerful assertion library for Zsh specific testing. I haven't worked on this yet.
from spaceship-prompt.
@salmanulfarzy your example of tests for chat
section LGTM. I would prefer to use shunit
since it's more trusted and battle-tested. Can you give any advantages of using Zunit?
from spaceship-prompt.
I'm actively working on writing tests for all sections that have been ported from spaceship to spacefish so far.
If it would help get this PR started, I encourage you to port over our tests, which should cover the same functional use cases: https://github.com/matchai/spacefish/tree/master/tests
from spaceship-prompt.
Follow #458 for updates.
from spaceship-prompt.
Related Issues (20)
- spaceship::precompile:zcompile:6: can't open file: /usr/local/lib/node_modules/spaceship-prompt/prompt_spaceship_setup HOT 2
- Spaceship v.4.13.4 shows closing curly bracket } at the beginning of the prompt HOT 2
- Not showing any icon, even git branch name is not showing HOT 7
- package section is broken for python packages HOT 4
- I have a problem displaying the icons. HOT 1
- spaceship CLI repeatedly adds sections HOT 1
- Git User HOT 8
- Async section never goes away HOT 2
- Repurpose Xcode and Swift sections to use native tools HOT 6
- Multiple errors printed before prompt
- configuration docs lead to the creation of a directory `~/.config/spaceship.zsh` HOT 2
- python section not working HOT 3
- Prompt truncated at start
- Command not found: spaceship.zsh
- Prompt in Warp: bash: _ _ bp_interactive_mode: command not found HOT 1
- "📦 unspecified" for Android project using gradle with kts and version catalog
- Duplicate Git Branch Icons
- The repository FAQ clearly show starship stance of standing with Ukraine... Where is there stance for Palestine ? HOT 1
- Parent directory completion blanks out
- SPACESHIP_KUBECTL_SHOW causes duplicate characters in prompt HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spaceship-prompt.