Skip to content
Daan van Berkel edited this page Aug 16, 2013 · 4 revisions

helpers#before

cleanup the test dir, and cd into it

helpers#gruntfile

Generates a new Gruntfile.js in the current working directory based on options hash passed in. Same as other helpers, meant to be use as a mocha handler.

  • options - Grunt configuration
  • done - callback to call on completion

Example

before(helpers.gruntfile({
  foo: {
    bar: '<config.baz>'
  }
}));

Returns a function suitable to use with mocha hooks.

helpers#assertFile

Check if a file is present, and optionally determine if a regular expression matches the the content.

helpers.assertFile('package.json', /version/);

helpers#assertFiles

Check all files present in the array are existing. If the item is an array first item is the file path, 2nd a regexp to check file content with

helpers.assertFiles(['foo.js', 'bar.js', ['baz.js', /function baz/]]);

helpers#testDirectory

Clean-up the test directory and cd into it. Call given callback when you're there.

helpers#mockPrompt

Will answer to the questions for the furnished generator

Example: mockPrompt(angular, {'bootstrap': 'Y', 'compassBoostrap': 'Y'});

helpers#createDummyGenerator

Create a simple, dummy generator

helpers#createGenerator

Create a generator, using the given dependencies and controller arguments Dependecies can be path (autodiscovery) or an array [, ]

Example: var deps = ['../../app', '../../common', '../../controller', '../../main', [createDummyGenerator(), 'testacular:app'] ]; var angular = createGenerator('angular:app', deps);

Clone this wiki locally