Code Monkey home page Code Monkey logo

xunit_environments's Introduction

xUnit Environments for Various Languages

So you want to hold a Dojo, but you don't want to spend half the time writing all the testing boilerplate and figuring out all the dependencies necessary to even write tests, let alone run them? Wouldn't you love for the tests to run automatically when a file is saved? Well, you're in luck.

Prerequisites

Testing Languages

Installation

  1. Install grunt-cli globally: npm install -g grunt-cli
  2. Install this repository: git clone https://github.com/orlandodojo/xUnit_Environments.git
  3. Hop on into the new directory: cd xUnit_Environments/
  4. Install the Javascript dependencies: npm install

You now have enough to start testing Javascript, at least. If you have Python or Ruby installed, you probably have enough to get started with both of those, as well. In order to write tests in PHP, you'll need to install PHPUnit. For that, you should consider installing via Composer: composer install should do the trick.

Write Some Tests!

Each folder contains a single main and test file; you can imagine what those are for. If you can't, here's an example for Python:

## python/main.py

class YourAwesomeSolution(object):
    pass

Note that test.py comes with some boilerplate to make it easy to just start writing tests:

## python/test.py

from main import *
import unittest

class Test ( unittest.TestCase ):
    def setUp ( self ):
        pass

    def test_something ( self ):
        self.assertFalse(True)


if __name__ == '__main__':
    unittest.main()

Change test_something() into your first test and run the tests with the supplied Grunt task: grunt shell:test_py

Wait, didn't you promise some auto-magic...?

Yes, well, for the very lazy, you can run the watch Grunt task, which is preconfigured to watch the source files for changes and run the appropriate tests for you. It's also configured to be the default task, so you can also just run grunt. If you want fancier notifications than CLI, feel free to open PRs!

Primarily wired together by @al-the-x (twitter)

xunit_environments's People

Contributors

al-the-x avatar

Watchers

 avatar Obinna Ajuruchi avatar James Cloos 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.