1.1.1 • Published 8 years ago

meteor-easy-test v1.1.1

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

Meteor-easy-test (beta)

This package allows you to start testing your application (client and server side), using popular tools mocha/chai/sinon and React testing utils in few step.


note:

  • use React instead of Blaze.
  • tested on Meteor 1.3, with React.

It's just beta, so design and function will be improved. Special thanks for the feedback and suggestions!


How to start.

  • first, install package:
npm i meteor-easy-test
  • second, create folder in root:

/test

  • then create the file:

/test/test.jsx

  • In the file test.jsx first you have to import config:
import 'meteor-easy-test/config';

That's it!


Now you can start to write your test right inside this file, wrap it in function and export:

import 'meteor-easy-test/config';

export default () => {
    describe("my test case", function () {
        it("my test", function () {
            assert.equal(1, 1);
        });
    });
};

or:

import 'meteor-easy-test/config';

export let testCase = () => {
    describe("my test case", function () {
        it("my test", function () {
            assert.equal(1, 1);
        });
    });
};

this will even work:

import 'meteor-easy-test/config';

export default () => {
    describe("my test case", function () {
        it("my test", function () {
            assert.equal(1, 1);
        });
    });
};
export let testCase = () => {
    describe("my test case", function () {
        it("my test", function () {
            assert.equal(1, 1);
        });
    });
};

but don't use this option :)


You can create different test cases in different file (but make sure that all files are in folder test ), and just call them in test.jsx.

first-case.jsx:

 export default testCase = () => {
     describe("my test case", function () {
         it("my test", function () {
             assert.equal(1, 1);
         });
     });
 }();

test.jsx:

 import 'meteor-easy-test/config';
 
 import testCase from './first-case';
 import anotherCase from './another-case'; // the number of cases is not limited
 
 export {testCase, anotherCase};

To show test result you should add React component in your application. To do that just import component <TestBord /> and mount wherever you want.

import TestBord from 'meteor-easy-test';

Thank you for your attention) hope this package was helpful for you! p.s. star to be notified

1.1.1

8 years ago

1.1.0

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago