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 9291b62 commit e62fd15Copy full SHA for e62fd15
test/unique.spec.ts
@@ -133,4 +133,21 @@ describe('unique', () => {
133
});
134
expect(result).toBe('http');
135
136
+
137
+ it('no conflict', () => {
138
+ let i = 0;
139
+ const method = () => `no conflict: ${i++}`;
140
+ expect(faker.unique(method)).toBe('no conflict: 0');
141
+ expect(faker.unique(method)).toBe('no conflict: 1');
142
+ });
143
144
+ it('with conflict', () => {
145
+ const method = () => 'with conflict: 0';
146
+ expect(faker.unique(method)).toBe('with conflict: 0');
147
+ expect(() =>
148
+ faker.unique(method, [], {
149
+ maxRetries: 1,
150
+ })
151
+ ).toThrow();
152
153
0 commit comments