Giter VIP home page Giter VIP logo

velocity's Introduction

Velocity

Test runner (and community) for Meteor apps. Under heavy development.

Ask questions in chat Join the chat at https://gitter.im/meteor-velocity/velocity

We also test

What is Velocity?

Head over to the official homepage

Find out more by watching the Intro to Velocity talk that Robert, Sam, and Mike did at the June 2014 Meteor Devshop!

Read more in the free chapter on Velocity in The Meteor Testing Manual

Getting Started

The Velocity package itself is not something that you include, rather you use Velocity-compatible framework.

To see frameworks in action, have a look at the velocity-examples repository.

Troubleshooting

Sometimes things break and its useful to get more debugging info. Most of the test frameworks support some kind of debugging environment variable flag. You can usually see a lot more details about what's happening if you run your app with this command:

$ DEBUG=1 JASMINE_DEBUG=1 VELOCITY_DEBUG=1 VELOCITY_DEBUG_MIRROR=1 meteor

Reporting bugs

Please report bugs directly on the issues of the framework(s) you are using. Framework authors will then post issues to the core if they are core issues.

##Velocity Compatible Packages

Frameworks

Below is a list of the currently available frameworks.

Most of these frameworks have an example in the velocity-examples repository, and have a set of sample tests that can be added to your project.

  • sanjo:jasmine - Write client and server unit and integration tests with Jasmine.
  • mike:mocha - A Velocity version of mocha-web. Runs mocha tests in the Meteor context which is great for integration testing.
  • xolvio:cucumber - Use BDD Gherkin-syntax cucumber to test your app. Includes PhantomJS and Selenium as well as SauceLabs support.
  • rsbatech:robotframework - Robot Framework end to end test integration using Selenium and many other test libraries

A lot more information on these frameworks can be found on the Velocity website and in their respective repositories.

These frameworks are no longer maintained since Velocity v0.6.0

Reporters

Reporters display test results.

  • velocity:html-reporter - Adds an overlay to your app indicating test success/failure (green/red dot in top right). Click dot for test details. meteor add velocity:html-reporter
  • velocity:console-reporter - Reports test run results to the console. meteor add velocity:console-reporter

Mirrors

Mirrors are used by test frameworks to run tests within. Tests are typically destructive and as such require a different database. Mirrors run a parallel version of your app with a different database as not to intrude on the main development workflow.

Other

  • xolvio:webdriver - Adds webdriver.io to any test framework for UI testing. Uses PhantomJS in GhostDriver mode for ultra-fast UI testing

Test Framework Authors

We would love to add your framework to the list! Take a look at how some of these interface with velocity and let us know about your framework on the velocity-core google group.

Please see the velocity-wiki for basic instructions on making your test framework work with Velocity.

Also, be sure to check out the documentation for the public API.

A few notes on being velocity-compatible:

Register testing framework to Velocity

Use Velocity.registerTestingFramework(frameworkName, options) to register your package as testing framework. You can find a description of the expected arguments in the docs.

Sample Tests

Please put some sample tests in a directory named sample-tests at the root of your package. These will be used by the velocity-quick-start package and also allows users to click a button in the html-reporter to have them added to their apps.

Fixtures / Test Data

A good pattern for creating fixtures is to do the following inside your app:

meteor create --package fixtures

Then modify the package.js file to set the debugOnly flag to true like this:

Package.describe({
  name: 'fixtures',
  version: '0.0.1',
  debugOnly: true,
  // ...
});

The debugOnly flag instruct Meteor not to bundle this package when building, which is how you ensure this package does not make it to production. You can now define all your fixtures in this package.

Debug output

Please include a way to get more detailed info about your frameworks' test runs.

One way that we've done it is by having an environment flag that the user can set. Feel free to use VELOCITY_DEBUG if you'd like.

For example, you could write your logging like this:

var DEBUG = process.env.VELOCITY_DEBUG;
DEBUG && console.log('[my-framework] helpful debugging info', someVar)

Writing a new Mirror Package

See instructions here

For velocity:core code contributors

Developing on velocity:core

Getting started

1. Clone the repository
git clone [email protected]:meteor-velocity/velocity.git velocity-core
cd velocity-core
2. Setup Git Flow

We ue Git Flow with the standard branch names. Look at the cheatsheet for an introduction and installation instructions.

When you have installed Git Flow, make sure that you have the local branches develop an master and do this in the velocity-core folder:

git flow init -d
git config gitflow.prefix.versiontag v
3. Testing

We use:

You can run the tests with: ./ci.sh

Add or edit end to end tests in: test-app/tests/.

The Jasmine unit and integration tests are located in tests/ and added via package.js Package.onTest. You can run only the unit and integration tests with ./run-jasmine.js.

4. Code conventions

We use JSHint to ensure a common code style. It's also part of our CI.

npm install [email protected] -g

Please also follow:

5. Contribute and ask questions

Now you know the basics of how to contribute code to velocity:core. Make sure that you get in contact with the other core contributors before you do something bigger. We use Slack where you can communicate with the team. You can ask questions there.

Publishing a new version

Replace X.X.X in the following steps with the version that you release. Make sure that you follow the Semver conventions for increasing the version.

  1. Pull the latest changes from the branch develop
  2. Start a release with: git flow release start X.X.X
  3. Update History.md with summary ofchanges
  4. Bump version numbers in package.js and yuidoc.json
  5. Publish to Meteor with: meteor publish
  6. Commit release changes with the commit message "Release of X.X.X".
  7. Finish the release with: git flow release finish -p X.X.X

Meteor Method Naming Convention

We have two naming schemas:

  1. When the method does something with a resource type: velocity/<RESOURCE_NAME>/<ACTION>
  2. When the method isn't specific to a resource type: velocity/<ACTION>

All parts are camelCase and start with a lowercase letter.

##Contributors

We are collaborating with an all-star team on unifying the Meteor testing landscape:

For general questions about testing, check out Testing on the Meteor forums.

For specific questions about velocity core, please post in Velocity Core.

velocity's People

Contributors

alanning avatar aldeed avatar anthonymayer avatar aramk avatar awatson1978 avatar chip avatar erkkaha avatar hexsprite avatar orangewise avatar queso avatar ramusus avatar rdickert avatar rissem avatar rjobanp avatar rjsmith avatar rootedsoftware avatar samhatoum avatar sanjosolutions avatar xdissent 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.