GithubHelp home page GithubHelp logo

dreamscapes / atom-ide-mocha Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 224 KB

Integrate Mocha progress into Atom-IDE-UI โ˜•๏ธ + โš›๏ธ = ๐Ÿš€

Home Page: https://atom.io/packages/ide-mocha

License: BSD 3-Clause "New" or "Revised" License

JavaScript 20.09% Makefile 44.20% Shell 35.71%
atom atom-ide atom-package javascript mocha mocha-reporter

atom-ide-mocha's People

Contributors

robertrossmann avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

atom-ide-mocha's Issues

Forward `stdout` & `stderr` to Atom

Is your feature request related to a problem? Please describe.

Sometimes the test suite produces logs relevant to test failures via custom logs, either to stdout or stderr streams. These streams are not captured by Mocha and are instead shown in the parent terminal window. This makes debugging harder to follow since the user must remember to look into that window to see the additional logs. This package somewhat sets the expectations that everything that's produced during test suite execution will be shown in Atom's Console UI.

Describe the solution you'd like

We might be able to capture the output streams when Mocha runs and send them over to Atom as custom events.

Uncaught SyntaxError: Unexpected end of JSON input

Atom: 1.34.0-beta0 x64
Electron: 2.0.14
OS: Mac OS X 10.14.1
Thrown From: ide-mocha package 1.4.1

Stack Trace

Uncaught SyntaxError: Unexpected end of JSON input

At events.js:183

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at JSONParser._transform (/packages/ide-mocha/node_modules/remote-event-emitter/src/consumer/deserialisers/json-parser.js:21:19)
    at JSONParser.Transform._read (_stream_transform.js:186:10)
    at JSONParser.Transform._write (_stream_transform.js:174:12)
    at doWrite (_stream_writable.js:387:12)
    at writeOrBuffer (_stream_writable.js:373:5)
    at JSONParser.Writable.write (_stream_writable.js:290:11)
    at Deserialiser.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at Deserialiser.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Deserialiser.Readable.push (_stream_readable.js:208:10)
    at Deserialiser.Transform.push (_stream_transform.js:147:32)
    at done (_stream_transform.js:208:12)
    at _flush (_stream_transform.js:138:7)
    at Deserialiser._flush (/packages/ide-mocha/node_modules/remote-event-emitter/src/consumer/deserialisers/deserialiser.js:44:19)
    at Deserialiser.prefinish (_stream_transform.js:137:10)
    at emitNone (events.js:106:13)
    at Deserialiser.emit (events.js:208:7)
    at prefinish (_stream_writable.js:593:14)
    at finishMaybe (_stream_writable.js:601:5)
    at endWritable (_stream_writable.js:612:3)
    at Deserialiser.Writable.end (_stream_writable.js:563:5)
    at Socket.onend (_stream_readable.js:595:10)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at Socket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1056:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Commands

     -1:05.9.0 core:save (input.hidden-input)
     -0:43.8.0 editor:toggle-line-comments (input.hidden-input)
     -0:43.5.0 core:save (input.hidden-input)
  2x -0:22.7.0 datatip:toggle (input.hidden-input)
     -0:22.3.0 pane:show-next-item (input.hidden-input)
     -0:22.1.0 datatip:toggle (input.hidden-input)
  3x -0:20.1.0 core:move-down (input.hidden-input)
     -0:19.2.0 core:close (input.hidden-input)
     -0:18.4.0 datatip:toggle (input.hidden-input)
  2x -0:18.3.0 pane:show-previous-item (input.hidden-input)
     -0:18 datatip:toggle (input.hidden-input)
     -0:16.5.0 core:save (input.hidden-input)
  3x -0:15.7.0 core:undo (input.hidden-input)
     -0:14.4.0 core:redo (input.hidden-input)
     -0:13.8.0 core:save (input.hidden-input)
  2x -0:12.8.0 core:move-down (input.hidden-input)

Timed-out tests result in empty message in the console

Describe the bug

Timed-out tests result in empty message in the console.

To Reproduce
Steps to reproduce the behavior:

  1. Run the suite
  2. Have a test to time out
  3. Observe empty error message in the console

Expected behavior

A message "test timed out" should appear, or at least something more meaningful

Screenshots

screenshot 2018-11-23 at 09 21 49

Observe configuration changes and act on them

Changing something in configuration has no effect on current session and a window reload is required. Hook into Atom's config observers and update settings when something changes.

Use atom.project.onDidChangePaths() and update sockets for all of them

Only the top-most project folder is used at this time, and a socket is also created only for this folder. For windows with multiple projcect folders added this is not ideal.

Also, sometimes it could happen that Atom returns an empty array in atom.project.getPaths() when IDE-Mocha is activated, which results in a deprecation warning and a socket with weird name.

Configurable level of log verbosity

We are sending all the data over the socket to Atom but we can allow users to customise the log verbosity in the console:

  • full - show everything (current state)
  • min - show only final summary
  • silent - show only errors. Users will rely on Busy spinner to monitor progress.
  • suite - show only suite titles

Console should not steal focus

Describe the bug
When I save a document and my tests are run, the console pops up and steals my focus

To Reproduce
Steps to reproduce the behavior:

  1. have something in the background running your tests, i.e. nodemon -w test --exec mocha ...
  2. save the file you're working on
  3. have your focus set to the console by force

Expected behavior
I would like to have (at least) the option to not have this seal my focus. I save this file every few seconds and I don't want to switch back to my editor window manually.

Desktop (please complete the following information):

  • Atom: 1.36
  • ide-mocha: 2.6.0

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.