Skip to content

Instantly share code, notes, and snippets.

@DesignByOnyx
Created July 14, 2015 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DesignByOnyx/1cd07f0007b08f4d1bca to your computer and use it in GitHub Desktop.
Save DesignByOnyx/1cd07f0007b08f4d1bca to your computer and use it in GitHub Desktop.
Find and replace patterns for updating QUnit tests. Not entirely comprehensive or foolproof, but takes a lot of the manual labor out of upgrading. Run the find/replace combos in order.
(\s{2})(module|test)
$1QUnit.$2
([\d]+), function \((?:assert)?\) \{([\s]+)
function (assert) {$2assert.expect($1);$2
([\"]), function \((?:assert)?\) \{
", function (assert) {
(\s)(equal|notEqual|ok|notOk|propEqual|notPropEqual|deepEqual|notDeepEqual|strictEqual|notStrictEqual|
expect|throws)\(
$1assert.$2(
(.expect\(\d+\);)([\r\n] +)([^\s])
$1$2$2$3
(\s{2})setup\:
$1beforeEach:
(\s{2})teardown\:
$1afterEach:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment