Skip to content

ClevelandJavaScript/testing-meetup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Getting Started

Install prerequisites

  • Install nodejs (mac brew install nodejs windows cinst nodejs)
  • Install jshint and get jshint running in your favorite editor npm install -g jshint
  • Install testem npm install -g testem
  • install grunt npm install -g grunt-cli

Create your directory structure

  • mkdir -p js-meetup-testing/{src,test} && cd js-meetup-testing
  • create a .testem file with the following content
{
  "framework": "qunit",
  "src_files": [
    "src/*.js",
    "test/**/*-test.js"
  ]
}
  • fire up testem and lets get cooking! testem

Hello World Test

window.helloWorld = function (name) {
  return "Hello " + name + "!";
}

test('hello world says hello', function (assert) {
  var result = helloWorld('dan');
  assert.equal("Hello dan!", result);
});

QUnit Assertions

Launchers

  • testem launchers to see the list of launchers
  • include the launch_in_dev key to identify dev launchers
  • run testem and watch the launchers

Include jQuery

  • mkdir vendor && cd vendor
  • curl http://code.jquery.com/jquery-2.1.0.js -O
  • cd ..
  • add vendor/jquery-2.1.0.js to the .testem.json src_files.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published