Skip to content

setting Test Env#54

Open
gnujoow wants to merge 5 commits into
masterfrom
add_test
Open

setting Test Env#54
gnujoow wants to merge 5 commits into
masterfrom
add_test

Conversation

@gnujoow

@gnujoow gnujoow commented Sep 1, 2016

Copy link
Copy Markdown
Collaborator

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

pjhjohn commented Sep 3, 2016

Copy link
Copy Markdown
Owner

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

@gnujoow

gnujoow commented Sep 3, 2016

Copy link
Copy Markdown
Collaborator Author

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