WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 23 months ago

Last modified 23 months ago

#24870 closed enhancement (duplicate)

Add JavaScript unit tests to core

Reported by: adamsilverstein Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.2
Component: Unit Tests Keywords: needs-unit-tests
Focuses: Cc:

Description

With more JavaScript entering core (like the new revisions screen), it would be great to build some JavaScript unit tests. I am opening this ticket to stimulate some discussion! I'm new to JavaScript unit testing, so could use some help from those with more experience.

There are many javascript unit testing frameworks: Qunit and Jasmine seem like likely candidates. Those who have experience with JavaScript unit test - please offer direction!

So far, I set up Jasmine.js and phantomjs (headless javascript engine), which seemed relatively painless. I'm going to work on writing some actual tests next, starting with revisions. Once I have something useful, I will post the results here.

Change History (13)

comment:1 follow-up: @brianhogg2 years ago

Adding a quick comment so I can get notified of the discussion. Have done some unit testing with Backbone.js/Underscore.js/Jasmine-jquery in the past, so will help where I can! Was also working great as a javascript-based TDD tool.

comment:2 @carldanley2 years ago

  • Cc carldanley@… added

comment:3 @kadamwhite2 years ago

  • Cc kadamwhite added

comment:4 in reply to: ↑ 1 @DrewAPicture2 years ago

Replying to brianhogg:

Adding a quick comment so I can get notified of the discussion.

If you want to receive updates for a particular ticket, you can just select the 'Add to Cc' checkbox under the ticket description ;)

comment:5 @brianhogg2 years ago

Thanks - definitely didn't see that way down under modify ticket :)

comment:6 @kadamwhite2 years ago

I would love to help with this! Long-overdue, in my opinion.

comment:7 @CrazyJaco2 years ago

  • Cc CrazyJaco added

comment:8 @adamsilverstein23 months ago

note: this was discussed in the JavaScript dev chat in IRC, and work has started on this in #25088; once we have a foundation and sample test we can start building out more tests.

comment:10 @WraithKenny23 months ago

  • Cc Ken@… added

comment:11 @buffler23 months ago

  • Cc jeremy.buller@… added

comment:12 @nacin23 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #25096.

comment:13 @nacin23 months ago

Oops, actually a duplicate of #25088.

Note: See TracTickets for help on using tickets.