grunt-castle-example

0.0.1 • Public • Published

Grunt-castle Example

This is a simple example of how to use grunt-castle to unit test a client-server AMD code base.

Overview

In this example the fictitious application resides in the lib directory. The lib/modules directory represents code that was imported from another project. This imported code is used to highlight a case for mocking dependencies.

The test/mocks directory contains the testing mocks. Grunt-castle supports two types of mocks, AMD and global. money.js is a global mock, which is referenced in the application code. test/mocks/modules/sylvesterMcMonkeyMcBean.js mocks the application file lib/modules/sylvesterMcMonkeyMcBean.js.

The test/specs directory contains the specifications to be tested. In this example there is only 1 specification, test/specs/shared/sneetch.js. This specification will be tested on both the client and the server.

The grunt-castle task configuration for this example can be found in Gruntfile.js.

For further information about grunt-castle visit the Github repo.

Getting Started

First clone the repo:

git clone git@github.com:jstrimpel/grunt-castle-example.git

Second install the dependencies from the local repo directory:

npm install

Third run the tests:

grunt castle

You are done.

Readme

Keywords

none

Package Sidebar

Install

npm i grunt-castle-example

Weekly Downloads

2

Version

0.0.1

License

none

Last publish

Collaborators

  • jstrimpel