WordPress.org

Make WordPress Core

Opened 9 months ago

Closed 5 months ago

#30824 closed enhancement (fixed)

Upgrade QUnit

Reported by: jorbin Owned by:
Milestone: 4.3 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Focuses: Cc:

Description

Since adopting QUnit as our unit testing framework for JavaScript, there have been four releases. We haven't updated any of them.

The biggest change is that they have started setting up for a 2.0 release that will require us to make some changes to how our tests are written.

Some of the other changes that will be nice to have now are:

QUnit asynchronous tests can also now be defined using the new var done = assert.async() method instead of the old stop()/start(), making them specific to the test block.

QUnit.skip: This method can be used to define tests that aren’t executed, as placeholders or to temporarily disable an existing test (instead of commenting it out). The skipped test is still displayed in the HTML reporter, marked prominently as “SKIPPED”.

There also has been a lot of work done to make it easier to run tests with runners such as karma that we could use to automate running our tests in real browsers.

Attachments (1)

30824.diff (161.7 KB) - added by jorbin 5 months ago.

Download all attachments as: .zip

Change History (4)

comment:1 @jorbin5 months ago

  • Milestone changed from Awaiting Review to 4.3
  • Summary changed from Upgrade to QUnit 1.16 to Upgrade QUnit

@jorbin5 months ago

comment:2 @jorbin5 months ago

In 32343:

Update QUnit to v1.18.0

See https://github.com/jquery/qunit/blob/1.18.0/History.md for changes from 1.12.0 to now. Mostly bug fixes and internal changes in preparation for QUnit v2.

See #30824

comment:3 @jorbin5 months ago

  • Resolution set to fixed
  • Status changed from new to closed

The TinyMCE tests are still using a seperate QUnit, version 1.14.0, which is inline with what tinyMCE is using upstream at https://github.com/tinymce/tinymce/blob/master/tests/js/qunit/qunit.js . I don't think we should change that until they change.

Note: See TracTickets for help on using tickets.