项目作者: yacut

项目描述 :
Test runner for the Atom Editor.
高级语言: JavaScript
项目地址: git://github.com/yacut/tester.git
创建时间: 2017-02-26T19:32:54Z
项目社区:https://github.com/yacut/tester

开源协议:MIT License

下载


Tester

Donate Bitcoin
Build Status
Windows Build Status
APM Version
APM Downloads
GitHub stars
GitHub issues
Dependency Status

Tester is a test runner for the hackable Atom Editor. Additionally, you need to install a specific tester provider for your test framework. You will find a full list below in the Known provider section.

Preview

Base Features

  • IDE based Feedback

    • Gutter test result markers

      gutter-markers

    • In-line error messages

      inline-error

    • Console test output

      console-output

    • Test result view

      result-view

  • Session based test watching

    • Test file on open
    • Test file after save
    • Test project
  • Supported test frameworks (for now):

How to / Installation

You can install through the CLI by doing:

  1. $ apm install tester

Or you can install from Settings view by searching for Tester.

Known providers

Tester API

Example

Declare the provider callback in the package.json.

  1. "providedServices": {
  2. "tester": {
  3. "versions": {
  4. "1.0.0": "provideTester"
  5. }
  6. }
  7. }

Define the provider callback in lib/main.js.

  1. export function provideTester() {
  2. return {
  3. name: 'tester-name',
  4. options: {},
  5. scopes: ['**/test/*.js', '**/*spec.js'],
  6. test(textEditor/* or null to run project tests*/, additionalArgs/* from results views*/) {
  7. // Note, a Promise may be returned as well!
  8. return {
  9. messages: [
  10. {
  11. duration: 1, // duration in ms
  12. error: {
  13. name: 'optional error object',
  14. message: 'something went wrong',
  15. actual: 'optional actual result', // can be an object
  16. expected: 'optional expected result', // can be an object
  17. operator: 'optional operator',
  18. },
  19. filePath: 'file path to highlight',
  20. lineNumber: 1, // line number to highlight
  21. state: 'failed', // 'passed' | 'failed' | 'skipped',
  22. title: 'some test title',
  23. }
  24. ],
  25. output: 'tester console output'
  26. };
  27. },
  28. stop() {
  29. // stop tester if needed
  30. }
  31. };
  32. }

Inspiration

I’d like to give a shout out to Wallaby.js, which is a significantly more comprehensive and covers a lot more editors, if this extension interests you - check out that too.

Contribute

Stick to imposed code style:

  • $ npm install
  • $ npm test

Roadmap

  • add unknown status for test which not ran
  • replace all views with react components (etch)
  • add table view with results similar to nuclide diagnostics
    • sort data by column head click
    • quick set additional args for test runner
    • merge results from each test runner
    • re-sizable columns
    • side by side diff view for expectations
    • go to next/previous test commands
  • add run all project tests command
  • implement Redux and redux-observable for result view
  • serialization