Giter Site home page Giter Site logo

wwestrop / litmus Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.33 MB

The cross-platform, graphical unit test runner for Javascript

Home Page: https://litmus-js.app/

License: MIT License

TypeScript 84.30% HTML 3.92% CSS 11.78%
typescript javascript testing unit-testing testing-tools electron desktop-application

litmus's Introduction

Litmus

Litmus main user interface

Rationale

Many modern JS frameworks need configuration or other orchestration as part of a build chain. There can be quite a steep learing curve, which can be overwhelming, if not outright demotivating, to someone just starting out. Litmus is aimed at being as easy as possible to just "get up and go" and begin testing a Javascript project; without having to understand and configure a stack of tools.

There are a great many command-line test runners available on the web, but no visual test runners that I am aware of. A command line interface is another barrier-to-entry that I wanted to elimate. As I'm unaware of a visual runner being attempted, I wanted to see if such a thing could work in practice.

Finally, it is also a chance for me to experiment with and learn more about web technologies, cross-platform development, and the wider Javascript ecosystem in general.

Developer quick-start

npm install
npm run build
npm start

When setting the environment variable LITMUS_DEV:

  • DevTools will be available in the UI (keyboard shortcut F12)
  • The background test runner window will be visible and available for debugging (via the DevTools)

Testing

Simply run Litmus, and select the project directory. Voilà, Litmus will find and run the tests, and display the outcome on the screen for you.

Or, you can run this command if you prefer the old-fashioned way ;)

npm run test

Litmus's own tests are pretty bad at the moment 😱 (though I hope to change this soon). I've been more concerned with getting things working and experimenting with ideas.

Hanging builds

This unfortunately sometimes happens 😭. This can require multiple retries, and if that doesn't work, try removing the .cache directory and running npm run build again.

Packaging for distribution

npm run pack

This command will produce a distributable package suitable for whichever operating system the command is being run on (EXE, DMG, or AppImage)

Architechture overview

Limtus is written in Typescript, and built upon Electron.

The app has three "threads" of execution runnng at all times, which have the following entry points:

  • index.ts - Electron main process. Handles interaction with the OS.
  • ui/index.html - Main Window UI. Mostly plain HTML and (transpiled) Javascript. A couple of pieces are React components.
  • ui/backgroundTestRunnerWorker.html - An invisible window that hosts the test runner process. As test results become available, they are pushed to the main UI (index.html) for rendering.

Changelog

0.1.3 Unreleased

  • Factored TestRunner to report progress more granularly
  • UI polish (per-test throbbers against slow-running tests, stale test indication)
  • Visible warning when all tests are filtered out of view by the selected filter
  • Higher resolution graphics for high-density screens
  • Recently tested projects list (also displayed on Taskbar jumplist)
  • Build improvement (compilation most likely to fail, so moved first; stopped linting, it's not providing value)

0.1.2

  • Tests which fail during the beforeEach hook show up correctly
  • Cancellable test runs (keyboard shortcut Esc)
  • Added UI zoom control (keyboard shortcut Ctrl+Shift+- and Ctrl+Shift++)
  • Right-click context menu added to test results tree
  • Controls showing as disabled when appropriate
  • Misc UI polish (tooltips, animation, extra keybindings, more responsive status display)

0.1.1

  • Linux packaging

0.1.0

  • Initial MVP. Windows only.
  • Runs Mocha tests and displays the results.
  • Taskbar progress indicator
  • Searching, filtering, and grouping are working.
  • ** Very much a work in progess **

litmus's People

Contributors

wwestrop avatar

Watchers

 avatar  avatar

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.