Created
May 26, 2014 02:15
-
-
Save leobalter/d859ee4e81fd53dfd552 to your computer and use it in GitHub Desktop.
rocambole-method-rename script for QUnit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rmr = require( "rocambole-method-rename" ); | |
var methods = [ | |
{ old: "start", next: "QUnit.start" }, | |
{ old: "stop", next: "QUnit.stop" }, | |
{ old: "test", next: "QUnit.test" }, | |
{ old: "module", next: "QUnit.module" }, | |
{ old: "asyncTest", next: "QUnit.asyncTest" }, | |
{ old: "ok", next: "assert.ok" }, | |
{ old: "equal", next: "assert.equal" }, | |
{ old: "notEqual", next: "assert.notEqual" }, | |
{ old: "deepEqual", next: "assert.deepEqual" }, | |
{ old: "notDeepEqual", next: "assert.notDeepEqual" }, | |
{ old: "strictEqual", next: "assert.strictEqual" }, | |
{ old: "notStrictEqual", next: "assert.notStrictEqual" }, | |
{ old: "propEqual", next: "assert.propEqual" }, | |
{ old: "notPropEqual", next: "assert.notPropEqual" }, | |
{ old: "throws", next: "assert.throws" }, | |
{ old: "raises", next: "assert.raises" } | |
]; | |
var dirs = [ | |
"test/unit" | |
]; | |
dirs.forEach(function( myDir ) { | |
rmr.jsFiles( myDir ).forEach(function( file ) { | |
var fileContents = rmr.fileContents( file ); | |
methods.forEach(function( method ) { | |
fileContents = rmr( fileContents, method.old, method.next ); | |
}); | |
rmr.fileContents( file, fileContents ); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also: