npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@phoenix-plugin-registry/brackets-xunit

v0.4.3

Published

Open a qUnit, YUI or Jasmine file to run tests

Downloads

6

Readme

brackets-xunit

A brackets extension to detect and run various test tools against the currently edited brackets program. The plugin currently supports jasmine, jasmine-node, YUI3, qunit, and test262 testing frameworks. The plugin also can run any script if it is executable and contains #!/usr/bin/env on the first line. For example a node, python, or bash script can be executed. Selecting Run Script on the context menu will invoke a new window containing the stdout and stderr of the script output.

Installation

  1. Select File/Install Extension... from the Brackets main menu
  2. In the url field specify https://github.com/dschaffe/brackets-xunit
  3. Create a unit test in brackets or open a test in the brackets-xunit/samples directory from the extensions directory
  4. Right click on the script file in the sidebar
  5. Select Run Unit Test from the context menu
  6. The results will appear in new window

Usage

Here is a 5 minute youtube video: http://www.youtube.com/watch?v=lcxx49RoZP8

The goal is for the xunit extension is to make creating and maintaining unit tests easier. The extension will detect several types of javascript unit tests and provide functionality to run the unit test from the context menu by right clicking on a file in the project sidebar. The extension also generates skeleton unit tests for a file when the user select Generate xunit test from the context menu.

Implementation Notes

Currently supports jasmine, YUI3, and qunit. The script detects the type by looking for "brackets-xunit: " where is jasmine, yui, qunit, and test262. If no type tag exists the extension looks for patterns to determine if the file is of a particular type.
For example if a file contains describe() and it() functions the Run jasmine xunit test menu item appears.

If a javascript file is not detected as a unit test the context menu will contain Generate Jasmine xUnit test, Generate Qunit xUnit Test, and Generate YUI xUnit Test. Each selection will generate a test file with assertions for each function defined in the file. The skeleton generates the basic structure of the test and may then be customized with actual parameter values and expected return values.

The extension also supports an annotation to include external files. For example the samples/jasmine/PlayerSpec.js test requires SpecHelper.js, src/Player.js, and src/Song.js to be loaded into the html wrapper file. In a comment: /* brackets-xunit: includes=SpecHelper.js,src/Player.js,src/Song.js */

In the generated html the following is added into the head section based upon the comment:

Let me know if you have any suggestions or issues. Contact me at: [email protected].

The test262 support was moved into a separate extension https://github.com/dschaffe/brackets-test262.

To disable the brackets-xunit menu items for a project, create a config.js in the project root directory containing: { 'brackets-xunit' : 'disable' }

Limitations and Future Enhancements

  • Want to support mocha testing framework and any others requested.
  • Want to improve generated test code to be jslint compliant.
  • Interested in generating test templates based on parsing an existing api to help generate or start tests.

Change Log

  • 03-21-2013 Initial commit
  • 04-01-2013 added qunit, test262, and script support
  • 04-17-2013 added test generation support for jasmine, qunit, yui. jasmine supports AMD/require syntax