0.2.10 • Published 10 years ago

cortex-playground v0.2.10

Weekly downloads
9
License
MIT
Repository
github
Last release
10 years ago

cortex-playground NPM version Build Status Dependency Status

Collections of test fixtures for cortex.

Install

$ npm install cortex-playground --save

Usage

For details, see test-fixture.

var playground = require('cortex-playground');
var packages = playground.packages;
var resources = playground.resources;
  • packages: contains raw files of the user repos
  • resources: contains built files, and each of the resource folder is built from the package which has the same name.

The usage of resources is the same as packages.

var normal = packages('normal');
// copy test fixtures into a temp directory.
normal.copy(function(err, dir){
  dir; // the temp directory
  normal.resolve(); // `dir` itself. 
  normal.resolve('cortex.json'); // returns the absolute path of `cortex.json`.
});

packages(name)

Use a package.

/path/to/playground/
  |-- packages/
             |-- a/                     // package a
                 |-- lib/
                       |-- index.js
             |-- b/                     // package b
  |-- resources/
              |-- a/
              |-- b/
packages(); // -> use all packages
packages('a'); // -> use package `'a'`
packages('a', 'lib'); // -> use the `lib` folder of package `'a'`

.copy(to, callback)

  • to path= the destination folder where test fixtures will be copied into. If not specified, they will be copied into a temp folder.
  • callback function(err, dir)
  • dir path a temporarily directory that contains all resources and nice toys which you will enjoy!

Copy the test fixtures to a temp dir.

.resolve(path...)

.resolve(); // -> the base

Returns path

Available Packages

As well as available resources.

  • normal: a common cases
  • css-not-found: an error case, pkg.css defined but not found
  • dir-not-found: an error case, directories.xxx defined but not found

License

MIT

0.2.10

10 years ago

0.2.9

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago