<NME> formatSpec.js
<BEF> ADDFILE
<MSG> Added a new Extract and Format filter with test

<DFF> @@ -0,0 +1,21 @@
+describe('format', function() {
+  var formatFilter;
+
+  beforeEach(module('ui.filters'));
+  beforeEach(inject(function($filter) {
+    formatFilter = $filter('format');
+  }));
+
+  it('should replace all instances of $0 if string token is passed', function() {
+    expect(formatFilter('First $0, then $0, finally $0', 'bob')).toEqual('First bob, then bob, finally bob');
+  });
+  it('should replace all instances of $n based on order of token array', function() {
+    expect(formatFilter('First $0, then $1, finally $2', ['bob','frank','dianne'])).toEqual('First is bob, then frank, finally dianne');
+  });
+  it('should replace all instances :tokens based on keys of token object', function() {
+    expect(formatFilter('First is :first, next is :second, finally there is :third', {first:'bob',second:'frank',third:'dianne'})).toEqual('First is bob, then frank, finally dianne');
+  });
+  it('should do nothing if tokens are undefined', function() {
+    expect(formatFilter('Hello There')).toEqual('Hello There');
+  });
+});
\ No newline at end of file

{'addition_count': 21, 'commit_subject': 'Added a new Extract and Format filter with test', 'deletion_count': 0, 'file_extension': '.js', 'lang': 'js', 'license': 'mit', 'repo_name': 'angular-ui/ui-select2'}