We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ce1551 commit 301a6d2Copy full SHA for 301a6d2
src/fake.ts
@@ -116,6 +116,10 @@ export class Fake {
116
// replace the found tag with the returned fake value
117
res = str.replace('{{' + token + '}}', result);
118
119
+ if (res === '') {
120
+ return '';
121
+ }
122
+
123
// return the response recursively until we are done finding all tags
124
return this.fake(res);
125
}
test/fake.spec.ts
@@ -46,5 +46,9 @@ describe('fake', () => {
46
Error('Invalid method: address.foo')
47
);
48
});
49
50
+ it('should be able to return empty strings', () => {
51
+ expect(faker.fake('{{helpers.repeatString}}')).toBe('');
52
+ });
53
54
0 commit comments