Feature #13748

Add initial javascript testing

Added by Daniel Lobato Garcia over 2 years ago. Updated 8 days ago.

Status:Closed
Priority:Normal
Assignee:Daniel Lobato Garcia
Category:Tests
Target version:1.14.0
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link: Found in Releases:
Pull request:https://github.com/theforeman/foreman/pull/3829

Description

Since our code base contains a good amount of javascript (4633 LOC in 76 files), we need some testing framework to ensure we do not get regressions on this code. Integration tests are slow to write and to execute, and hopefully unit testing our javascript code will make it more readable too.

Jasmine is a good testing framework with a great plugin ecosystem and widely used in other projects for this same use case (Rails + js).


Related issues

Related to Foreman - Refactor #16601: Cover spinner fields with tests New 09/19/2016

Associated revisions

Revision a467444a
Added by Daniel Lobato Garcia almost 2 years ago

Fixes #13748 - Add testing tools for code under webpack

This commit adds jest as a tool to be used to test some of the code
under webpack, supporting ES2015 via babel-polyfill.

The purpose of this is just to give the tools for other developers
to test their javascript code.

By default, jest is automocking everything except for jQuery with this
change

History

#1 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3195 added

#2 Updated by Dominic Cleal about 2 years ago

  • Status changed from Ready For Testing to New
  • Assignee deleted (Daniel Lobato Garcia)
  • Pull request deleted (https://github.com/theforeman/foreman/pull/3195)

PR was closed, resetting ticket.

#3 Updated by The Foreman Bot almost 2 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Daniel Lobato Garcia
  • Pull request https://github.com/theforeman/foreman/pull/3829 added

#4 Updated by Daniel Lobato Garcia almost 2 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal almost 2 years ago

  • Legacy Backlogs Release (now unused) set to 189

#6 Updated by Marek Hulán almost 2 years ago

#7 Updated by Daniel Lobato Garcia almost 2 years ago

  • Target version set to 1.5.2

Also available in: Atom PDF