Skip to content

Commit 0c541cf

Browse files
committed
chore(privateMocks): replace multiple occurrences of $prop for they()
1 parent 2404b77 commit 0c541cf

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

test/helpers/privateMocks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function baseThey(msg, vals, spec, itFn) {
66
var valsIsArray = isArray(vals);
77

88
forEach(vals, function(val, key) {
9-
var m = msg.replace('$prop', angular.toJson(valsIsArray ? val : key));
9+
var m = msg.replace(/\$prop/g, angular.toJson(valsIsArray ? val : key));
1010
itFn(m, function() {
1111
/* jshint -W040 : ignore possible strict violation due to use of this */
1212
spec.call(this, val);

test/helpers/privateMocksSpec.js

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ describe('private mocks', function() {
1515
expect(window.it).toHaveBeenCalledWith('should do stuff with "c"', jasmine.any(Function));
1616
});
1717

18+
it('should replace multiple occurrences of `$prop`', function() {
19+
spyOn(window, 'it');
20+
21+
they('should fight $prop with $prop', ['fire']);
22+
expect(window.it).toHaveBeenCalledWith('should fight "fire" with "fire"', jasmine.any(Function));
23+
});
1824

1925
it('should pass each item in an array to the handler', function() {
2026
var handlerSpy = jasmine.createSpy('handler');

0 commit comments

Comments
 (0)