GithubHelp home page GithubHelp logo

serverless-mocha-plugin's Introduction

Serverless Mocha Plugin

A Serverless Plugin for the Serverless Framework which adds support for test driven development using mocha

THIS PLUGIN REQUIRES SERVERLESS V0.5 OR HIGHER!

Introduction

This plugins does the following:

  • It will create test files when creating new serverless functions

  • It provides commands to create and run tests manually

Installation

In your project root, run:

npm install --save serverless-mocha-plugin

Add the plugin to s-project.json:

"plugins": [
  "serverless-mocha-plugin"
]

Usage

Creating tests

When the plug-in is installed, tests are automatically created to the test/ directory when creating new functions (only when using node 4.3 runtime).

Functions can also be added manually using the mocha-create command

sls function mocha-create functionName

Running tests

Tests can be run directly using Mocha (in which case it needs to be installed to your project or globally) or using the mocha-run command

sls function mocha-run [function1] [function2] [...]

If no function names are passed to mocha-run, all tests are run from the test/ directory

Release History

  • 2016/04/09 - v0.5.0 - Initial version of module for serverless 0.5.*

License

Copyright (c) 2016 SC5, licensed for users and contributors under MIT license. https://github.com/SC5/serverless-mocha-plugin/blob/master/LICENSE

Bitdeli Badge

serverless-mocha-plugin's People

Contributors

ecowork-andy avatar mpuittinen 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.