Skip to content

Using mocha to test front side js with grunt js in browser or PhantomJs

Notifications You must be signed in to change notification settings

wen-bing/mocha-browser-test-seed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt mocha browser test seed

This project is a seed for testing front side js by using mocha framework with Grunt in browser or Phantomjs.

So to run this project, grunt & Phantomjs need be installed.

install

1. git clone https://github.com/wen-bing/mocha-browser-test-seed.git
2. npm install
3. grunt

integration

  • copy test folder to your project dir

  • add the following section to your grunt file

// Project configuration
grunt.initConfig({
mocha: {
  all: ['test/**/*.html']
}
});

//load grunt-mocha task
grunt.loadNpmTasks('grunt-mocha');
// Default task.
grunt.registerTask('default', 'mocha');
"dependencies": {
	"grunt-mocha": "0.1.x"
}

run test

grunt mocha

Here are the result:

Running "mocha:all" (mocha) task
Testing sample-test-runner.html....OK
>> 4 assertions passed (0.03s)

About

Using mocha to test front side js with grunt js in browser or PhantomJs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published