cosmos-mocha
Make dynamic tests that checks that corresponding components at least renders on your fixtures.
Last updated 5 years ago by lapanoid .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install cosmos-mocha 
SYNC missed versions from official npm registry.

cosmos-mocha

Make dynamic tests that checks that corresponding components at least renders on your fixtures.

Installation

npm i cosmos-mocha --save-dev

Add CosmosTest.js to your mocha tests

import {generateTests} from 'cosmos-mocha';

generateTests(require('react/addons'), __dirname, <fixtures relativePath>, <components relativePath>);

you can skip generated test adding leading 'x' to fixture filename.

JSdom node test and karma-webpack tests

cosmos-mocha support jsdom node tests (jsdom requires io.js and will not work with Node.js 0.12 or below) or karma-webpack browser tests (see examples) jsdom runs in node (no browser) so they are faster but they ignore all webpack specific requires like require('style.less') if have these and want to use cosmos-mocha with css-modules for example you need to run it as karma-webpack example do.

Example

Also try to run

npm run test

in example, and break some component or delete required prop from fixture.

Current Tags

  • 2.0.4                                ...           latest (5 years ago)

18 Versions

  • 2.0.4                                ...           5 years ago
  • 2.0.3                                ...           5 years ago
  • 2.0.2                                ...           5 years ago
  • 2.0.1                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.3.2                                ...           5 years ago
  • 1.3.1                                ...           5 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.3                                ...           5 years ago
  • 1.2.2                                ...           5 years ago
  • 1.2.1                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |