Code Monkey home page Code Monkey logo

atom-ava's Introduction

AVA Build Status

Snippets for AVA and run tests directly in the editor

Install

$ apm install ava

Or, Settings → Install → Search for ava

Snippets

Included are some snippets useful for writing AVA tests.

Start writing a snippet's prefix and then press Tab ↹ to expand the snippet.

Snippets are fuzzy matched, so you can for example just write tde to get the t.deepEqual() snippet.

Run tests directly in the editor

In a project, choose the Ava: Run command in the Command Palette or press Ctrl Alt A to run the tests. Choose Ava: Run File or press Ctrl Alt Shift A to only run the current test file. Press Esc to close the AVA panel.

Related

License

MIT © Sindre Sorhus

atom-ava's People

Contributors

capaj avatar forresst avatar jacobmendoza avatar juhamust avatar novemberborn avatar relekang avatar samverschueren avatar sighery avatar sindresorhus avatar skellock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atom-ava's Issues

Support running all tests in a project

With #8, you have to go into the test file you want to run. Would be nice if you could run all tests in a project from anywhere in the project, even if no files are open. Since we're just spawning AVA, we can just spawn it without any file arguments and it will handle the logic of finding the project root and running all test files.

Should we have a separate keyboard shortcut for this? Or maybe we could always run all files unless the user is in a specific test file, then we just run that test file? Or is that too magic?

// @jacobmendoza

Uncaught TypeError: Cannot read property 'getPaths' of undefined

Recently, when I try to run ava test inside atom, it gives following error:

Uncaught TypeError: Cannot read property 'getPaths' of undefined
/Users/sunkibaek/.atom/packages/ava/lib/index.js:73
Hide Stack Trace
TypeError: Cannot read property 'getPaths' of undefined
    at Object.runAll (/Users/sunkibaek/.atom/packages/ava/lib/index.js:73:31)
    at atom-workspace.<anonymous> (/Users/sunkibaek/.atom/packages/ava/lib/index.js:16:62)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom Beta.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:183:32)
    at CommandPaletteView.module.exports.SelectListView.confirmSelection (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
    at space-pen-div.atom.commands.add.core:confirm (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:109:19)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom Beta.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/window-event-handler.js:98:36)
    at HTMLDocument.<anonymous> (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

It used to work fine so I have no idea what has caused this. Any ideas? Thanks!

Atom version is 1.10.0-beta0 although the error started to happen before 1.10.0.

Configure environment variables

NODE_ENV is set to test by this plugin, but it's not possible to add our own environnement variables. This could be helpful on some ALLOW_CONFIG_MUTATIONS=true cases with the config npm module (for example).

Thanks for the great work anyway ^^.

Run and show test results directly in the editor

An awesome idea, from avajs/ava#183, is to run and see the result of a test run directly in the editor. And ability to quickly run the test your cursor is in, in the test file. We could even show the result of tests in the gutter, like linting. Now that we also support watching in AVA, this brings excited possibilities.

Prior art

Anyone interested in helping out with this?

README: wrong keyboard shortcuts

The shortcuts use A not R

In a project, choose the Ava: Run command in the Command Palette or press Ctrl Alt R to run the tests. Choose Ava: Run File or press Ctrl Alt Shift R to only run the current test file. Press Esc to close the AVA panel.

Meta

I have big plans for this, the Sublime plugin, and the VS Code plugin. Snippets are only a start.

An awesome idea, from avajs/ava#183, is to run and see the result of a test run directly in the editor. And ability to quickly run the test your cursor is in, in the test file. We could even show the result of tests in the gutter, like linting. (Let's discuss this thing in #3).

Let's do a brainstorming of what other useful things an editor plugin could do.

// @vdemedes @jamestalmage @kevva @sotojuan @novemberborn @ariporad @SamVerschueren

Prefer local ava installation

Due to restrictions in our build pipeline we are installing all modules locally.

To avoid running into version mismatches, it would be great if the local version ./node_modules/.bin/ava could be preferred over the global.

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.