Skip to content

Commit

Permalink
Merge branch 'main' into test-new-faker-instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 authored Mar 26, 2022
2 parents 6b5fb8d + 2f61cfd commit 57329ed
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 43 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@
"lint-staged": "~12.3.7",
"npm-run-all": "~4.1.5",
"picocolors": "~1.0.0",
"prettier": "2.6.0",
"prettier": "2.6.1",
"prettier-plugin-organize-imports": "~2.3.4",
"rimraf": "~3.0.2",
"sanitize-html": "~2.7.0",
"simple-git-hooks": "~2.7.0",
"standard-version": "~9.3.2",
"typedoc": "~0.22.13",
"typedoc-plugin-missing-exports": "~0.22.6",
"typescript": "~4.6.2",
"typescript": "~4.6.3",
"validator": "~13.7.0",
"vite": "~2.8.6",
"vitepress": "~0.22.3",
Expand Down
82 changes: 41 additions & 41 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions test/unique.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,21 @@ describe('unique', () => {
});
expect(result).toBe('http');
});

it('no conflict', () => {
let i = 0;
const method = () => `no conflict: ${i++}`;
expect(faker.unique(method)).toBe('no conflict: 0');
expect(faker.unique(method)).toBe('no conflict: 1');
});

it('with conflict', () => {
const method = () => 'with conflict: 0';
expect(faker.unique(method)).toBe('with conflict: 0');
expect(() =>
faker.unique(method, [], {
maxRetries: 1,
})
).toThrow();
});
});

0 comments on commit 57329ed

Please sign in to comment.