Skip to content

Instantly share code, notes, and snippets.

@morkeleb
Last active May 5, 2017 09:17
Show Gist options
  • Save morkeleb/6ecd54cf098a95f8df0344cf21580e7f to your computer and use it in GitHub Desktop.
Save morkeleb/6ecd54cf098a95f8df0344cf21580e7f to your computer and use it in GitHub Desktop.
A shell script to update from jasmine 1 to jasmine 2
sed -i '' 's/\.notToHaveBeenCalled/\.not\.toHaveBeenCalled/' spec/*.js spec/**/*.js
sed -i '' 's/\.calls\[0\]/\.calls\.first()/' spec/*.js spec/**/*.js
sed -i '' 's/\.calls\[1\]/\.calls\.all()\[1\]/' spec/*.js spec/**/*.js
sed -i '' 's/\.calls\.length/\.calls\.count()/' spec/*.js spec/**/*.js
sed -i '' 's/\.callCount/\.calls\.count()/' spec/*.js spec/**/*.js
sed -i '' 's/\.mostRecentCall/\.calls\.mostRecent()/' spec/*.js spec/**/*.js
sed -i '' 's/\.argsForCall\[0\]/\.calls\.first()\.args/' spec/*.js spec/**/*.js
sed -i '' 's/\.argsForCall\[1\]/\.calls\.all()\[1\]\.args/' spec/*.js spec/**/*.js
sed -i '' 's/\.argsForCall\[2\]/\.calls\.all()\[2\]\.args/' spec/*.js spec/**/*.js
sed -i '' 's/\.andCallFake/\.and\.callFake/' spec/*.js spec/**/*.js
sed -i '' 's/\.andCallThrough/\.and\.callThrough/' spec/*.js spec/**/*.js
sed -i '' 's/\.andReturn/\.and\.returnValue/' spec/*.js spec/**/*.js
sed -i '' 's/\.toNotEqual/\.not\.toEqual/' spec/*.js spec/**/*.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment