Migrate all-remaining non-browser related Karma specs to Jest

(Identified in &895 (comment 175969145))

Karma causes pipeline issues frequently and seems to be getting worse. Let's finish moving everything we can to Jest.

Important Links

How?

We started toying with a bash script to do this. This works nicely for simple find and replace patterns, but some migration steps might need a bit more logic. IMO, we should write a Node script that:

  1. Uses @babel/parser to parse the file.
  2. Passes the parsed contents through a list of functions for each rule mentioned in the "Necessary steps" above.
  3. Writes the result to the new file location.

To ease the burden on reviewers and reduce conflicts, let's shoot for one MR per directory.

Why use a script rather than manually migrating them?

  • A script is more reliable which makes it easier to review the MR.
  • There are 500+ of these specs, so writing a script could be faster.
  • If it turns out that writing a script causes too many issues, then we should revert to manually moving as many as possible.

Why "non-browser" related Karma specs?

Jest tests run with jsdom while Karma uses Chrome. As a result, we lose some native browser functionality which some tests may be dependent on. This isn't a blocker to the jestodus, but would be the next step after moving the specs that don't have this dependency.

/cc @andr3 @winh

Edited by Paul Slaughter