Testing Javascript – Turing



Testing Javascript – Turing

0 0


class-javascript-rails-test

How Can We test Javascript and Jquery in Rails?

On Github itechdom / class-javascript-rails-test

Testing Javascript

Turing

Osama Alghanmi / @itechdom

Learning Goals

  • Use teaspoon for testing
  • What to test in Javascript
  • Let's test the paint it example
    • Test the DOM
    • Test Internal functions
  • Mocha and Chai

Teaspoon

  • https://github.com/modeset/teaspoon
  • include gem 'teaspoon'
  • include gem 'teaspoon-mocha'
  • Bundle install
  • run: rails generate teaspoon:install --framework=mocha
  • We are using: mocha and chai (assert)