Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting Test Env #54

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

setting Test Env #54

wants to merge 5 commits into from

Conversation

gnujoow
Copy link
Collaborator

@gnujoow gnujoow commented Sep 1, 2016

package installed

  • MochaJs
    mocha is feature-rich javascript test framework running on Node.js
  • chaiJS
    ChaiJs is BDD(behavior driven development), TDD assertion library for Node.js
  • jsdom
    A JavaScript implementation of the WHATWG DOM and HTML standards, for use with Node.js. it makes bundle.js running on terminal.
  • [react-addons-test-utils]((https://facebook.github.io/react/docs/test-utils.html#renderintodocument)
    test-addon, offered by facebook, is test util that renders reactComponent in test environment.

test command line

in package.json

"test": "mocha --compilers js:babel-core/register --require ./test/test_helper.js --recursive ./test"

when babel starts compile, it look for a .babelrc in the current directory of the file being transpiled. we didn't have .bablerc so .bablerc is added with following code

{
  "presets": ["react", "es2015", "stage-1"]
}

run test

$ npm test

write your test case

ref : https://github.com/gnujoow/react-TDD/tree/master/test

@pjhjohn
Copy link
Owner

pjhjohn commented Sep 3, 2016

Wow...does chai uses jQuery for its test simulation?

@gnujoow
Copy link
Collaborator Author

gnujoow commented Sep 3, 2016

yeah to let the terminal approach DOM generated by Code. 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants