From 585a2d87a76cb2ba290786fe574861cfc21c5ed0 Mon Sep 17 00:00:00 2001 From: Hanna Kuczynska Date: Wed, 20 Jul 2022 12:30:04 +0200 Subject: [PATCH 1/5] fix(finance.bic): remove hardcoded elements and simplify function --- src/modules/finance/index.ts | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index ff9ffc68059..5e24c3b518b 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -390,29 +390,23 @@ export class Finance { } /** - * Generates a random bic. + * Generates a random SWIFT/BIC code. * * @example * faker.finance.bic() // 'WYAUPGX1432' */ bic(): string { - const vowels = ['A', 'E', 'I', 'O', 'U']; - const prob = this.faker.datatype.number(100); + const bankIdentifier = this.faker.random.alpha({ + count: 4, + casing: 'upper', + }); + const countryCode = this.faker.helpers.arrayElement(iban.iso3166); + const locationCode = this.faker.random.alphaNumeric(2, { casing: 'upper' }); + const branchCode = this.faker.datatype.boolean() + ? this.faker.random.alphaNumeric(3, { casing: 'upper' }) + : ''; - return [ - this.faker.helpers.replaceSymbols('???'), - this.faker.helpers.arrayElement(vowels), - this.faker.helpers.arrayElement(iban.iso3166), - this.faker.helpers.replaceSymbols('?'), - '1', - prob < 10 - ? this.faker.helpers.replaceSymbols( - `?${this.faker.helpers.arrayElement(vowels)}?` - ) - : prob < 40 - ? this.faker.helpers.replaceSymbols('###') - : '', - ].join(''); + return `${bankIdentifier}${countryCode}${locationCode}${branchCode}`; } /** From 100b99adaa3f0735a6bd77679d4dc5c165711a29 Mon Sep 17 00:00:00 2001 From: Hanna Kuczynska Date: Wed, 20 Jul 2022 12:31:42 +0200 Subject: [PATCH 2/5] fix: tests --- test/__snapshots__/finance.spec.ts.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/__snapshots__/finance.spec.ts.snap b/test/__snapshots__/finance.spec.ts.snap index 0acc368d3e3..21069466ab4 100644 --- a/test/__snapshots__/finance.spec.ts.snap +++ b/test/__snapshots__/finance.spec.ts.snap @@ -6,7 +6,7 @@ exports[`finance > seed: 42 > accountName() 1`] = `"Money Market Account"`; exports[`finance > seed: 42 > amount() 1`] = `"374.54"`; -exports[`finance > seed: 42 > bic() 1`] = `"UYEOSCP1514"`; +exports[`finance > seed: 42 > bic() 1`] = `"JUYEPSSL5G5"`; exports[`finance > seed: 42 > bitcoinAddress() 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1b"`; @@ -42,7 +42,7 @@ exports[`finance > seed: 1211 > accountName() 1`] = `"Personal Loan Account"`; exports[`finance > seed: 1211 > amount() 1`] = `"928.52"`; -exports[`finance > seed: 1211 > bic() 1`] = `"LXUEBTZ1"`; +exports[`finance > seed: 1211 > bic() 1`] = `"YLXUDE4Z"`; exports[`finance > seed: 1211 > bitcoinAddress() 1`] = `"1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsA"`; @@ -78,7 +78,7 @@ exports[`finance > seed: 1337 > accountName() 1`] = `"Money Market Account"`; exports[`finance > seed: 1337 > amount() 1`] = `"262.02"`; -exports[`finance > seed: 1337 > bic() 1`] = `"OEFELYL1032"`; +exports[`finance > seed: 1337 > bic() 1`] = `"GOEFFIJG"`; exports[`finance > seed: 1337 > bitcoinAddress() 1`] = `"3adhxs2jewAgkYgJi7No6Cn8JZa"`; From bbeb51d6decb218c1d5191e10ef0ced3fd60ab57 Mon Sep 17 00:00:00 2001 From: Hanna Kuczynska Date: Tue, 26 Jul 2022 20:06:41 +0200 Subject: [PATCH 3/5] Merge branch 'main' into fix-bic # Conflicts: # test/__snapshots__/finance.spec.ts.snap --- .eslintrc.js | 4 +- package.json | 16 +- pnpm-lock.yaml | 249 +++++++------- src/modules/company/index.ts | 28 +- src/utils/types.ts | 20 +- test/__snapshots__/address.spec.ts.snap | 249 ++++++++++---- test/__snapshots__/animal.spec.ts.snap | 84 ++--- test/__snapshots__/color.spec.ts.snap | 66 ++-- test/__snapshots__/commerce.spec.ts.snap | 78 +++-- test/__snapshots__/company.spec.ts.snap | 84 +++-- test/__snapshots__/database.spec.ts.snap | 30 +- test/__snapshots__/datatype.spec.ts.snap | 306 ++++++++++------- test/__snapshots__/date.spec.ts.snap | 246 ++++++++----- test/__snapshots__/git.spec.ts.snap | 24 +- test/__snapshots__/hacker.spec.ts.snap | 36 +- test/__snapshots__/helpers.spec.ts.snap | 312 +++++++++++++++-- test/__snapshots__/internet.spec.ts.snap | 180 +++++++--- test/__snapshots__/lorem.spec.ts.snap | 178 ++++++++-- test/__snapshots__/music.spec.ts.snap | 12 +- test/__snapshots__/name.spec.ts.snap | 150 ++++++-- test/__snapshots__/phone.spec.ts.snap | 72 ++-- test/__snapshots__/random.spec.ts.snap | 60 +++- test/__snapshots__/science.spec.ts.snap | 12 +- test/__snapshots__/system.spec.ts.snap | 78 +++++ test/__snapshots__/vehicle.spec.ts.snap | 54 +-- test/__snapshots__/word.spec.ts.snap | 126 +++---- test/address.spec.ts | 162 +++------ test/animal.spec.ts | 20 +- test/color.spec.ts | 44 +-- test/commerce.spec.ts | 44 ++- test/company.spec.ts | 81 +++-- test/database.spec.ts | 26 +- test/datatype.spec.ts | 264 ++++---------- test/date.spec.ts | 420 +++++------------------ test/finance.spec.ts | 86 +++-- test/git.spec.ts | 33 +- test/hacker.spec.ts | 29 +- test/helpers.spec.ts | 98 ++++-- test/internet.spec.ts | 82 +++-- test/lorem.spec.ts | 41 +-- test/music.spec.ts | 20 +- test/name.spec.ts | 56 +-- test/phone.spec.ts | 45 +-- test/random.spec.ts | 34 +- test/science.spec.ts | 20 +- test/support/seededRuns.ts | 318 +++++++++++++++++ test/system.spec.ts | 26 +- test/vehicle.spec.ts | 40 +-- test/word.spec.ts | 55 +-- 49 files changed, 2787 insertions(+), 2011 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 6f24766dc5f..4e12b747a1f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -72,9 +72,7 @@ module.exports = defineConfig({ 'jsdoc/require-returns-type': 'off', 'jsdoc/require-returns': 'off', 'jsdoc/tag-lines': 'off', - - // We want to explicitly set this rule to error in the future - 'jsdoc/sort-tags': 'warn', + 'jsdoc/sort-tags': 'error', }, settings: { jsdoc: { diff --git a/package.json b/package.json index bed6f8b4274..48e635ffae5 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ ] }, "devDependencies": { - "@algolia/client-search": "~4.14.0", + "@algolia/client-search": "~4.14.1", "@types/markdown-it": "~12.2.3", "@types/node": "~18.0.6", "@types/prettier": "~2.6.3", @@ -102,11 +102,11 @@ "@types/validator": "~13.7.4", "@typescript-eslint/eslint-plugin": "~5.30.7", "@typescript-eslint/parser": "~5.30.7", - "@vitest/ui": "~0.18.1", + "@vitest/ui": "~0.19.1", "c8": "~7.12.0", "conventional-changelog-cli": "~2.2.2", "cypress": "~10.3.1", - "esbuild": "~0.14.49", + "esbuild": "~0.14.50", "eslint": "~8.20.0", "eslint-config-prettier": "~8.5.0", "eslint-define-config": "~1.5.1", @@ -123,19 +123,19 @@ "react": "~18.2.0", "react-dom": "~18.2.0", "rimraf": "~3.0.2", - "sanitize-html": "~2.7.0", + "sanitize-html": "~2.7.1", "simple-git-hooks": "~2.8.0", "standard-version": "~9.5.0", "tsx": "~3.8.0", - "typedoc": "~0.23.8", + "typedoc": "~0.23.9", "typedoc-plugin-missing-exports": "~0.23.0", "typescript": "~4.7.4", "validator": "~13.7.0", - "vite": "~3.0.2", + "vite": "~3.0.3", "vitepress": "~0.22.4", - "vitest": "~0.18.1" + "vitest": "~0.19.1" }, - "packageManager": "pnpm@7.5.2", + "packageManager": "pnpm@7.6.0", "engines": { "node": ">=14.0.0", "npm": ">=6.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0cdc6ab51df..b5d40656154 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,7 +1,7 @@ lockfileVersion: 5.4 specifiers: - '@algolia/client-search': ~4.14.0 + '@algolia/client-search': ~4.14.1 '@types/markdown-it': ~12.2.3 '@types/node': ~18.0.6 '@types/prettier': ~2.6.3 @@ -10,11 +10,11 @@ specifiers: '@types/validator': ~13.7.4 '@typescript-eslint/eslint-plugin': ~5.30.7 '@typescript-eslint/parser': ~5.30.7 - '@vitest/ui': ~0.18.1 + '@vitest/ui': ~0.19.1 c8: ~7.12.0 conventional-changelog-cli: ~2.2.2 cypress: ~10.3.1 - esbuild: ~0.14.49 + esbuild: ~0.14.50 eslint: ~8.20.0 eslint-config-prettier: ~8.5.0 eslint-define-config: ~1.5.1 @@ -31,20 +31,20 @@ specifiers: react: ~18.2.0 react-dom: ~18.2.0 rimraf: ~3.0.2 - sanitize-html: ~2.7.0 + sanitize-html: ~2.7.1 simple-git-hooks: ~2.8.0 standard-version: ~9.5.0 tsx: ~3.8.0 - typedoc: ~0.23.8 + typedoc: ~0.23.9 typedoc-plugin-missing-exports: ~0.23.0 typescript: ~4.7.4 validator: ~13.7.0 - vite: ~3.0.2 + vite: ~3.0.3 vitepress: ~0.22.4 - vitest: ~0.18.1 + vitest: ~0.19.1 devDependencies: - '@algolia/client-search': 4.14.0 + '@algolia/client-search': 4.14.1 '@types/markdown-it': 12.2.3 '@types/node': 18.0.6 '@types/prettier': 2.6.3 @@ -53,11 +53,11 @@ devDependencies: '@types/validator': 13.7.4 '@typescript-eslint/eslint-plugin': 5.30.7_6wltbjakwuqm7awqswigmiuhd4 '@typescript-eslint/parser': 5.30.7_he2ccbldppg44uulnyq4rwocfa - '@vitest/ui': 0.18.1 + '@vitest/ui': 0.19.1 c8: 7.12.0 conventional-changelog-cli: 2.2.2 cypress: 10.3.1 - esbuild: 0.14.49 + esbuild: 0.14.50 eslint: 8.20.0 eslint-config-prettier: 8.5.0_eslint@8.20.0 eslint-define-config: 1.5.1 @@ -74,17 +74,17 @@ devDependencies: react: 18.2.0 react-dom: 18.2.0_react@18.2.0 rimraf: 3.0.2 - sanitize-html: 2.7.0 + sanitize-html: 2.7.1 simple-git-hooks: 2.8.0 standard-version: 9.5.0 tsx: 3.8.0 - typedoc: 0.23.8_typescript@4.7.4 - typedoc-plugin-missing-exports: 0.23.0_typedoc@0.23.8 + typedoc: 0.23.9_typescript@4.7.4 + typedoc-plugin-missing-exports: 0.23.0_typedoc@0.23.9 typescript: 4.7.4 validator: 13.7.0 - vite: 3.0.2 - vitepress: 0.22.4_tgqivcw5eyibsasgiakey2gfxq - vitest: 0.18.1_ps3rclznr4tkimneamanfdq2tu + vite: 3.0.3 + vitepress: 0.22.4_ju6wpa2hqqdrjfl4p3m6tanjem + vitest: 0.19.1_jcfjdqfldivpyjgll3wfgmwbia packages: @@ -94,14 +94,14 @@ packages: '@algolia/autocomplete-shared': 1.7.1 dev: true - /@algolia/autocomplete-preset-algolia/1.7.1_fab3r74sakexbqciq34evjvaqi: + /@algolia/autocomplete-preset-algolia/1.7.1_peqgqe7uij6smhko32m3outymy: resolution: {integrity: sha512-pJwmIxeJCymU1M6cGujnaIYcY3QPOVYZOXhFkWVM7IxKzy272BwCvMFMyc5NpG/QmiObBxjo7myd060OeTNJXg==} peerDependencies: '@algolia/client-search': ^4.9.1 algoliasearch: ^4.9.1 dependencies: '@algolia/autocomplete-shared': 1.7.1 - '@algolia/client-search': 4.14.0 + '@algolia/client-search': 4.14.1 algoliasearch: 4.13.1 dev: true @@ -119,8 +119,8 @@ packages: resolution: {integrity: sha512-7Vaf6IM4L0Jkl3sYXbwK+2beQOgVJ0mKFbz/4qSxKd1iy2Sp77uTAazcX+Dlexekg1fqGUOSO7HS4Sx47ZJmjA==} dev: true - /@algolia/cache-common/4.14.0: - resolution: {integrity: sha512-9bCWX78td6DEtyVIJc2R8MokniFFgbS5r9ADVvBuBeDtVuNhOwDO/MYZ2WlAQJTwos9TtS9v0iJ9Ym0rDHMldA==} + /@algolia/cache-common/4.14.1: + resolution: {integrity: sha512-XhAzm0Sm3D3DuOWUyDoVSXZ/RjYMvI1rbki+QH4ODAVaHDWVhMhg3IJPv3gIbBQnEQdtPdBhsf2hyPxAu28E5w==} dev: true /@algolia/cache-in-memory/4.13.1: @@ -153,11 +153,11 @@ packages: '@algolia/transporter': 4.13.1 dev: true - /@algolia/client-common/4.14.0: - resolution: {integrity: sha512-7pmtPOicY6QEBQEYinChkVVi0SnDGcgJn1P0GkWxIMD23ZQk7o0/eMAQYqkGR3TET6YB/bZDeDrpL5v4DKN3tg==} + /@algolia/client-common/4.14.1: + resolution: {integrity: sha512-WDwziD7Rt1yCRDfONmeLOfh1Lt8uOy6Vn7dma171KOH9NN3q8yDQpOhPqdFOCz1j3GC1FfIZxaC0YEOIobZ2lg==} dependencies: - '@algolia/requester-common': 4.14.0 - '@algolia/transporter': 4.14.0 + '@algolia/requester-common': 4.14.1 + '@algolia/transporter': 4.14.1 dev: true /@algolia/client-personalization/4.13.1: @@ -176,20 +176,20 @@ packages: '@algolia/transporter': 4.13.1 dev: true - /@algolia/client-search/4.14.0: - resolution: {integrity: sha512-gFxteVMUzEMq6lDEex/gZKNudrFmOFLuWS9SQCU+sXeTCRw32aY5/RBDigOkD6Yp6nLkfnYWvPnDshwY6WgTbw==} + /@algolia/client-search/4.14.1: + resolution: {integrity: sha512-K6XrdIIQq8a3o+kCedj5slUVzA1aKttae4mLzwnY0bS7tYduv1IQggi9Sz8gOG6/MMyKMB4IwYqr47t/0z4Vxw==} dependencies: - '@algolia/client-common': 4.14.0 - '@algolia/requester-common': 4.14.0 - '@algolia/transporter': 4.14.0 + '@algolia/client-common': 4.14.1 + '@algolia/requester-common': 4.14.1 + '@algolia/transporter': 4.14.1 dev: true /@algolia/logger-common/4.13.1: resolution: {integrity: sha512-L6slbL/OyZaAXNtS/1A8SAbOJeEXD5JcZeDCPYDqSTYScfHu+2ePRTDMgUTY4gQ7HsYZ39N1LujOd8WBTmM2Aw==} dev: true - /@algolia/logger-common/4.14.0: - resolution: {integrity: sha512-1Fw+5Nd4d7NWNA9FhOIIXzESJn+j5VTO/f3YK+XhoOlbAwfMbD32InWEjNglrcHnSO8kpqrizFXveKTx1CzoKw==} + /@algolia/logger-common/4.14.1: + resolution: {integrity: sha512-58CK87wTjUWI1QNXc3nFDQ7EXBi28NoLufXE9sMjng2fAL1wPdyO+KFD8KTBoXOZnJWflPj5F7p6jLyGAfgvcQ==} dev: true /@algolia/logger-console/4.13.1: @@ -208,8 +208,8 @@ packages: resolution: {integrity: sha512-eGVf0ID84apfFEuXsaoSgIxbU3oFsIbz4XiotU3VS8qGCJAaLVUC5BUJEkiFENZIhon7hIB4d0RI13HY4RSA+w==} dev: true - /@algolia/requester-common/4.14.0: - resolution: {integrity: sha512-8DGIW5keIbAFet2TKGr/C9DVJ1r8IWFjgf4URPHn6NHMf6R+ruQp0gOf7xBP1Bw6JIS3/DbvlGqbw8sNO/N+Hw==} + /@algolia/requester-common/4.14.1: + resolution: {integrity: sha512-EbXBKrfYcX5/JJfaw7IZxhWlbUtjd5Chs+Alrfc4tutgRQn4dmImWS07n3iffwJcYdOWY1eRrnfBK5BwopuN5A==} dev: true /@algolia/requester-node-http/4.13.1: @@ -226,12 +226,12 @@ packages: '@algolia/requester-common': 4.13.1 dev: true - /@algolia/transporter/4.14.0: - resolution: {integrity: sha512-AP+8Qxeg0XvQ3rFbj4pIUzDMmtjo5pgBMx/57ADbge5Y4Y9ByDdQNjEKk6QFIe70SAwR/cGzglwYg7nl8mK/OA==} + /@algolia/transporter/4.14.1: + resolution: {integrity: sha512-xbmoIqszFDOCCZqizBQ2TNHcGtjZX7EkJCzABsrokA0WqtfZzClFmtc+tZYgtEiyAfIF70alTegG19poQGdkvg==} dependencies: - '@algolia/cache-common': 4.14.0 - '@algolia/logger-common': 4.14.0 - '@algolia/requester-common': 4.14.0 + '@algolia/cache-common': 4.14.1 + '@algolia/logger-common': 4.14.1 + '@algolia/requester-common': 4.14.1 dev: true /@babel/code-frame/7.18.6: @@ -319,10 +319,10 @@ packages: resolution: {integrity: sha512-utLgg7E1agqQeqCJn05DWC7XXMk4tMUUnL7MZupcknRu2OzGN13qwey2qA/0NAKkVBGugiWtON0+rlU0QIPojg==} dev: true - /@docsearch/js/3.1.1_tgqivcw5eyibsasgiakey2gfxq: + /@docsearch/js/3.1.1_ju6wpa2hqqdrjfl4p3m6tanjem: resolution: {integrity: sha512-bt7l2aKRoSnLUuX+s4LVQ1a7AF2c9myiZNv5uvQCePG5tpvVGpwrnMwqVXOUJn9q6FwVVhOrQMO/t+QmnnAEUw==} dependencies: - '@docsearch/react': 3.1.1_tgqivcw5eyibsasgiakey2gfxq + '@docsearch/react': 3.1.1_ju6wpa2hqqdrjfl4p3m6tanjem preact: 10.10.0 transitivePeerDependencies: - '@algolia/client-search' @@ -331,7 +331,7 @@ packages: - react-dom dev: true - /@docsearch/react/3.1.1_tgqivcw5eyibsasgiakey2gfxq: + /@docsearch/react/3.1.1_ju6wpa2hqqdrjfl4p3m6tanjem: resolution: {integrity: sha512-cfoql4qvtsVRqBMYxhlGNpvyy/KlCoPqjIsJSZYqYf9AplZncKjLBTcwBu6RXFMVCe30cIFljniI4OjqAU67pQ==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' @@ -339,7 +339,7 @@ packages: react-dom: '>= 16.8.0 < 19.0.0' dependencies: '@algolia/autocomplete-core': 1.7.1 - '@algolia/autocomplete-preset-algolia': 1.7.1_fab3r74sakexbqciq34evjvaqi + '@algolia/autocomplete-preset-algolia': 1.7.1_peqgqe7uij6smhko32m3outymy '@docsearch/css': 3.1.1 '@types/react': 18.0.15 algoliasearch: 4.13.1 @@ -368,7 +368,7 @@ packages: /@esbuild-kit/core-utils/2.1.0: resolution: {integrity: sha512-fZirrc2KjeTumVjE4bpleWOk2gD83b7WuGeQqOceKFQL+heNKKkNB5G5pekOUTLzfSBc0hP7hCSBoD9TuR0hLw==} dependencies: - esbuild: 0.14.49 + esbuild: 0.14.50 source-map-support: 0.5.21 dev: true @@ -694,8 +694,8 @@ packages: vue: 3.2.37 dev: true - /@vitest/ui/0.18.1: - resolution: {integrity: sha512-JgYewAWfx9fN/cjOW6fPh63j9EDiHmDpVXzvp7UJeza+26QoYHXVsgjCmnzP/jjH3i/LkOXlJLqEJw/nJQ+IJg==} + /@vitest/ui/0.19.1: + resolution: {integrity: sha512-TmbEJmcieK7chFJqdkgni4Lq/2MY6fKoxGPktromnnyabBkQFSGJlAl5vzFMYy8SfCj/zyaZy48FzDdWixziKg==} dependencies: sirv: 2.0.2 dev: true @@ -1751,8 +1751,8 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild-android-64/0.14.49: - resolution: {integrity: sha512-vYsdOTD+yi+kquhBiFWl3tyxnj2qZJsl4tAqwhT90ktUdnyTizgle7TjNx6Ar1bN7wcwWqZ9QInfdk2WVagSww==} + /esbuild-android-64/0.14.50: + resolution: {integrity: sha512-H7iUEm7gUJHzidsBlFPGF6FTExazcgXL/46xxLo6i6bMtPim6ZmXyTccS8yOMpy6HAC6dPZ/JCQqrkkin69n6Q==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1760,8 +1760,8 @@ packages: dev: true optional: true - /esbuild-android-arm64/0.14.49: - resolution: {integrity: sha512-g2HGr/hjOXCgSsvQZ1nK4nW/ei8JUx04Li74qub9qWrStlysaVmadRyTVuW32FGIpLQyc5sUjjZopj49eGGM2g==} + /esbuild-android-arm64/0.14.50: + resolution: {integrity: sha512-NFaoqEwa+OYfoYVpQWDMdKII7wZZkAjtJFo1WdnBeCYlYikvUhTnf2aPwPu5qEAw/ie1NYK0yn3cafwP+kP+OQ==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1769,8 +1769,8 @@ packages: dev: true optional: true - /esbuild-darwin-64/0.14.49: - resolution: {integrity: sha512-3rvqnBCtX9ywso5fCHixt2GBCUsogNp9DjGmvbBohh31Ces34BVzFltMSxJpacNki96+WIcX5s/vum+ckXiLYg==} + /esbuild-darwin-64/0.14.50: + resolution: {integrity: sha512-gDQsCvGnZiJv9cfdO48QqxkRV8oKAXgR2CGp7TdIpccwFdJMHf8hyIJhMW/05b/HJjET/26Us27Jx91BFfEVSA==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -1778,8 +1778,8 @@ packages: dev: true optional: true - /esbuild-darwin-arm64/0.14.49: - resolution: {integrity: sha512-XMaqDxO846srnGlUSJnwbijV29MTKUATmOLyQSfswbK/2X5Uv28M9tTLUJcKKxzoo9lnkYPsx2o8EJcTYwCs/A==} + /esbuild-darwin-arm64/0.14.50: + resolution: {integrity: sha512-36nNs5OjKIb/Q50Sgp8+rYW/PqirRiFN0NFc9hEvgPzNJxeJedktXwzfJSln4EcRFRh5Vz4IlqFRScp+aiBBzA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -1787,8 +1787,8 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.14.49: - resolution: {integrity: sha512-NJ5Q6AjV879mOHFri+5lZLTp5XsO2hQ+KSJYLbfY9DgCu8s6/Zl2prWXVANYTeCDLlrIlNNYw8y34xqyLDKOmQ==} + /esbuild-freebsd-64/0.14.50: + resolution: {integrity: sha512-/1pHHCUem8e/R86/uR+4v5diI2CtBdiWKiqGuPa9b/0x3Nwdh5AOH7lj+8823C6uX1e0ufwkSLkS+aFZiBCWxA==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -1796,8 +1796,8 @@ packages: dev: true optional: true - /esbuild-freebsd-arm64/0.14.49: - resolution: {integrity: sha512-lFLtgXnAc3eXYqj5koPlBZvEbBSOSUbWO3gyY/0+4lBdRqELyz4bAuamHvmvHW5swJYL7kngzIZw6kdu25KGOA==} + /esbuild-freebsd-arm64/0.14.50: + resolution: {integrity: sha512-iKwUVMQztnPZe5pUYHdMkRc9aSpvoV1mkuHlCoPtxZA3V+Kg/ptpzkcSY+fKd0kuom+l6Rc93k0UPVkP7xoqrw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -1805,8 +1805,8 @@ packages: dev: true optional: true - /esbuild-linux-32/0.14.49: - resolution: {integrity: sha512-zTTH4gr2Kb8u4QcOpTDVn7Z8q7QEIvFl/+vHrI3cF6XOJS7iEI1FWslTo3uofB2+mn6sIJEQD9PrNZKoAAMDiA==} + /esbuild-linux-32/0.14.50: + resolution: {integrity: sha512-sWUwvf3uz7dFOpLzYuih+WQ7dRycrBWHCdoXJ4I4XdMxEHCECd8b7a9N9u7FzT6XR2gHPk9EzvchQUtiEMRwqw==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -1814,8 +1814,8 @@ packages: dev: true optional: true - /esbuild-linux-64/0.14.49: - resolution: {integrity: sha512-hYmzRIDzFfLrB5c1SknkxzM8LdEUOusp6M2TnuQZJLRtxTgyPnZZVtyMeCLki0wKgYPXkFsAVhi8vzo2mBNeTg==} + /esbuild-linux-64/0.14.50: + resolution: {integrity: sha512-u0PQxPhaeI629t4Y3EEcQ0wmWG+tC/LpP2K7yDFvwuPq0jSQ8SIN+ARNYfRjGW15O2we3XJvklbGV0wRuUCPig==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -1823,8 +1823,8 @@ packages: dev: true optional: true - /esbuild-linux-arm/0.14.49: - resolution: {integrity: sha512-iE3e+ZVv1Qz1Sy0gifIsarJMQ89Rpm9mtLSRtG3AH0FPgAzQ5Z5oU6vYzhc/3gSPi2UxdCOfRhw2onXuFw/0lg==} + /esbuild-linux-arm/0.14.50: + resolution: {integrity: sha512-VALZq13bhmFJYFE/mLEb+9A0w5vo8z+YDVOWeaf9vOTrSC31RohRIwtxXBnVJ7YKLYfEMzcgFYf+OFln3Y0cWg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -1832,8 +1832,8 @@ packages: dev: true optional: true - /esbuild-linux-arm64/0.14.49: - resolution: {integrity: sha512-KLQ+WpeuY+7bxukxLz5VgkAAVQxUv67Ft4DmHIPIW+2w3ObBPQhqNoeQUHxopoW/aiOn3m99NSmSV+bs4BSsdA==} + /esbuild-linux-arm64/0.14.50: + resolution: {integrity: sha512-ZyfoNgsTftD7Rp5S7La5auomKdNeB3Ck+kSKXC4pp96VnHyYGjHHXWIlcbH8i+efRn9brszo1/Thl1qn8RqmhQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -1841,8 +1841,8 @@ packages: dev: true optional: true - /esbuild-linux-mips64le/0.14.49: - resolution: {integrity: sha512-n+rGODfm8RSum5pFIqFQVQpYBw+AztL8s6o9kfx7tjfK0yIGF6tm5HlG6aRjodiiKkH2xAiIM+U4xtQVZYU4rA==} + /esbuild-linux-mips64le/0.14.50: + resolution: {integrity: sha512-ygo31Vxn/WrmjKCHkBoutOlFG5yM9J2UhzHb0oWD9O61dGg+Hzjz9hjf5cmM7FBhAzdpOdEWHIrVOg2YAi6rTw==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -1850,8 +1850,8 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le/0.14.49: - resolution: {integrity: sha512-WP9zR4HX6iCBmMFH+XHHng2LmdoIeUmBpL4aL2TR8ruzXyT4dWrJ5BSbT8iNo6THN8lod6GOmYDLq/dgZLalGw==} + /esbuild-linux-ppc64le/0.14.50: + resolution: {integrity: sha512-xWCKU5UaiTUT6Wz/O7GKP9KWdfbsb7vhfgQzRfX4ahh5NZV4ozZ4+SdzYG8WxetsLy84UzLX3Pi++xpVn1OkFQ==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -1859,8 +1859,8 @@ packages: dev: true optional: true - /esbuild-linux-riscv64/0.14.49: - resolution: {integrity: sha512-h66ORBz+Dg+1KgLvzTVQEA1LX4XBd1SK0Fgbhhw4akpG/YkN8pS6OzYI/7SGENiN6ao5hETRDSkVcvU9NRtkMQ==} + /esbuild-linux-riscv64/0.14.50: + resolution: {integrity: sha512-0+dsneSEihZTopoO9B6Z6K4j3uI7EdxBP7YSF5rTwUgCID+wHD3vM1gGT0m+pjCW+NOacU9kH/WE9N686FHAJg==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -1868,8 +1868,8 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.14.49: - resolution: {integrity: sha512-DhrUoFVWD+XmKO1y7e4kNCqQHPs6twz6VV6Uezl/XHYGzM60rBewBF5jlZjG0nCk5W/Xy6y1xWeopkrhFFM0sQ==} + /esbuild-linux-s390x/0.14.50: + resolution: {integrity: sha512-tVjqcu8o0P9H4StwbIhL1sQYm5mWATlodKB6dpEZFkcyTI8kfIGWiWcrGmkNGH2i1kBUOsdlBafPxR3nzp3TDA==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -1877,8 +1877,8 @@ packages: dev: true optional: true - /esbuild-netbsd-64/0.14.49: - resolution: {integrity: sha512-BXaUwFOfCy2T+hABtiPUIpWjAeWK9P8O41gR4Pg73hpzoygVGnj0nI3YK4SJhe52ELgtdgWP/ckIkbn2XaTxjQ==} + /esbuild-netbsd-64/0.14.50: + resolution: {integrity: sha512-0R/glfqAQ2q6MHDf7YJw/TulibugjizBxyPvZIcorH0Mb7vSimdHy0XF5uCba5CKt+r4wjax1mvO9lZ4jiAhEg==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -1886,8 +1886,8 @@ packages: dev: true optional: true - /esbuild-openbsd-64/0.14.49: - resolution: {integrity: sha512-lP06UQeLDGmVPw9Rg437Btu6J9/BmyhdoefnQ4gDEJTtJvKtQaUcOQrhjTq455ouZN4EHFH1h28WOJVANK41kA==} + /esbuild-openbsd-64/0.14.50: + resolution: {integrity: sha512-7PAtmrR5mDOFubXIkuxYQ4bdNS6XCK8AIIHUiZxq1kL8cFIH5731jPcXQ4JNy/wbj1C9sZ8rzD8BIM80Tqk29w==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -1895,8 +1895,8 @@ packages: dev: true optional: true - /esbuild-sunos-64/0.14.49: - resolution: {integrity: sha512-4c8Zowp+V3zIWje329BeLbGh6XI9c/rqARNaj5yPHdC61pHI9UNdDxT3rePPJeWcEZVKjkiAS6AP6kiITp7FSw==} + /esbuild-sunos-64/0.14.50: + resolution: {integrity: sha512-gBxNY/wyptvD7PkHIYcq7se6SQEXcSC8Y7mE0FJB+CGgssEWf6vBPfTTZ2b6BWKnmaP6P6qb7s/KRIV5T2PxsQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -1904,8 +1904,8 @@ packages: dev: true optional: true - /esbuild-windows-32/0.14.49: - resolution: {integrity: sha512-q7Rb+J9yHTeKr9QTPDYkqfkEj8/kcKz9lOabDuvEXpXuIcosWCJgo5Z7h/L4r7rbtTH4a8U2FGKb6s1eeOHmJA==} + /esbuild-windows-32/0.14.50: + resolution: {integrity: sha512-MOOe6J9cqe/iW1qbIVYSAqzJFh0p2LBLhVUIWdMVnNUNjvg2/4QNX4oT4IzgDeldU+Bym9/Tn6+DxvUHJXL5Zw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -1913,8 +1913,8 @@ packages: dev: true optional: true - /esbuild-windows-64/0.14.49: - resolution: {integrity: sha512-+Cme7Ongv0UIUTniPqfTX6mJ8Deo7VXw9xN0yJEN1lQMHDppTNmKwAM3oGbD/Vqff+07K2gN0WfNkMohmG+dVw==} + /esbuild-windows-64/0.14.50: + resolution: {integrity: sha512-r/qE5Ex3w1jjGv/JlpPoWB365ldkppUlnizhMxJgojp907ZF1PgLTuW207kgzZcSCXyquL9qJkMsY+MRtaZ5yQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -1922,8 +1922,8 @@ packages: dev: true optional: true - /esbuild-windows-arm64/0.14.49: - resolution: {integrity: sha512-v+HYNAXzuANrCbbLFJ5nmO3m5y2PGZWLe3uloAkLt87aXiO2mZr3BTmacZdjwNkNEHuH3bNtN8cak+mzVjVPfA==} + /esbuild-windows-arm64/0.14.50: + resolution: {integrity: sha512-EMS4lQnsIe12ZyAinOINx7eq2mjpDdhGZZWDwPZE/yUTN9cnc2Ze/xUTYIAyaJqrqQda3LnDpADKpvLvol6ENQ==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -1931,32 +1931,32 @@ packages: dev: true optional: true - /esbuild/0.14.49: - resolution: {integrity: sha512-/TlVHhOaq7Yz8N1OJrjqM3Auzo5wjvHFLk+T8pIue+fhnhIMpfAzsG6PLVMbFveVxqD2WOp3QHei+52IMUNmCw==} + /esbuild/0.14.50: + resolution: {integrity: sha512-SbC3k35Ih2IC6trhbMYW7hYeGdjPKf9atTKwBUHqMCYFZZ9z8zhuvfnZihsnJypl74FjiAKjBRqFkBkAd0rS/w==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - esbuild-android-64: 0.14.49 - esbuild-android-arm64: 0.14.49 - esbuild-darwin-64: 0.14.49 - esbuild-darwin-arm64: 0.14.49 - esbuild-freebsd-64: 0.14.49 - esbuild-freebsd-arm64: 0.14.49 - esbuild-linux-32: 0.14.49 - esbuild-linux-64: 0.14.49 - esbuild-linux-arm: 0.14.49 - esbuild-linux-arm64: 0.14.49 - esbuild-linux-mips64le: 0.14.49 - esbuild-linux-ppc64le: 0.14.49 - esbuild-linux-riscv64: 0.14.49 - esbuild-linux-s390x: 0.14.49 - esbuild-netbsd-64: 0.14.49 - esbuild-openbsd-64: 0.14.49 - esbuild-sunos-64: 0.14.49 - esbuild-windows-32: 0.14.49 - esbuild-windows-64: 0.14.49 - esbuild-windows-arm64: 0.14.49 + esbuild-android-64: 0.14.50 + esbuild-android-arm64: 0.14.50 + esbuild-darwin-64: 0.14.50 + esbuild-darwin-arm64: 0.14.50 + esbuild-freebsd-64: 0.14.50 + esbuild-freebsd-arm64: 0.14.50 + esbuild-linux-32: 0.14.50 + esbuild-linux-64: 0.14.50 + esbuild-linux-arm: 0.14.50 + esbuild-linux-arm64: 0.14.50 + esbuild-linux-mips64le: 0.14.50 + esbuild-linux-ppc64le: 0.14.50 + esbuild-linux-riscv64: 0.14.50 + esbuild-linux-s390x: 0.14.50 + esbuild-netbsd-64: 0.14.50 + esbuild-openbsd-64: 0.14.50 + esbuild-sunos-64: 0.14.50 + esbuild-windows-32: 0.14.50 + esbuild-windows-64: 0.14.50 + esbuild-windows-arm64: 0.14.50 dev: true /escalade/3.1.1: @@ -3899,8 +3899,8 @@ packages: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true - /sanitize-html/2.7.0: - resolution: {integrity: sha512-jfQelabOn5voO7FAfnQF7v+jsA6z9zC/O4ec0z3E35XPEtHYJT/OdUziVWlKW4irCr2kXaQAyXTXDHWAibg1tA==} + /sanitize-html/2.7.1: + resolution: {integrity: sha512-oOpe8l4J8CaBk++2haoN5yNI5beekjuHv3JRPKUx/7h40Rdr85pemn4NkvUB3TcBP7yjat574sPlcMAyv4UQig==} dependencies: deepmerge: 4.2.2 escape-string-regexp: 4.0.0 @@ -4430,16 +4430,16 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typedoc-plugin-missing-exports/0.23.0_typedoc@0.23.8: + /typedoc-plugin-missing-exports/0.23.0_typedoc@0.23.9: resolution: {integrity: sha512-9smahDSsFRno9ZwoEshQDuIYMHWGB1E6LUud5qMxR2wNZ0T4DlZz0QjoK3HzXtX34mUpTH0dYtt7NQUK4D6B6Q==} peerDependencies: typedoc: 0.22.x || 0.23.x dependencies: - typedoc: 0.23.8_typescript@4.7.4 + typedoc: 0.23.9_typescript@4.7.4 dev: true - /typedoc/0.23.8_typescript@4.7.4: - resolution: {integrity: sha512-NLRTY/7XSrhiowR3xnH/nlfTnHk+dkzhHWAMT8guoZ6RHCQZIu3pJREMCqzdkWVCC5+dr9We7TtNeprR3Qy6Ag==} + /typedoc/0.23.9_typescript@4.7.4: + resolution: {integrity: sha512-rvWci2KHwteVUufZjjtIy/4PIHiE66t4VW4Ob6pezV//GHZ9Px0CHE5iq032GZzKONJWnNb+EJsrQv32INRvxA==} engines: {node: '>= 14.14'} hasBin: true peerDependencies: @@ -4556,7 +4556,7 @@ packages: stylus: optional: true dependencies: - esbuild: 0.14.49 + esbuild: 0.14.50 postcss: 8.4.14 resolve: 1.22.1 rollup: 2.77.0 @@ -4564,8 +4564,8 @@ packages: fsevents: 2.3.2 dev: true - /vite/3.0.2: - resolution: {integrity: sha512-TAqydxW/w0U5AoL5AsD9DApTvGb2iNbGs3sN4u2VdT1GFkQVUfgUldt+t08TZgi23uIauh1TUOQJALduo9GXqw==} + /vite/3.0.3: + resolution: {integrity: sha512-sDIpIcl3mv1NUaSzZwiXGEy1ZoWwwC2vkxUHY6yiDacR6zf//ZFuBJrozO62gedpE43pmxnLATNR5IYUdAEkMQ==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -4583,7 +4583,7 @@ packages: terser: optional: true dependencies: - esbuild: 0.14.49 + esbuild: 0.14.50 postcss: 8.4.14 resolve: 1.22.1 rollup: 2.77.0 @@ -4591,13 +4591,13 @@ packages: fsevents: 2.3.2 dev: true - /vitepress/0.22.4_tgqivcw5eyibsasgiakey2gfxq: + /vitepress/0.22.4_ju6wpa2hqqdrjfl4p3m6tanjem: resolution: {integrity: sha512-oZUnLO/SpYdThaBKefDeOiVlr0Rie4Ppx3FzMnMyLtJnI5GlBMNjqYqMy/4+umm/iC+ZDJfI+IlDKxv5fZnYzA==} engines: {node: '>=14.0.0'} hasBin: true dependencies: '@docsearch/css': 3.1.1 - '@docsearch/js': 3.1.1_tgqivcw5eyibsasgiakey2gfxq + '@docsearch/js': 3.1.1_ju6wpa2hqqdrjfl4p3m6tanjem '@vitejs/plugin-vue': 2.3.3_vite@2.9.14+vue@3.2.37 prismjs: 1.28.0 vite: 2.9.14 @@ -4612,12 +4612,13 @@ packages: - stylus dev: true - /vitest/0.18.1_ps3rclznr4tkimneamanfdq2tu: - resolution: {integrity: sha512-4F/1K/Vn4AvJwe7i2YblR02PT5vMKcw9KN4unDq2KD0YcSxX0B/6D6Qu9PJaXwVuxXMFTQ5ovd4+CQaW3bwofA==} + /vitest/0.19.1_jcfjdqfldivpyjgll3wfgmwbia: + resolution: {integrity: sha512-E/ZXpFMUahn731wzhMBNzWRp4mGgiZFT0xdHa32cbNO0CSaHpE9hTfteEU247Gi2Dula8uXo5vvrNB6dtszmQA==} engines: {node: '>=v14.16.0'} hasBin: true peerDependencies: '@edge-runtime/vm': '*' + '@vitest/browser': '*' '@vitest/ui': '*' c8: '*' happy-dom: '*' @@ -4625,6 +4626,8 @@ packages: peerDependenciesMeta: '@edge-runtime/vm': optional: true + '@vitest/browser': + optional: true '@vitest/ui': optional: true c8: @@ -4637,14 +4640,14 @@ packages: '@types/chai': 4.3.1 '@types/chai-subset': 1.3.3 '@types/node': 18.0.6 - '@vitest/ui': 0.18.1 + '@vitest/ui': 0.19.1 c8: 7.12.0 chai: 4.3.6 debug: 4.3.4 local-pkg: 0.4.2 tinypool: 0.2.4 tinyspy: 1.0.0 - vite: 3.0.2 + vite: 3.0.3 transitivePeerDependencies: - less - sass diff --git a/src/modules/company/index.ts b/src/modules/company/index.ts index fb5f2e666e1..968afbbfcbe 100644 --- a/src/modules/company/index.ts +++ b/src/modules/company/index.ts @@ -1,4 +1,5 @@ import type { Faker } from '../..'; +import { deprecated } from '../../internal/deprecated'; /** * Module to generate company related entries. @@ -31,9 +32,9 @@ export class Company { * @param format The optional format index used to select a format. * * @example - * faker.company.companyName() // 'Zieme, Hauck and McClure' + * faker.company.name() // 'Zieme, Hauck and McClure' */ - companyName(format?: number): string { + name(format?: number): string { const formats = [ '{{name.lastName}} {{company.companySuffix}}', '{{name.lastName}} - {{name.lastName}}', @@ -47,6 +48,29 @@ export class Company { return this.faker.fake(formats[format]); } + /** + * Generates a random company name. + * + * @param format The optional format index used to select a format. + * + * @see faker.company.name + * + * @example + * faker.company.companyName() // 'Zieme, Hauck and McClure' + * + * @deprecated Use `faker.company.name()` instead + */ + companyName(format?: number): string { + deprecated({ + deprecated: 'faker.company.companyName()', + proposed: 'faker.company.name()', + since: '7.4', + until: '8.0', + }); + + return this.name(format); + } + /** * Returns a random company suffix. * diff --git a/src/utils/types.ts b/src/utils/types.ts index 65c87ebf1cc..012ad58beb0 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -7,14 +7,22 @@ export type LiteralUnion = | T | (U & { zz_IGNORE_ME?: never }); +/** + * Basically a function that returns a value. + * + * For some strange reason this is not the same as `Function`. + */ +export type Callable = (...args) => unknown; + /** * Type that represents a single method/function name of the given type. */ -export type MethodOf< - ObjectType, - Signature extends (...args) => unknown = (...args) => unknown -> = { - [Key in keyof ObjectType]: ObjectType[Key] extends Signature ? Key : never; +export type MethodOf = { + [Key in keyof ObjectType]: ObjectType[Key] extends Signature + ? Key extends string + ? Key + : never + : never; }[keyof ObjectType]; /** @@ -22,5 +30,5 @@ export type MethodOf< */ export type MethodsOf< ObjectType, - Signature extends (...args) => unknown = (...args) => unknown + Signature extends Callable = Callable > = ReadonlyArray>; diff --git a/test/__snapshots__/address.spec.ts.snap b/test/__snapshots__/address.spec.ts.snap index 04956b4e2d9..3b158ec2dd7 100644 --- a/test/__snapshots__/address.spec.ts.snap +++ b/test/__snapshots__/address.spec.ts.snap @@ -1,166 +1,265 @@ // Vitest Snapshot v1 -exports[`address > seed: 42 > cardinalDirection() > returns abbreviation when useAbbr is true 1`] = `"E"`; +exports[`address > 42 > buildingNumber 1`] = `"7917"`; -exports[`address > seed: 42 > cardinalDirection() > returns random cardinal direction 1`] = `"East"`; +exports[`address > 42 > cardinalDirection > noArgs 1`] = `"East"`; -exports[`address > seed: 42 > city() 1`] = `"Port Valentine"`; +exports[`address > 42 > cardinalDirection > with abbr = false 1`] = `"East"`; -exports[`address > seed: 42 > cityName() 1`] = `"Gulfport"`; +exports[`address > 42 > cardinalDirection > with abbr = true 1`] = `"E"`; -exports[`address > seed: 42 > cityPrefix() 1`] = `"West"`; +exports[`address > 42 > city > noArgs 1`] = `"Port Valentine"`; -exports[`address > seed: 42 > citySuffix() 1`] = `"bury"`; +exports[`address > 42 > city > with given index 1`] = `"West Peyton"`; -exports[`address > seed: 42 > country() 1`] = `"Haiti"`; +exports[`address > 42 > cityName 1`] = `"Gulfport"`; -exports[`address > seed: 42 > countryCode() 1`] = `"GY"`; +exports[`address > 42 > cityPrefix 1`] = `"West"`; -exports[`address > seed: 42 > county() 1`] = `"Berkshire"`; +exports[`address > 42 > citySuffix 1`] = `"bury"`; -exports[`address > seed: 42 > direction() > returns abbreviation when useAbbr is true 1`] = `"S"`; +exports[`address > 42 > country 1`] = `"Haiti"`; -exports[`address > seed: 42 > direction() > returns random direction 1`] = `"South"`; +exports[`address > 42 > countryCode > noArgs 1`] = `"GY"`; -exports[`address > seed: 42 > direction() > should not return abbreviation when useAbbr is false 1`] = `"South"`; +exports[`address > 42 > countryCode > with code = alpha-2 1`] = `"GY"`; -exports[`address > seed: 42 > nearbyGPSCoordinate() > returns expected coordinates 1`] = ` +exports[`address > 42 > countryCode > with code = alpha-3 1`] = `"SAU"`; + +exports[`address > 42 > county 1`] = `"Berkshire"`; + +exports[`address > 42 > direction > noArgs 1`] = `"South"`; + +exports[`address > 42 > direction > with abbr = false 1`] = `"South"`; + +exports[`address > 42 > direction > with abbr = true 1`] = `"S"`; + +exports[`address > 42 > latitude > noArgs 1`] = `"-22.5828"`; + +exports[`address > 42 > longitude > noArgs 1`] = `"-45.1656"`; + +exports[`address > 42 > nearbyGPSCoordinate > near origin 1`] = ` [ "0.0814", "-0.0809", ] `; -exports[`address > seed: 42 > ordinalDirection() > returns abbreviation when useAbbr is true 1`] = `"NW"`; +exports[`address > 42 > nearbyGPSCoordinate > noArgs 1`] = ` +[ + "-22.5828", + "106.7555", +] +`; + +exports[`address > 42 > ordinalDirection > noArgs 1`] = `"Northwest"`; + +exports[`address > 42 > ordinalDirection > with abbr = false 1`] = `"Northwest"`; + +exports[`address > 42 > ordinalDirection > with abbr = true 1`] = `"NW"`; -exports[`address > seed: 42 > ordinalDirection() > returns random ordinal direction 1`] = `"Northwest"`; +exports[`address > 42 > secondaryAddress 1`] = `"Apt. 791"`; -exports[`address > seed: 42 > secondaryAddress() 1`] = `"Apt. 791"`; +exports[`address > 42 > state 1`] = `"Maine"`; -exports[`address > seed: 42 > state() 1`] = `"Maine"`; +exports[`address > 42 > stateAbbr 1`] = `"ME"`; -exports[`address > seed: 42 > stateAbbr() 1`] = `"ME"`; +exports[`address > 42 > street 1`] = `"Peyton Village"`; -exports[`address > seed: 42 > streetAddress() > should return street name with a building number 1`] = `"7917 Metz Pine"`; +exports[`address > 42 > streetAddress > noArgs 1`] = `"7917 Metz Pine"`; -exports[`address > seed: 42 > streetAddress() > should return street name with a building number and a secondary address 1`] = `"7917 Metz Pine Apt. 410"`; +exports[`address > 42 > streetAddress > with useFullAddress = false 1`] = `"7917 Metz Pine"`; -exports[`address > seed: 42 > streetName() 1`] = `"Peyton Village"`; +exports[`address > 42 > streetAddress > with useFullAddress = true 1`] = `"7917 Metz Pine Apt. 410"`; -exports[`address > seed: 42 > streetPrefix() 1`] = `"b"`; +exports[`address > 42 > streetName 1`] = `"Peyton Village"`; -exports[`address > seed: 42 > streetSuffix() 1`] = `"Isle"`; +exports[`address > 42 > streetPrefix 1`] = `"b"`; -exports[`address > seed: 42 > timeZone() 1`] = `"Europe/Amsterdam"`; +exports[`address > 42 > streetSuffix 1`] = `"Isle"`; -exports[`address > seed: 42 > zipCode() 1`] = `"79177"`; +exports[`address > 42 > timeZone 1`] = `"Europe/Amsterdam"`; -exports[`address > seed: 1211 > cardinalDirection() > returns abbreviation when useAbbr is true 1`] = `"W"`; +exports[`address > 42 > zipCode > noArgs 1`] = `"79177"`; -exports[`address > seed: 1211 > cardinalDirection() > returns random cardinal direction 1`] = `"West"`; +exports[`address > 42 > zipCode > with format 1`] = `"379-177"`; -exports[`address > seed: 1211 > city() 1`] = `"La Crosse"`; +exports[`address > 42 > zipCodeByState > state 1`] = `"79177"`; -exports[`address > seed: 1211 > cityName() 1`] = `"Urbana"`; +exports[`address > 42 > zipCodeByState > state2 1`] = `"79177"`; -exports[`address > seed: 1211 > cityPrefix() 1`] = `"Fort"`; +exports[`address > 1211 > buildingNumber 1`] = `"487"`; -exports[`address > seed: 1211 > citySuffix() 1`] = `"shire"`; +exports[`address > 1211 > cardinalDirection > noArgs 1`] = `"West"`; -exports[`address > seed: 1211 > country() 1`] = `"Uganda"`; +exports[`address > 1211 > cardinalDirection > with abbr = false 1`] = `"West"`; -exports[`address > seed: 1211 > countryCode() 1`] = `"UM"`; +exports[`address > 1211 > cardinalDirection > with abbr = true 1`] = `"W"`; -exports[`address > seed: 1211 > county() 1`] = `"Cambridgeshire"`; +exports[`address > 1211 > city > noArgs 1`] = `"La Crosse"`; -exports[`address > seed: 1211 > direction() > returns abbreviation when useAbbr is true 1`] = `"SW"`; +exports[`address > 1211 > city > with given index 1`] = `"Fort Jadon"`; -exports[`address > seed: 1211 > direction() > returns random direction 1`] = `"Southwest"`; +exports[`address > 1211 > cityName 1`] = `"Urbana"`; -exports[`address > seed: 1211 > direction() > should not return abbreviation when useAbbr is false 1`] = `"Southwest"`; +exports[`address > 1211 > cityPrefix 1`] = `"Fort"`; -exports[`address > seed: 1211 > nearbyGPSCoordinate() > returns expected coordinates 1`] = ` +exports[`address > 1211 > citySuffix 1`] = `"shire"`; + +exports[`address > 1211 > country 1`] = `"Uganda"`; + +exports[`address > 1211 > countryCode > noArgs 1`] = `"UM"`; + +exports[`address > 1211 > countryCode > with code = alpha-2 1`] = `"UM"`; + +exports[`address > 1211 > countryCode > with code = alpha-3 1`] = `"IRN"`; + +exports[`address > 1211 > county 1`] = `"Cambridgeshire"`; + +exports[`address > 1211 > direction > noArgs 1`] = `"Southwest"`; + +exports[`address > 1211 > direction > with abbr = false 1`] = `"Southwest"`; + +exports[`address > 1211 > direction > with abbr = true 1`] = `"SW"`; + +exports[`address > 1211 > latitude > noArgs 1`] = `"77.1337"`; + +exports[`address > 1211 > longitude > noArgs 1`] = `"154.2673"`; + +exports[`address > 1211 > nearbyGPSCoordinate > near origin 1`] = ` [ "-0.0287", "0.0596", ] `; -exports[`address > seed: 1211 > ordinalDirection() > returns abbreviation when useAbbr is true 1`] = `"SW"`; +exports[`address > 1211 > nearbyGPSCoordinate > noArgs 1`] = ` +[ + "77.1337", + "-14.7545", +] +`; + +exports[`address > 1211 > ordinalDirection > noArgs 1`] = `"Southwest"`; + +exports[`address > 1211 > ordinalDirection > with abbr = false 1`] = `"Southwest"`; + +exports[`address > 1211 > ordinalDirection > with abbr = true 1`] = `"SW"`; + +exports[`address > 1211 > secondaryAddress 1`] = `"Suite 487"`; + +exports[`address > 1211 > state 1`] = `"Washington"`; + +exports[`address > 1211 > stateAbbr 1`] = `"WA"`; + +exports[`address > 1211 > street 1`] = `"Koch Turnpike"`; + +exports[`address > 1211 > streetAddress > noArgs 1`] = `"487 Breana Wells"`; + +exports[`address > 1211 > streetAddress > with useFullAddress = false 1`] = `"487 Breana Wells"`; + +exports[`address > 1211 > streetAddress > with useFullAddress = true 1`] = `"487 Breana Wells Apt. 616"`; + +exports[`address > 1211 > streetName 1`] = `"Koch Turnpike"`; + +exports[`address > 1211 > streetPrefix 1`] = `"c"`; -exports[`address > seed: 1211 > ordinalDirection() > returns random ordinal direction 1`] = `"Southwest"`; +exports[`address > 1211 > streetSuffix 1`] = `"Via"`; -exports[`address > seed: 1211 > secondaryAddress() 1`] = `"Suite 487"`; +exports[`address > 1211 > timeZone 1`] = `"Asia/Magadan"`; -exports[`address > seed: 1211 > state() 1`] = `"Washington"`; +exports[`address > 1211 > zipCode > noArgs 1`] = `"48721-9061"`; -exports[`address > seed: 1211 > stateAbbr() 1`] = `"WA"`; +exports[`address > 1211 > zipCode > with format 1`] = `"948-721"`; -exports[`address > seed: 1211 > streetAddress() > should return street name with a building number 1`] = `"487 Breana Wells"`; +exports[`address > 1211 > zipCodeByState > state 1`] = `"48721-9061"`; -exports[`address > seed: 1211 > streetAddress() > should return street name with a building number and a secondary address 1`] = `"487 Breana Wells Apt. 616"`; +exports[`address > 1211 > zipCodeByState > state2 1`] = `"48721-9061"`; -exports[`address > seed: 1211 > streetName() 1`] = `"Koch Turnpike"`; +exports[`address > 1337 > buildingNumber 1`] = `"51225"`; -exports[`address > seed: 1211 > streetPrefix() 1`] = `"c"`; +exports[`address > 1337 > cardinalDirection > noArgs 1`] = `"East"`; -exports[`address > seed: 1211 > streetSuffix() 1`] = `"Via"`; +exports[`address > 1337 > cardinalDirection > with abbr = false 1`] = `"East"`; -exports[`address > seed: 1211 > timeZone() 1`] = `"Asia/Magadan"`; +exports[`address > 1337 > cardinalDirection > with abbr = true 1`] = `"E"`; -exports[`address > seed: 1211 > zipCode() 1`] = `"48721-9061"`; +exports[`address > 1337 > city > noArgs 1`] = `"New Carmelo"`; -exports[`address > seed: 1337 > cardinalDirection() > returns abbreviation when useAbbr is true 1`] = `"E"`; +exports[`address > 1337 > city > with given index 1`] = `"West Keith"`; -exports[`address > seed: 1337 > cardinalDirection() > returns random cardinal direction 1`] = `"East"`; +exports[`address > 1337 > cityName 1`] = `"Dubuque"`; -exports[`address > seed: 1337 > city() 1`] = `"New Carmelo"`; +exports[`address > 1337 > cityPrefix 1`] = `"West"`; -exports[`address > seed: 1337 > cityName() 1`] = `"Dubuque"`; +exports[`address > 1337 > citySuffix 1`] = `"boro"`; -exports[`address > seed: 1337 > cityPrefix() 1`] = `"West"`; +exports[`address > 1337 > country 1`] = `"Equatorial Guinea"`; -exports[`address > seed: 1337 > citySuffix() 1`] = `"boro"`; +exports[`address > 1337 > countryCode > noArgs 1`] = `"EH"`; -exports[`address > seed: 1337 > country() 1`] = `"Equatorial Guinea"`; +exports[`address > 1337 > countryCode > with code = alpha-2 1`] = `"EH"`; -exports[`address > seed: 1337 > countryCode() 1`] = `"EH"`; +exports[`address > 1337 > countryCode > with code = alpha-3 1`] = `"PRI"`; -exports[`address > seed: 1337 > county() 1`] = `"Bedfordshire"`; +exports[`address > 1337 > county 1`] = `"Bedfordshire"`; -exports[`address > seed: 1337 > direction() > returns abbreviation when useAbbr is true 1`] = `"S"`; +exports[`address > 1337 > direction > noArgs 1`] = `"South"`; -exports[`address > seed: 1337 > direction() > returns random direction 1`] = `"South"`; +exports[`address > 1337 > direction > with abbr = false 1`] = `"South"`; -exports[`address > seed: 1337 > direction() > should not return abbreviation when useAbbr is false 1`] = `"South"`; +exports[`address > 1337 > direction > with abbr = true 1`] = `"S"`; -exports[`address > seed: 1337 > nearbyGPSCoordinate() > returns expected coordinates 1`] = ` +exports[`address > 1337 > latitude > noArgs 1`] = `"-42.8356"`; + +exports[`address > 1337 > longitude > noArgs 1`] = `"-85.6711"`; + +exports[`address > 1337 > nearbyGPSCoordinate > near origin 1`] = ` [ "0.0806", "-0.0061", ] `; -exports[`address > seed: 1337 > ordinalDirection() > returns abbreviation when useAbbr is true 1`] = `"NW"`; +exports[`address > 1337 > nearbyGPSCoordinate > noArgs 1`] = ` +[ + "-42.8356", + "21.7907", +] +`; + +exports[`address > 1337 > ordinalDirection > noArgs 1`] = `"Northwest"`; + +exports[`address > 1337 > ordinalDirection > with abbr = false 1`] = `"Northwest"`; + +exports[`address > 1337 > ordinalDirection > with abbr = true 1`] = `"NW"`; + +exports[`address > 1337 > secondaryAddress 1`] = `"Apt. 512"`; + +exports[`address > 1337 > state 1`] = `"Indiana"`; + +exports[`address > 1337 > stateAbbr 1`] = `"IN"`; + +exports[`address > 1337 > street 1`] = `"Keith Dam"`; -exports[`address > seed: 1337 > ordinalDirection() > returns random ordinal direction 1`] = `"Northwest"`; +exports[`address > 1337 > streetAddress > noArgs 1`] = `"51225 Alexys Haven"`; -exports[`address > seed: 1337 > secondaryAddress() 1`] = `"Apt. 512"`; +exports[`address > 1337 > streetAddress > with useFullAddress = false 1`] = `"51225 Alexys Haven"`; -exports[`address > seed: 1337 > state() 1`] = `"Indiana"`; +exports[`address > 1337 > streetAddress > with useFullAddress = true 1`] = `"51225 Alexys Haven Apt. 552"`; -exports[`address > seed: 1337 > stateAbbr() 1`] = `"IN"`; +exports[`address > 1337 > streetName 1`] = `"Keith Dam"`; -exports[`address > seed: 1337 > streetAddress() > should return street name with a building number 1`] = `"51225 Alexys Haven"`; +exports[`address > 1337 > streetPrefix 1`] = `"a"`; -exports[`address > seed: 1337 > streetAddress() > should return street name with a building number and a secondary address 1`] = `"51225 Alexys Haven Apt. 552"`; +exports[`address > 1337 > streetSuffix 1`] = `"Forks"`; -exports[`address > seed: 1337 > streetName() 1`] = `"Keith Dam"`; +exports[`address > 1337 > timeZone 1`] = `"Africa/Casablanca"`; -exports[`address > seed: 1337 > streetPrefix() 1`] = `"a"`; +exports[`address > 1337 > zipCode > noArgs 1`] = `"51225"`; -exports[`address > seed: 1337 > streetSuffix() 1`] = `"Forks"`; +exports[`address > 1337 > zipCode > with format 1`] = `"251-225"`; -exports[`address > seed: 1337 > timeZone() 1`] = `"Africa/Casablanca"`; +exports[`address > 1337 > zipCodeByState > state 1`] = `"51225"`; -exports[`address > seed: 1337 > zipCode() 1`] = `"51225"`; +exports[`address > 1337 > zipCodeByState > state2 1`] = `"51225"`; diff --git a/test/__snapshots__/animal.spec.ts.snap b/test/__snapshots__/animal.spec.ts.snap index 8d4b4f4dcc9..70a079891d5 100644 --- a/test/__snapshots__/animal.spec.ts.snap +++ b/test/__snapshots__/animal.spec.ts.snap @@ -1,85 +1,85 @@ // Vitest Snapshot v1 -exports[`animal > seed: 42 > bear() 1`] = `"Sun bear"`; +exports[`animal > 42 > bear 1`] = `"Sun bear"`; -exports[`animal > seed: 42 > bird() 1`] = `"Iceland Gull"`; +exports[`animal > 42 > bird 1`] = `"Iceland Gull"`; -exports[`animal > seed: 42 > cat() 1`] = `"Himalayan"`; +exports[`animal > 42 > cat 1`] = `"Himalayan"`; -exports[`animal > seed: 42 > cetacean() 1`] = `"Pantropical Spotted Dolphin"`; +exports[`animal > 42 > cetacean 1`] = `"Pantropical Spotted Dolphin"`; -exports[`animal > seed: 42 > cow() 1`] = `"Fleckvieh"`; +exports[`animal > 42 > cow 1`] = `"Fleckvieh"`; -exports[`animal > seed: 42 > crocodilia() 1`] = `"African Slender-snouted Crocodile"`; +exports[`animal > 42 > crocodilia 1`] = `"African Slender-snouted Crocodile"`; -exports[`animal > seed: 42 > dog() 1`] = `"Garafian Shepherd"`; +exports[`animal > 42 > dog 1`] = `"Garafian Shepherd"`; -exports[`animal > seed: 42 > fish() 1`] = `"Northern snakehead"`; +exports[`animal > 42 > fish 1`] = `"Northern snakehead"`; -exports[`animal > seed: 42 > horse() 1`] = `"Furioso-North Star"`; +exports[`animal > 42 > horse 1`] = `"Furioso-North Star"`; -exports[`animal > seed: 42 > insect() 1`] = `"Gouty oak gall"`; +exports[`animal > 42 > insect 1`] = `"Gouty oak gall"`; -exports[`animal > seed: 42 > lion() 1`] = `"West African Lion"`; +exports[`animal > 42 > lion 1`] = `"West African Lion"`; -exports[`animal > seed: 42 > rabbit() 1`] = `"English Spot"`; +exports[`animal > 42 > rabbit 1`] = `"English Spot"`; -exports[`animal > seed: 42 > snake() 1`] = `"Grey-banded kingsnake"`; +exports[`animal > 42 > snake 1`] = `"Grey-banded kingsnake"`; -exports[`animal > seed: 42 > type() 1`] = `"lion"`; +exports[`animal > 42 > type 1`] = `"lion"`; -exports[`animal > seed: 1211 > bear() 1`] = `"Polar bear"`; +exports[`animal > 1211 > bear 1`] = `"Polar bear"`; -exports[`animal > seed: 1211 > bird() 1`] = `"Reed Bunting"`; +exports[`animal > 1211 > bird 1`] = `"Reed Bunting"`; -exports[`animal > seed: 1211 > cat() 1`] = `"Tonkinese"`; +exports[`animal > 1211 > cat 1`] = `"Tonkinese"`; -exports[`animal > seed: 1211 > cetacean() 1`] = `"La Plata Dolphin"`; +exports[`animal > 1211 > cetacean 1`] = `"La Plata Dolphin"`; -exports[`animal > seed: 1211 > cow() 1`] = `"Breed"`; +exports[`animal > 1211 > cow 1`] = `"Breed"`; -exports[`animal > seed: 1211 > crocodilia() 1`] = `"Gharial"`; +exports[`animal > 1211 > crocodilia 1`] = `"Gharial"`; -exports[`animal > seed: 1211 > dog() 1`] = `"Tibetan Spaniel"`; +exports[`animal > 1211 > dog 1`] = `"Tibetan Spaniel"`; -exports[`animal > seed: 1211 > fish() 1`] = `"Bigeye scad"`; +exports[`animal > 1211 > fish 1`] = `"Bigeye scad"`; -exports[`animal > seed: 1211 > horse() 1`] = `"Ukrainian Riding Horse"`; +exports[`animal > 1211 > horse 1`] = `"Ukrainian Riding Horse"`; -exports[`animal > seed: 1211 > insect() 1`] = `"Western paper wasp"`; +exports[`animal > 1211 > insect 1`] = `"Western paper wasp"`; -exports[`animal > seed: 1211 > lion() 1`] = `"Cape lion"`; +exports[`animal > 1211 > lion 1`] = `"Cape lion"`; -exports[`animal > seed: 1211 > rabbit() 1`] = `"Silver Marten"`; +exports[`animal > 1211 > rabbit 1`] = `"Silver Marten"`; -exports[`animal > seed: 1211 > snake() 1`] = `"Tiger pit viper"`; +exports[`animal > 1211 > snake 1`] = `"Tiger pit viper"`; -exports[`animal > seed: 1211 > type() 1`] = `"horse"`; +exports[`animal > 1211 > type 1`] = `"horse"`; -exports[`animal > seed: 1337 > bear() 1`] = `"Sun bear"`; +exports[`animal > 1337 > bear 1`] = `"Sun bear"`; -exports[`animal > seed: 1337 > bird() 1`] = `"American Golden-Plover"`; +exports[`animal > 1337 > bird 1`] = `"American Golden-Plover"`; -exports[`animal > seed: 1337 > cat() 1`] = `"Devon Rex"`; +exports[`animal > 1337 > cat 1`] = `"Devon Rex"`; -exports[`animal > seed: 1337 > cetacean() 1`] = `"Costero"`; +exports[`animal > 1337 > cetacean 1`] = `"Costero"`; -exports[`animal > seed: 1337 > cow() 1`] = `"Canchim"`; +exports[`animal > 1337 > cow 1`] = `"Canchim"`; -exports[`animal > seed: 1337 > crocodilia() 1`] = `"Cuvier’s Dwarf Caiman"`; +exports[`animal > 1337 > crocodilia 1`] = `"Cuvier’s Dwarf Caiman"`; -exports[`animal > seed: 1337 > dog() 1`] = `"Chinese Crested Dog"`; +exports[`animal > 1337 > dog 1`] = `"Chinese Crested Dog"`; -exports[`animal > seed: 1337 > fish() 1`] = `"Jumbo flying squid"`; +exports[`animal > 1337 > fish 1`] = `"Jumbo flying squid"`; -exports[`animal > seed: 1337 > horse() 1`] = `"Colorado Ranger"`; +exports[`animal > 1337 > horse 1`] = `"Colorado Ranger"`; -exports[`animal > seed: 1337 > insect() 1`] = `"Eulophid wasp"`; +exports[`animal > 1337 > insect 1`] = `"Eulophid wasp"`; -exports[`animal > seed: 1337 > lion() 1`] = `"Barbary Lion"`; +exports[`animal > 1337 > lion 1`] = `"Barbary Lion"`; -exports[`animal > seed: 1337 > rabbit() 1`] = `"Cinnamon"`; +exports[`animal > 1337 > rabbit 1`] = `"Cinnamon"`; -exports[`animal > seed: 1337 > snake() 1`] = `"Fierce snake"`; +exports[`animal > 1337 > snake 1`] = `"Fierce snake"`; -exports[`animal > seed: 1337 > type() 1`] = `"bear"`; +exports[`animal > 1337 > type 1`] = `"bear"`; diff --git a/test/__snapshots__/color.spec.ts.snap b/test/__snapshots__/color.spec.ts.snap index 5d74dd479c2..36e50b80cc4 100644 --- a/test/__snapshots__/color.spec.ts.snap +++ b/test/__snapshots__/color.spec.ts.snap @@ -1,6 +1,6 @@ // Vitest Snapshot v1 -exports[`color > seed: 42 > cmyk() 1`] = ` +exports[`color > 42 > cmyk 1`] = ` [ 0.37, 0.8, @@ -9,7 +9,7 @@ exports[`color > seed: 42 > cmyk() 1`] = ` ] `; -exports[`color > seed: 42 > colorByCSSColorSpace() 1`] = ` +exports[`color > 42 > colorByCSSColorSpace 1`] = ` [ 0.3745, 0.7966, @@ -17,11 +17,11 @@ exports[`color > seed: 42 > colorByCSSColorSpace() 1`] = ` ] `; -exports[`color > seed: 42 > cssSupportedFunction() 1`] = `"hsla"`; +exports[`color > 42 > cssSupportedFunction 1`] = `"hsla"`; -exports[`color > seed: 42 > cssSupportedSpace() 1`] = `"rec2020"`; +exports[`color > 42 > cssSupportedSpace 1`] = `"rec2020"`; -exports[`color > seed: 42 > hsl() 1`] = ` +exports[`color > 42 > hsl 1`] = ` [ 135, 0.8, @@ -29,9 +29,9 @@ exports[`color > seed: 42 > hsl() 1`] = ` ] `; -exports[`color > seed: 42 > human() 1`] = `"grey"`; +exports[`color > 42 > human 1`] = `"grey"`; -exports[`color > seed: 42 > hwb() 1`] = ` +exports[`color > 42 > hwb 1`] = ` [ 135, 0.8, @@ -39,7 +39,7 @@ exports[`color > seed: 42 > hwb() 1`] = ` ] `; -exports[`color > seed: 42 > lab() 1`] = ` +exports[`color > 42 > lab 1`] = ` [ 0.37454, 59.3086, @@ -47,7 +47,7 @@ exports[`color > seed: 42 > lab() 1`] = ` ] `; -exports[`color > seed: 42 > lch() 1`] = ` +exports[`color > 42 > lch 1`] = ` [ 0.37454, 183.2, @@ -55,11 +55,11 @@ exports[`color > seed: 42 > lch() 1`] = ` ] `; -exports[`color > seed: 42 > rgb() 1`] = `"#8be4ab"`; +exports[`color > 42 > rgb 1`] = `"#8be4ab"`; -exports[`color > seed: 42 > space() 1`] = `"Rec. 709"`; +exports[`color > 42 > space 1`] = `"Rec. 709"`; -exports[`color > seed: 1211 > cmyk() 1`] = ` +exports[`color > 1211 > cmyk 1`] = ` [ 0.93, 0.46, @@ -68,7 +68,7 @@ exports[`color > seed: 1211 > cmyk() 1`] = ` ] `; -exports[`color > seed: 1211 > colorByCSSColorSpace() 1`] = ` +exports[`color > 1211 > colorByCSSColorSpace 1`] = ` [ 0.9286, 0.459, @@ -76,11 +76,11 @@ exports[`color > seed: 1211 > colorByCSSColorSpace() 1`] = ` ] `; -exports[`color > seed: 1211 > cssSupportedFunction() 1`] = `"color"`; +exports[`color > 1211 > cssSupportedFunction 1`] = `"color"`; -exports[`color > seed: 1211 > cssSupportedSpace() 1`] = `"rec2020"`; +exports[`color > 1211 > cssSupportedSpace 1`] = `"rec2020"`; -exports[`color > seed: 1211 > hsl() 1`] = ` +exports[`color > 1211 > hsl 1`] = ` [ 335, 0.46, @@ -88,9 +88,9 @@ exports[`color > seed: 1211 > hsl() 1`] = ` ] `; -exports[`color > seed: 1211 > human() 1`] = `"azure"`; +exports[`color > 1211 > human 1`] = `"azure"`; -exports[`color > seed: 1211 > hwb() 1`] = ` +exports[`color > 1211 > hwb 1`] = ` [ 335, 0.46, @@ -98,7 +98,7 @@ exports[`color > seed: 1211 > hwb() 1`] = ` ] `; -exports[`color > seed: 1211 > lab() 1`] = ` +exports[`color > 1211 > lab 1`] = ` [ 0.928521, -8.197, @@ -106,7 +106,7 @@ exports[`color > seed: 1211 > lab() 1`] = ` ] `; -exports[`color > seed: 1211 > lch() 1`] = ` +exports[`color > 1211 > lch 1`] = ` [ 0.928521, 105.6, @@ -114,11 +114,11 @@ exports[`color > seed: 1211 > lch() 1`] = ` ] `; -exports[`color > seed: 1211 > rgb() 1`] = `"#eadb42"`; +exports[`color > 1211 > rgb 1`] = `"#eadb42"`; -exports[`color > seed: 1211 > space() 1`] = `"LMS"`; +exports[`color > 1211 > space 1`] = `"LMS"`; -exports[`color > seed: 1337 > cmyk() 1`] = ` +exports[`color > 1337 > cmyk 1`] = ` [ 0.26, 0.56, @@ -127,7 +127,7 @@ exports[`color > seed: 1337 > cmyk() 1`] = ` ] `; -exports[`color > seed: 1337 > colorByCSSColorSpace() 1`] = ` +exports[`color > 1337 > colorByCSSColorSpace 1`] = ` [ 0.262, 0.5605, @@ -135,11 +135,11 @@ exports[`color > seed: 1337 > colorByCSSColorSpace() 1`] = ` ] `; -exports[`color > seed: 1337 > cssSupportedFunction() 1`] = `"hsl"`; +exports[`color > 1337 > cssSupportedFunction 1`] = `"hsl"`; -exports[`color > seed: 1337 > cssSupportedSpace() 1`] = `"display-p3"`; +exports[`color > 1337 > cssSupportedSpace 1`] = `"display-p3"`; -exports[`color > seed: 1337 > hsl() 1`] = ` +exports[`color > 1337 > hsl 1`] = ` [ 94, 0.56, @@ -147,9 +147,9 @@ exports[`color > seed: 1337 > hsl() 1`] = ` ] `; -exports[`color > seed: 1337 > human() 1`] = `"black"`; +exports[`color > 1337 > human 1`] = `"black"`; -exports[`color > seed: 1337 > hwb() 1`] = ` +exports[`color > 1337 > hwb 1`] = ` [ 94, 0.56, @@ -157,7 +157,7 @@ exports[`color > seed: 1337 > hwb() 1`] = ` ] `; -exports[`color > seed: 1337 > lab() 1`] = ` +exports[`color > 1337 > lab 1`] = ` [ 0.262024, 12.106, @@ -165,7 +165,7 @@ exports[`color > seed: 1337 > lab() 1`] = ` ] `; -exports[`color > seed: 1337 > lch() 1`] = ` +exports[`color > 1337 > lch 1`] = ` [ 0.262024, 128.9, @@ -173,6 +173,6 @@ exports[`color > seed: 1337 > lch() 1`] = ` ] `; -exports[`color > seed: 1337 > rgb() 1`] = `"#5c346b"`; +exports[`color > 1337 > rgb 1`] = `"#5c346b"`; -exports[`color > seed: 1337 > space() 1`] = `"ProPhoto RGB Color Space"`; +exports[`color > 1337 > space 1`] = `"ProPhoto RGB Color Space"`; diff --git a/test/__snapshots__/commerce.spec.ts.snap b/test/__snapshots__/commerce.spec.ts.snap index eeb210fba7f..868ff10d63e 100644 --- a/test/__snapshots__/commerce.spec.ts.snap +++ b/test/__snapshots__/commerce.spec.ts.snap @@ -1,49 +1,79 @@ // Vitest Snapshot v1 -exports[`commerce > seed: 42 > color() 1`] = `"grey"`; +exports[`commerce > 42 > color 1`] = `"grey"`; -exports[`commerce > seed: 42 > department() 1`] = `"Tools"`; +exports[`commerce > 42 > department 1`] = `"Tools"`; -exports[`commerce > seed: 42 > price() 1`] = `"375.00"`; +exports[`commerce > 42 > price > noArgs 1`] = `"375.00"`; -exports[`commerce > seed: 42 > product() 1`] = `"Pants"`; +exports[`commerce > 42 > price > with max 1`] = `"38.00"`; -exports[`commerce > seed: 42 > productAdjective() 1`] = `"Fantastic"`; +exports[`commerce > 42 > price > with min 1`] = `"406.00"`; -exports[`commerce > seed: 42 > productDescription() 1`] = `"The Apollotech B340 is an affordable wireless mouse with reliable connectivity, 12 months battery life and modern design"`; +exports[`commerce > 42 > price > with min and max 1`] = `"69.00"`; -exports[`commerce > seed: 42 > productMaterial() 1`] = `"Plastic"`; +exports[`commerce > 42 > price > with min and max and decimals 1`] = `"69.0000"`; -exports[`commerce > seed: 42 > productName() 1`] = `"Fantastic Soft Sausages"`; +exports[`commerce > 42 > price > with min and max and decimals and symbol 1`] = `"$69.0000"`; -exports[`commerce > seed: 1211 > color() 1`] = `"azure"`; +exports[`commerce > 42 > product 1`] = `"Pants"`; -exports[`commerce > seed: 1211 > department() 1`] = `"Automotive"`; +exports[`commerce > 42 > productAdjective 1`] = `"Fantastic"`; -exports[`commerce > seed: 1211 > price() 1`] = `"929.00"`; +exports[`commerce > 42 > productDescription 1`] = `"The Apollotech B340 is an affordable wireless mouse with reliable connectivity, 12 months battery life and modern design"`; -exports[`commerce > seed: 1211 > product() 1`] = `"Sausages"`; +exports[`commerce > 42 > productMaterial 1`] = `"Plastic"`; -exports[`commerce > seed: 1211 > productAdjective() 1`] = `"Unbranded"`; +exports[`commerce > 42 > productName 1`] = `"Fantastic Soft Sausages"`; -exports[`commerce > seed: 1211 > productDescription() 1`] = `"Andy shoes are designed to keeping in mind durability as well as trends, the most stylish range of shoes & sandals"`; +exports[`commerce > 1211 > color 1`] = `"azure"`; -exports[`commerce > seed: 1211 > productMaterial() 1`] = `"Frozen"`; +exports[`commerce > 1211 > department 1`] = `"Automotive"`; -exports[`commerce > seed: 1211 > productName() 1`] = `"Unbranded Cotton Salad"`; +exports[`commerce > 1211 > price > noArgs 1`] = `"929.00"`; -exports[`commerce > seed: 1337 > color() 1`] = `"black"`; +exports[`commerce > 1211 > price > with max 1`] = `"93.00"`; -exports[`commerce > seed: 1337 > department() 1`] = `"Computers"`; +exports[`commerce > 1211 > price > with min 1`] = `"933.00"`; -exports[`commerce > seed: 1337 > price() 1`] = `"263.00"`; +exports[`commerce > 1211 > price > with min and max 1`] = `"97.00"`; -exports[`commerce > seed: 1337 > product() 1`] = `"Ball"`; +exports[`commerce > 1211 > price > with min and max and decimals 1`] = `"97.0000"`; -exports[`commerce > seed: 1337 > productAdjective() 1`] = `"Incredible"`; +exports[`commerce > 1211 > price > with min and max and decimals and symbol 1`] = `"$97.0000"`; -exports[`commerce > seed: 1337 > productDescription() 1`] = `"The slim & simple Maple Gaming Keyboard from Dev Byte comes with a sleek body and 7- Color RGB LED Back-lighting for smart functionality"`; +exports[`commerce > 1211 > product 1`] = `"Sausages"`; -exports[`commerce > seed: 1337 > productMaterial() 1`] = `"Concrete"`; +exports[`commerce > 1211 > productAdjective 1`] = `"Unbranded"`; -exports[`commerce > seed: 1337 > productName() 1`] = `"Incredible Granite Keyboard"`; +exports[`commerce > 1211 > productDescription 1`] = `"Andy shoes are designed to keeping in mind durability as well as trends, the most stylish range of shoes & sandals"`; + +exports[`commerce > 1211 > productMaterial 1`] = `"Frozen"`; + +exports[`commerce > 1211 > productName 1`] = `"Unbranded Cotton Salad"`; + +exports[`commerce > 1337 > color 1`] = `"black"`; + +exports[`commerce > 1337 > department 1`] = `"Computers"`; + +exports[`commerce > 1337 > price > noArgs 1`] = `"263.00"`; + +exports[`commerce > 1337 > price > with max 1`] = `"27.00"`; + +exports[`commerce > 1337 > price > with min 1`] = `"299.00"`; + +exports[`commerce > 1337 > price > with min and max 1`] = `"63.00"`; + +exports[`commerce > 1337 > price > with min and max and decimals 1`] = `"63.0000"`; + +exports[`commerce > 1337 > price > with min and max and decimals and symbol 1`] = `"$63.0000"`; + +exports[`commerce > 1337 > product 1`] = `"Ball"`; + +exports[`commerce > 1337 > productAdjective 1`] = `"Incredible"`; + +exports[`commerce > 1337 > productDescription 1`] = `"The slim & simple Maple Gaming Keyboard from Dev Byte comes with a sleek body and 7- Color RGB LED Back-lighting for smart functionality"`; + +exports[`commerce > 1337 > productMaterial 1`] = `"Concrete"`; + +exports[`commerce > 1337 > productName 1`] = `"Incredible Granite Keyboard"`; diff --git a/test/__snapshots__/company.spec.ts.snap b/test/__snapshots__/company.spec.ts.snap index f4dfd000e64..565e27da0ef 100644 --- a/test/__snapshots__/company.spec.ts.snap +++ b/test/__snapshots__/company.spec.ts.snap @@ -1,26 +1,32 @@ // Vitest Snapshot v1 -exports[`company > seed: 42 > bs() 1`] = `"seize impactful web services"`; +exports[`company > 42 > bs 1`] = `"seize impactful web services"`; -exports[`company > seed: 42 > bsAdjective() 1`] = `"dynamic"`; +exports[`company > 42 > bsAdjective 1`] = `"dynamic"`; -exports[`company > seed: 42 > bsBuzz() 1`] = `"seize"`; +exports[`company > 42 > bsBuzz 1`] = `"seize"`; -exports[`company > seed: 42 > bsNoun() 1`] = `"portals"`; +exports[`company > 42 > bsNoun 1`] = `"portals"`; -exports[`company > seed: 42 > catchPhrase() 1`] = `"Implemented responsive throughput"`; +exports[`company > 42 > catchPhrase 1`] = `"Implemented responsive throughput"`; -exports[`company > seed: 42 > catchPhraseAdjective() 1`] = `"Implemented"`; +exports[`company > 42 > catchPhraseAdjective 1`] = `"Implemented"`; -exports[`company > seed: 42 > catchPhraseDescriptor() 1`] = `"explicit"`; +exports[`company > 42 > catchPhraseDescriptor 1`] = `"explicit"`; -exports[`company > seed: 42 > catchPhraseNoun() 1`] = `"framework"`; +exports[`company > 42 > catchPhraseNoun 1`] = `"framework"`; -exports[`company > seed: 42 > companyName() 1`] = `"Schinner - Wiegand"`; +exports[`company > 42 > companyName > noArgs 1`] = `"Schinner - Wiegand"`; -exports[`company > seed: 42 > companySuffix() 1`] = `"and Sons"`; +exports[`company > 42 > companyName > with index 1`] = `"Schinner - Wiegand"`; -exports[`company > seed: 42 > suffixes() 1`] = ` +exports[`company > 42 > companySuffix 1`] = `"and Sons"`; + +exports[`company > 42 > name > noArgs 1`] = `"Schinner - Wiegand"`; + +exports[`company > 42 > name > with index 1`] = `"Schinner - Wiegand"`; + +exports[`company > 42 > suffixes 1`] = ` [ "Inc", "and Sons", @@ -29,27 +35,33 @@ exports[`company > seed: 42 > suffixes() 1`] = ` ] `; -exports[`company > seed: 1211 > bs() 1`] = `"cultivate bleeding-edge functionalities"`; +exports[`company > 1211 > bs 1`] = `"cultivate bleeding-edge functionalities"`; + +exports[`company > 1211 > bsAdjective 1`] = `"plug-and-play"`; + +exports[`company > 1211 > bsBuzz 1`] = `"cultivate"`; -exports[`company > seed: 1211 > bsAdjective() 1`] = `"plug-and-play"`; +exports[`company > 1211 > bsNoun 1`] = `"experiences"`; -exports[`company > seed: 1211 > bsBuzz() 1`] = `"cultivate"`; +exports[`company > 1211 > catchPhrase 1`] = `"Up-sized high-level success"`; -exports[`company > seed: 1211 > bsNoun() 1`] = `"experiences"`; +exports[`company > 1211 > catchPhraseAdjective 1`] = `"Up-sized"`; -exports[`company > seed: 1211 > catchPhrase() 1`] = `"Up-sized high-level success"`; +exports[`company > 1211 > catchPhraseDescriptor 1`] = `"upward-trending"`; -exports[`company > seed: 1211 > catchPhraseAdjective() 1`] = `"Up-sized"`; +exports[`company > 1211 > catchPhraseNoun 1`] = `"system engine"`; -exports[`company > seed: 1211 > catchPhraseDescriptor() 1`] = `"upward-trending"`; +exports[`company > 1211 > companyName > noArgs 1`] = `"Koch, Trantow and Sanford"`; -exports[`company > seed: 1211 > catchPhraseNoun() 1`] = `"system engine"`; +exports[`company > 1211 > companyName > with index 1`] = `"Koch, Trantow and Sanford"`; -exports[`company > seed: 1211 > companyName() 1`] = `"Koch, Trantow and Sanford"`; +exports[`company > 1211 > companySuffix 1`] = `"Group"`; -exports[`company > seed: 1211 > companySuffix() 1`] = `"Group"`; +exports[`company > 1211 > name > noArgs 1`] = `"Koch, Trantow and Sanford"`; -exports[`company > seed: 1211 > suffixes() 1`] = ` +exports[`company > 1211 > name > with index 1`] = `"Koch, Trantow and Sanford"`; + +exports[`company > 1211 > suffixes 1`] = ` [ "Inc", "and Sons", @@ -58,27 +70,33 @@ exports[`company > seed: 1211 > suffixes() 1`] = ` ] `; -exports[`company > seed: 1337 > bs() 1`] = `"incentivize efficient initiatives"`; +exports[`company > 1337 > bs 1`] = `"incentivize efficient initiatives"`; + +exports[`company > 1337 > bsAdjective 1`] = `"global"`; + +exports[`company > 1337 > bsBuzz 1`] = `"incentivize"`; + +exports[`company > 1337 > bsNoun 1`] = `"ROI"`; -exports[`company > seed: 1337 > bsAdjective() 1`] = `"global"`; +exports[`company > 1337 > catchPhrase 1`] = `"Expanded leading edge capacity"`; -exports[`company > seed: 1337 > bsBuzz() 1`] = `"incentivize"`; +exports[`company > 1337 > catchPhraseAdjective 1`] = `"Expanded"`; -exports[`company > seed: 1337 > bsNoun() 1`] = `"ROI"`; +exports[`company > 1337 > catchPhraseDescriptor 1`] = `"demand-driven"`; -exports[`company > seed: 1337 > catchPhrase() 1`] = `"Expanded leading edge capacity"`; +exports[`company > 1337 > catchPhraseNoun 1`] = `"data-warehouse"`; -exports[`company > seed: 1337 > catchPhraseAdjective() 1`] = `"Expanded"`; +exports[`company > 1337 > companyName > noArgs 1`] = `"Macejkovic Inc"`; -exports[`company > seed: 1337 > catchPhraseDescriptor() 1`] = `"demand-driven"`; +exports[`company > 1337 > companyName > with index 1`] = `"Macejkovic Inc"`; -exports[`company > seed: 1337 > catchPhraseNoun() 1`] = `"data-warehouse"`; +exports[`company > 1337 > companySuffix 1`] = `"and Sons"`; -exports[`company > seed: 1337 > companyName() 1`] = `"Macejkovic Inc"`; +exports[`company > 1337 > name > noArgs 1`] = `"Macejkovic Inc"`; -exports[`company > seed: 1337 > companySuffix() 1`] = `"and Sons"`; +exports[`company > 1337 > name > with index 1`] = `"Macejkovic Inc"`; -exports[`company > seed: 1337 > suffixes() 1`] = ` +exports[`company > 1337 > suffixes 1`] = ` [ "Inc", "and Sons", diff --git a/test/__snapshots__/database.spec.ts.snap b/test/__snapshots__/database.spec.ts.snap index 7542fca1bf7..2390eacc8be 100644 --- a/test/__snapshots__/database.spec.ts.snap +++ b/test/__snapshots__/database.spec.ts.snap @@ -1,31 +1,31 @@ // Vitest Snapshot v1 -exports[`database > seed: 42 > collation() 1`] = `"utf8_bin"`; +exports[`database > 42 > collation 1`] = `"utf8_bin"`; -exports[`database > seed: 42 > column() 1`] = `"token"`; +exports[`database > 42 > column 1`] = `"token"`; -exports[`database > seed: 42 > engine() 1`] = `"MEMORY"`; +exports[`database > 42 > engine 1`] = `"MEMORY"`; -exports[`database > seed: 42 > mongodbObjectId() 1`] = `"8be4abdd39321ad7d3fe01ff"`; +exports[`database > 42 > mongodbObjectId 1`] = `"8be4abdd39321ad7d3fe01ff"`; -exports[`database > seed: 42 > type() 1`] = `"smallint"`; +exports[`database > 42 > type 1`] = `"smallint"`; -exports[`database > seed: 1211 > collation() 1`] = `"cp1250_general_ci"`; +exports[`database > 1211 > collation 1`] = `"cp1250_general_ci"`; -exports[`database > seed: 1211 > column() 1`] = `"createdAt"`; +exports[`database > 1211 > column 1`] = `"createdAt"`; -exports[`database > seed: 1211 > engine() 1`] = `"ARCHIVE"`; +exports[`database > 1211 > engine 1`] = `"ARCHIVE"`; -exports[`database > seed: 1211 > mongodbObjectId() 1`] = `"eadb42f0e3f4a973fab0aeef"`; +exports[`database > 1211 > mongodbObjectId 1`] = `"eadb42f0e3f4a973fab0aeef"`; -exports[`database > seed: 1211 > type() 1`] = `"geometry"`; +exports[`database > 1211 > type 1`] = `"geometry"`; -exports[`database > seed: 1337 > collation() 1`] = `"utf8_general_ci"`; +exports[`database > 1337 > collation 1`] = `"utf8_general_ci"`; -exports[`database > seed: 1337 > column() 1`] = `"email"`; +exports[`database > 1337 > column 1`] = `"email"`; -exports[`database > seed: 1337 > engine() 1`] = `"MyISAM"`; +exports[`database > 1337 > engine 1`] = `"MyISAM"`; -exports[`database > seed: 1337 > mongodbObjectId() 1`] = `"5c346ba075bd57f5a62b82d7"`; +exports[`database > 1337 > mongodbObjectId 1`] = `"5c346ba075bd57f5a62b82d7"`; -exports[`database > seed: 1337 > type() 1`] = `"time"`; +exports[`database > 1337 > type 1`] = `"time"`; diff --git a/test/__snapshots__/datatype.spec.ts.snap b/test/__snapshots__/datatype.spec.ts.snap index c04dcf950c6..e7b8e414320 100644 --- a/test/__snapshots__/datatype.spec.ts.snap +++ b/test/__snapshots__/datatype.spec.ts.snap @@ -1,277 +1,331 @@ // Vitest Snapshot v1 -exports[`datatype > seed: 42 > array > should return a deterministic array of given length 1`] = ` +exports[`datatype > 42 > array > noArgs 1`] = ` [ 79654, "2eiXX/J/*&", 86617, 60111, + 70807, + "\\"&{dnx4!1}", + 61748, + 61165, + "!I# seed: 42 > array() 1`] = ` +exports[`datatype > 42 > array > with length 1`] = ` [ 79654, "2eiXX/J/*&", 86617, 60111, - 70807, - "\\"&{dnx4!1}", - 61748, - 61165, - "!I# seed: 42 > bigInt > should return a deterministic bigInt of given value 1`] = `37n`; +exports[`datatype > 42 > bigInt > noArgs 1`] = `379177551410048n`; + +exports[`datatype > 42 > bigInt > with value 1`] = `37n`; + +exports[`datatype > 42 > boolean 1`] = `false`; + +exports[`datatype > 42 > boolean 2`] = `true`; + +exports[`datatype > 42 > boolean 3`] = `true`; -exports[`datatype > seed: 42 > bigInt() 1`] = `379177551410048n`; +exports[`datatype > 42 > boolean 4`] = `false`; -exports[`datatype > seed: 42 > boolean() 1`] = `false`; +exports[`datatype > 42 > boolean 5`] = `true`; -exports[`datatype > seed: 42 > datetime > should return a deterministic date when given a max date 1`] = `1994-07-11T09:43:47.230Z`; +exports[`datatype > 42 > datetime > noArgs 1`] = `2031-03-14T21:33:22.114Z`; -exports[`datatype > seed: 42 > datetime > should return a deterministic date when given a min and max date 1`] = `1689-09-09T08:39:09.444Z`; +exports[`datatype > 42 > datetime > with given number 1`] = `1994-03-20T17:23:00.629Z`; -exports[`datatype > seed: 42 > datetime > should return a deterministic date when given a min date 1`] = `1801-04-11T15:13:06.330Z`; +exports[`datatype > 42 > datetime > with max 1`] = `1994-07-11T09:43:47.230Z`; -exports[`datatype > seed: 42 > datetime > should return a deterministic date when given a number 1`] = `1994-03-20T17:23:00.629Z`; +exports[`datatype > 42 > datetime > with min 1`] = `1801-04-11T15:13:06.330Z`; -exports[`datatype > seed: 42 > datetime() 1`] = `2031-03-14T21:33:22.114Z`; +exports[`datatype > 42 > datetime > with min and max 1`] = `1689-09-09T08:39:09.444Z`; -exports[`datatype > seed: 42 > float > should return a deterministic value for given max 1`] = `25.84`; +exports[`datatype > 42 > float > noArgs 1`] = `37453.64`; -exports[`datatype > seed: 42 > float > should return a deterministic value for given min 1`] = `37411.64`; +exports[`datatype > 42 > float > repeated 1`] = `37453.64`; -exports[`datatype > seed: 42 > float > should return a deterministic value for given min and max 1`] = `-0.43`; +exports[`datatype > 42 > float > repeated 2`] = `79653.5`; -exports[`datatype > seed: 42 > float > should return a deterministic value for given min, max and precision 1`] = `-0.4261`; +exports[`datatype > 42 > float > repeated 3`] = `95070.48`; -exports[`datatype > seed: 42 > float > should return a deterministic value for given number 1`] = `37452`; +exports[`datatype > 42 > float > repeated 4`] = `18343.29`; -exports[`datatype > seed: 42 > float > should return a deterministic value for given number 2`] = `79656`; +exports[`datatype > 42 > float > repeated 5`] = `73198.66`; -exports[`datatype > seed: 42 > float > should return a deterministic value for given number 3`] = `95076`; +exports[`datatype > 42 > float > repeated 6`] = `77968.32`; -exports[`datatype > seed: 42 > float > should return a deterministic value for given number 4`] = `18342`; +exports[`datatype > 42 > float > with max 1`] = `25.84`; -exports[`datatype > seed: 42 > float > should return a deterministic value for given number 5`] = `73200`; +exports[`datatype > 42 > float > with min 1`] = `37411.64`; -exports[`datatype > seed: 42 > float() 1`] = `37453.64`; +exports[`datatype > 42 > float > with min and max 1`] = `-0.43`; -exports[`datatype > seed: 42 > hexadecimal > should return a deterministic hex of given length 1`] = `"0x8BE4ABdd39321aD7d3fe01FfCE404F4d6db0906bd8"`; +exports[`datatype > 42 > float > with min, max and precision 1`] = `-0.4261`; -exports[`datatype > seed: 42 > hexadecimal() 1`] = `"0x8"`; +exports[`datatype > 42 > hexadecimal > noArgs 1`] = `"0x8"`; -exports[`datatype > seed: 42 > json() 1`] = `"{\\"foo\\":79654,\\"bar\\":\\"2eiXX/J/*&\\",\\"bike\\":86617,\\"a\\":60111,\\"b\\":70807,\\"name\\":\\"\\\\\\"&{dnx4!1}\\",\\"prop\\":61748}"`; +exports[`datatype > 42 > hexadecimal > with length 1`] = `"0x8BE4ABdd39321aD7d3fe01FfCE404F4d6db0906bd8"`; -exports[`datatype > seed: 42 > number > should return a deterministic value for given max 1`] = `26`; +exports[`datatype > 42 > json 1`] = `"{\\"foo\\":79654,\\"bar\\":\\"2eiXX/J/*&\\",\\"bike\\":86617,\\"a\\":60111,\\"b\\":70807,\\"name\\":\\"\\\\\\"&{dnx4!1}\\",\\"prop\\":61748}"`; -exports[`datatype > seed: 42 > number > should return a deterministic value for given min 1`] = `37412`; +exports[`datatype > 42 > number > noArgs 1`] = `37454`; -exports[`datatype > seed: 42 > number > should return a deterministic value for given min and max 1`] = `-1`; +exports[`datatype > 42 > number > repeated 1`] = `2`; -exports[`datatype > seed: 42 > number > should return a deterministic value for given min, max and precision 1`] = `-0.43`; +exports[`datatype > 42 > number > repeated 2`] = `5`; -exports[`datatype > seed: 42 > number > should return a deterministic value for given number 1`] = `2`; +exports[`datatype > 42 > number > repeated 3`] = `6`; -exports[`datatype > seed: 42 > number > should return a deterministic value for given number 2`] = `5`; +exports[`datatype > 42 > number > repeated 4`] = `1`; -exports[`datatype > seed: 42 > number > should return a deterministic value for given number 3`] = `6`; +exports[`datatype > 42 > number > repeated 5`] = `5`; -exports[`datatype > seed: 42 > number > should return a deterministic value for given number 4`] = `1`; +exports[`datatype > 42 > number > with max 1`] = `26`; -exports[`datatype > seed: 42 > number > should return a deterministic value for given number 5`] = `5`; +exports[`datatype > 42 > number > with min 1`] = `37412`; -exports[`datatype > seed: 42 > number() 1`] = `37454`; +exports[`datatype > 42 > number > with min and max 1`] = `-1`; -exports[`datatype > seed: 42 > string > should return a deterministic string of given length 1`] = `"Cky2eiXX/J/*&Kq@X.b]\\"&{dnx4!1}2Z=YQ!I# 42 > number > with min, max and precision 1`] = `-0.43`; -exports[`datatype > seed: 42 > string() 1`] = `"Cky2eiXX/J"`; +exports[`datatype > 42 > string > noArgs 1`] = `"Cky2eiXX/J"`; -exports[`datatype > seed: 42 > uuid() 1`] = `"5cf2bc99-2721-407d-992b-a00fbdf302f2"`; +exports[`datatype > 42 > string > with length 1`] = `"Cky2eiXX/J/*&Kq@X.b]\\"&{dnx4!1}2Z=YQ!I# seed: 1211 > array > should return a deterministic array of given length 1`] = ` +exports[`datatype > 42 > uuid 1`] = `"5cf2bc99-2721-407d-992b-a00fbdf302f2"`; + +exports[`datatype > 42 > uuid 2`] = `"94980604-8962-404f-9371-c9368f970d9a"`; + +exports[`datatype > 42 > uuid 3`] = `"2710fff9-c640-413a-b7a1-97d02e642ac4"`; + +exports[`datatype > 42 > uuid 4`] = `"6838920f-dc7f-46ee-9be5-19380f5d6b48"`; + +exports[`datatype > 42 > uuid 5`] = `"d95f4984-24c2-410f-ac63-400d3bbbcc91"`; + +exports[`datatype > 1211 > array > noArgs 1`] = ` [ "Kti5-}$_/\`", 76408, 35403, 69406, + "l\\"h^]dnwI<", + "|p|5KWu3/C", + "|Jh!E=x\\"RH", + "/5V<1bEQuA", + "p=DW9F=V1(", + "7a6.$boN\\\\7", ] `; -exports[`datatype > seed: 1211 > array() 1`] = ` +exports[`datatype > 1211 > array > with length 1`] = ` [ "Kti5-}$_/\`", 76408, 35403, 69406, - "l\\"h^]dnwI<", - "|p|5KWu3/C", - "|Jh!E=x\\"RH", - "/5V<1bEQuA", - "p=DW9F=V1(", - "7a6.$boN\\\\7", ] `; -exports[`datatype > seed: 1211 > bigInt > should return a deterministic bigInt of given value 1`] = `8n`; +exports[`datatype > 1211 > bigInt > noArgs 1`] = `948721906162743n`; + +exports[`datatype > 1211 > bigInt > with value 1`] = `8n`; + +exports[`datatype > 1211 > boolean 1`] = `true`; + +exports[`datatype > 1211 > boolean 2`] = `false`; + +exports[`datatype > 1211 > boolean 3`] = `true`; + +exports[`datatype > 1211 > boolean 4`] = `true`; + +exports[`datatype > 1211 > boolean 5`] = `false`; + +exports[`datatype > 1211 > datetime > noArgs 1`] = `2092-02-20T03:42:04.341Z`; -exports[`datatype > seed: 1211 > bigInt() 1`] = `948721906162743n`; +exports[`datatype > 1211 > datetime > with given number 1`] = `2000-06-14T02:54:42.082Z`; -exports[`datatype > seed: 1211 > boolean() 1`] = `true`; +exports[`datatype > 1211 > datetime > with max 1`] = `2001-03-20T11:14:25.251Z`; -exports[`datatype > seed: 1211 > datetime > should return a deterministic date when given a max date 1`] = `2001-03-20T11:14:25.251Z`; +exports[`datatype > 1211 > datetime > with min 1`] = `2065-11-10T19:27:20.915Z`; -exports[`datatype > seed: 1211 > datetime > should return a deterministic date when given a min and max date 1`] = `1789-03-26T15:44:45.219Z`; +exports[`datatype > 1211 > datetime > with min and max 1`] = `1789-03-26T15:44:45.219Z`; -exports[`datatype > seed: 1211 > datetime > should return a deterministic date when given a min date 1`] = `2065-11-10T19:27:20.915Z`; +exports[`datatype > 1211 > float > noArgs 1`] = `92851.09`; -exports[`datatype > seed: 1211 > datetime > should return a deterministic date when given a number 1`] = `2000-06-14T02:54:42.082Z`; +exports[`datatype > 1211 > float > repeated 1`] = `92851.09`; -exports[`datatype > seed: 1211 > datetime() 1`] = `2092-02-20T03:42:04.341Z`; +exports[`datatype > 1211 > float > repeated 2`] = `45901.06`; -exports[`datatype > seed: 1211 > float > should return a deterministic value for given max 1`] = `64.07`; +exports[`datatype > 1211 > float > repeated 3`] = `89346.28`; -exports[`datatype > seed: 1211 > float > should return a deterministic value for given min 1`] = `92809.09`; +exports[`datatype > 1211 > float > repeated 4`] = `77826.18`; -exports[`datatype > seed: 1211 > float > should return a deterministic value for given min and max 1`] = `61.07`; +exports[`datatype > 1211 > float > repeated 5`] = `22556.85`; -exports[`datatype > seed: 1211 > float > should return a deterministic value for given min, max and precision 1`] = `61.0658`; +exports[`datatype > 1211 > float > repeated 6`] = `12988.8`; -exports[`datatype > seed: 1211 > float > should return a deterministic value for given number 1`] = `92856`; +exports[`datatype > 1211 > float > with max 1`] = `64.07`; -exports[`datatype > seed: 1211 > float > should return a deterministic value for given number 2`] = `45900`; +exports[`datatype > 1211 > float > with min 1`] = `92809.09`; -exports[`datatype > seed: 1211 > float > should return a deterministic value for given number 3`] = `89346`; +exports[`datatype > 1211 > float > with min and max 1`] = `61.07`; -exports[`datatype > seed: 1211 > float > should return a deterministic value for given number 4`] = `77826`; +exports[`datatype > 1211 > float > with min, max and precision 1`] = `61.0658`; -exports[`datatype > seed: 1211 > float > should return a deterministic value for given number 5`] = `22554`; +exports[`datatype > 1211 > hexadecimal > noArgs 1`] = `"0xE"`; -exports[`datatype > seed: 1211 > float() 1`] = `92851.09`; +exports[`datatype > 1211 > hexadecimal > with length 1`] = `"0xEaDB42F0e3f4A973fAB0AeefCE96DFCF49cD438dF9"`; -exports[`datatype > seed: 1211 > hexadecimal > should return a deterministic hex of given length 1`] = `"0xEaDB42F0e3f4A973fAB0AeefCE96DFCF49cD438dF9"`; +exports[`datatype > 1211 > json 1`] = `"{\\"foo\\":\\"Kti5-}$_/\`\\",\\"bar\\":76408,\\"bike\\":35403,\\"a\\":69406,\\"b\\":\\"l\\\\\\"h^]dnwI<\\",\\"name\\":\\"|p|5KWu3/C\\",\\"prop\\":\\"|Jh!E=x\\\\\\"RH\\"}"`; -exports[`datatype > seed: 1211 > hexadecimal() 1`] = `"0xE"`; +exports[`datatype > 1211 > number > noArgs 1`] = `92852`; -exports[`datatype > seed: 1211 > json() 1`] = `"{\\"foo\\":\\"Kti5-}$_/\`\\",\\"bar\\":76408,\\"bike\\":35403,\\"a\\":69406,\\"b\\":\\"l\\\\\\"h^]dnwI<\\",\\"name\\":\\"|p|5KWu3/C\\",\\"prop\\":\\"|Jh!E=x\\\\\\"RH\\"}"`; +exports[`datatype > 1211 > number > repeated 1`] = `6`; -exports[`datatype > seed: 1211 > number > should return a deterministic value for given max 1`] = `64`; +exports[`datatype > 1211 > number > repeated 2`] = `3`; -exports[`datatype > seed: 1211 > number > should return a deterministic value for given min 1`] = `92810`; +exports[`datatype > 1211 > number > repeated 3`] = `6`; -exports[`datatype > seed: 1211 > number > should return a deterministic value for given min and max 1`] = `61`; +exports[`datatype > 1211 > number > repeated 4`] = `5`; -exports[`datatype > seed: 1211 > number > should return a deterministic value for given min, max and precision 1`] = `61.07`; +exports[`datatype > 1211 > number > repeated 5`] = `1`; -exports[`datatype > seed: 1211 > number > should return a deterministic value for given number 1`] = `6`; +exports[`datatype > 1211 > number > with max 1`] = `64`; -exports[`datatype > seed: 1211 > number > should return a deterministic value for given number 2`] = `3`; +exports[`datatype > 1211 > number > with min 1`] = `92810`; -exports[`datatype > seed: 1211 > number > should return a deterministic value for given number 3`] = `6`; +exports[`datatype > 1211 > number > with min and max 1`] = `61`; -exports[`datatype > seed: 1211 > number > should return a deterministic value for given number 4`] = `5`; +exports[`datatype > 1211 > number > with min, max and precision 1`] = `61.07`; -exports[`datatype > seed: 1211 > number > should return a deterministic value for given number 5`] = `1`; +exports[`datatype > 1211 > string > noArgs 1`] = `"wKti5-}$_/"`; -exports[`datatype > seed: 1211 > number() 1`] = `92852`; +exports[`datatype > 1211 > string > with length 1`] = `"wKti5-}$_/\`4hHA0afl\\"h^]dnwI seed: 1211 > string > should return a deterministic string of given length 1`] = `"wKti5-}$_/\`4hHA0afl\\"h^]dnwI 1211 > uuid 1`] = `"e7ec32f0-a2a3-4c65-abbd-0caabde64dfd"`; -exports[`datatype > seed: 1211 > string() 1`] = `"wKti5-}$_/"`; +exports[`datatype > 1211 > uuid 2`] = `"f379e325-9f7c-4064-a086-f23942b68e5f"`; -exports[`datatype > seed: 1211 > uuid() 1`] = `"e7ec32f0-a2a3-4c65-abbd-0caabde64dfd"`; +exports[`datatype > 1211 > uuid 3`] = `"d4694649-2183-4b32-8bd7-a336639d6997"`; -exports[`datatype > seed: 1337 > array > should return a deterministic array of given length 1`] = ` +exports[`datatype > 1211 > uuid 4`] = `"10ab829b-742c-4a8b-b732-98d718d77069"`; + +exports[`datatype > 1211 > uuid 5`] = `"7b91ce88-effb-4d1d-93bb-ad759e00b86c"`; + +exports[`datatype > 1337 > array > noArgs 1`] = ` [ 56052, 21258, 54308, 3397, + 23538, + "X9@{:e=+kD", + 62850, + 12505, + "|/Jqjjj!BL", + 38106, ] `; -exports[`datatype > seed: 1337 > array() 1`] = ` +exports[`datatype > 1337 > array > with length 1`] = ` [ 56052, 21258, 54308, 3397, - 23538, - "X9@{:e=+kD", - 62850, - 12505, - "|/Jqjjj!BL", - 38106, ] `; -exports[`datatype > seed: 1337 > bigInt > should return a deterministic bigInt of given value 1`] = `25n`; +exports[`datatype > 1337 > bigInt > noArgs 1`] = `251225403255239n`; + +exports[`datatype > 1337 > bigInt > with value 1`] = `25n`; + +exports[`datatype > 1337 > boolean 1`] = `false`; + +exports[`datatype > 1337 > boolean 2`] = `true`; + +exports[`datatype > 1337 > boolean 3`] = `false`; + +exports[`datatype > 1337 > boolean 4`] = `false`; + +exports[`datatype > 1337 > boolean 5`] = `false`; + +exports[`datatype > 1337 > datetime > noArgs 1`] = `2018-10-28T08:46:11.896Z`; + +exports[`datatype > 1337 > datetime > with given number 1`] = `1992-12-13T04:13:59.232Z`; + +exports[`datatype > 1337 > datetime > with max 1`] = `1993-03-02T00:10:04.335Z`; -exports[`datatype > seed: 1337 > bigInt() 1`] = `251225403255239n`; +exports[`datatype > 1337 > datetime > with min 1`] = `1747-07-16T01:19:54.159Z`; -exports[`datatype > seed: 1337 > boolean() 1`] = `false`; +exports[`datatype > 1337 > datetime > with min and max 1`] = `1669-06-22T01:21:21.236Z`; -exports[`datatype > seed: 1337 > datetime > should return a deterministic date when given a max date 1`] = `1993-03-02T00:10:04.335Z`; +exports[`datatype > 1337 > float > noArgs 1`] = `26202.2`; -exports[`datatype > seed: 1337 > datetime > should return a deterministic date when given a min and max date 1`] = `1669-06-22T01:21:21.236Z`; +exports[`datatype > 1337 > float > repeated 1`] = `26202.2`; -exports[`datatype > seed: 1337 > datetime > should return a deterministic date when given a min date 1`] = `1747-07-16T01:19:54.159Z`; +exports[`datatype > 1337 > float > repeated 2`] = `56052.42`; -exports[`datatype > seed: 1337 > datetime > should return a deterministic date when given a number 1`] = `1992-12-13T04:13:59.232Z`; +exports[`datatype > 1337 > float > repeated 3`] = `15868.24`; -exports[`datatype > seed: 1337 > datetime() 1`] = `2018-10-28T08:46:11.896Z`; +exports[`datatype > 1337 > float > repeated 4`] = `21258.55`; -exports[`datatype > seed: 1337 > float > should return a deterministic value for given max 1`] = `18.08`; +exports[`datatype > 1337 > float > repeated 5`] = `27812.37`; -exports[`datatype > seed: 1337 > float > should return a deterministic value for given min 1`] = `26160.2`; +exports[`datatype > 1337 > float > repeated 6`] = `54307.53`; -exports[`datatype > seed: 1337 > float > should return a deterministic value for given min and max 1`] = `-12.92`; +exports[`datatype > 1337 > float > with max 1`] = `18.08`; -exports[`datatype > seed: 1337 > float > should return a deterministic value for given min, max and precision 1`] = `-12.9153`; +exports[`datatype > 1337 > float > with min 1`] = `26160.2`; -exports[`datatype > seed: 1337 > float > should return a deterministic value for given number 1`] = `26202`; +exports[`datatype > 1337 > float > with min and max 1`] = `-12.92`; -exports[`datatype > seed: 1337 > float > should return a deterministic value for given number 2`] = `56052`; +exports[`datatype > 1337 > float > with min, max and precision 1`] = `-12.9153`; -exports[`datatype > seed: 1337 > float > should return a deterministic value for given number 3`] = `15864`; +exports[`datatype > 1337 > hexadecimal > noArgs 1`] = `"0x5"`; -exports[`datatype > seed: 1337 > float > should return a deterministic value for given number 4`] = `21258`; +exports[`datatype > 1337 > hexadecimal > with length 1`] = `"0x5c346ba075bd57F5A62B82d72AF39CBBB07a98cbA8"`; -exports[`datatype > seed: 1337 > float > should return a deterministic value for given number 5`] = `27810`; +exports[`datatype > 1337 > json 1`] = `"{\\"foo\\":56052,\\"bar\\":21258,\\"bike\\":54308,\\"a\\":3397,\\"b\\":23538,\\"name\\":\\"X9@{:e=+kD\\",\\"prop\\":62850}"`; -exports[`datatype > seed: 1337 > float() 1`] = `26202.2`; +exports[`datatype > 1337 > number > noArgs 1`] = `26202`; -exports[`datatype > seed: 1337 > hexadecimal > should return a deterministic hex of given length 1`] = `"0x5c346ba075bd57F5A62B82d72AF39CBBB07a98cbA8"`; +exports[`datatype > 1337 > number > repeated 1`] = `1`; -exports[`datatype > seed: 1337 > hexadecimal() 1`] = `"0x5"`; +exports[`datatype > 1337 > number > repeated 2`] = `3`; -exports[`datatype > seed: 1337 > json() 1`] = `"{\\"foo\\":56052,\\"bar\\":21258,\\"bike\\":54308,\\"a\\":3397,\\"b\\":23538,\\"name\\":\\"X9@{:e=+kD\\",\\"prop\\":62850}"`; +exports[`datatype > 1337 > number > repeated 3`] = `1`; -exports[`datatype > seed: 1337 > number > should return a deterministic value for given max 1`] = `18`; +exports[`datatype > 1337 > number > repeated 4`] = `1`; -exports[`datatype > seed: 1337 > number > should return a deterministic value for given min 1`] = `26160`; +exports[`datatype > 1337 > number > repeated 5`] = `1`; -exports[`datatype > seed: 1337 > number > should return a deterministic value for given min and max 1`] = `-13`; +exports[`datatype > 1337 > number > with max 1`] = `18`; -exports[`datatype > seed: 1337 > number > should return a deterministic value for given min, max and precision 1`] = `-12.92`; +exports[`datatype > 1337 > number > with min 1`] = `26160`; -exports[`datatype > seed: 1337 > number > should return a deterministic value for given number 1`] = `1`; +exports[`datatype > 1337 > number > with min and max 1`] = `-13`; -exports[`datatype > seed: 1337 > number > should return a deterministic value for given number 2`] = `3`; +exports[`datatype > 1337 > number > with min, max and precision 1`] = `-12.92`; -exports[`datatype > seed: 1337 > number > should return a deterministic value for given number 3`] = `1`; +exports[`datatype > 1337 > string > noArgs 1`] = `"9U/4:SK$>6"`; -exports[`datatype > seed: 1337 > number > should return a deterministic value for given number 4`] = `1`; +exports[`datatype > 1337 > string > with length 1`] = `"9U/4:SK$>6QX9@{:e=+kD)[B,e|/Jqjjj!BLGDWQgC"`; -exports[`datatype > seed: 1337 > number > should return a deterministic value for given number 5`] = `1`; +exports[`datatype > 1337 > uuid 1`] = `"48234870-5389-445f-8b41-c61a52bf27dc"`; -exports[`datatype > seed: 1337 > number() 1`] = `26202`; +exports[`datatype > 1337 > uuid 2`] = `"cc057669-8c53-474d-a677-226d3e8ed92f"`; -exports[`datatype > seed: 1337 > string > should return a deterministic string of given length 1`] = `"9U/4:SK$>6QX9@{:e=+kD)[B,e|/Jqjjj!BLGDWQgC"`; +exports[`datatype > 1337 > uuid 3`] = `"fe6d8b8b-0db9-4fa2-b265-abc0a5d0ccf5"`; -exports[`datatype > seed: 1337 > string() 1`] = `"9U/4:SK$>6"`; +exports[`datatype > 1337 > uuid 4`] = `"0b87afbd-8949-4dfb-8d04-19f4fe7458b2"`; -exports[`datatype > seed: 1337 > uuid() 1`] = `"48234870-5389-445f-8b41-c61a52bf27dc"`; +exports[`datatype > 1337 > uuid 5`] = `"0bcea83c-a7ea-428e-85db-d448f2b777a6"`; diff --git a/test/__snapshots__/date.spec.ts.snap b/test/__snapshots__/date.spec.ts.snap index 426df869354..42bc81c90e8 100644 --- a/test/__snapshots__/date.spec.ts.snap +++ b/test/__snapshots__/date.spec.ts.snap @@ -1,10 +1,10 @@ // Vitest Snapshot v1 -exports[`date > seed: 42 > between() > should return deterministic value between given real dates 1`] = `2021-03-15T19:30:57.091Z`; +exports[`date > 42 > between > with Date dates 1`] = `2021-03-15T19:30:57.091Z`; -exports[`date > seed: 42 > between() > should return deterministic value between given string dates 1`] = `2021-03-15T19:30:57.091Z`; +exports[`date > 42 > between > with string dates 1`] = `2021-03-15T19:30:57.091Z`; -exports[`date > seed: 42 > betweens() > should return deterministic value betweens given dates 1`] = ` +exports[`date > 42 > betweens > with Date dates 1`] = ` [ 2021-03-15T19:30:57.091Z, 2021-04-09T17:05:10.406Z, @@ -12,73 +12,111 @@ exports[`date > seed: 42 > betweens() > should return deterministic value betwee ] `; -exports[`date > seed: 42 > betweens() > should return deterministic value betweens given string dates 1`] = ` +exports[`date > 42 > betweens > with Date dates and count 1`] = ` [ + 2021-03-04T12:54:15.263Z, 2021-03-15T19:30:57.091Z, + 2021-04-05T21:40:57.315Z, 2021-04-09T17:05:10.406Z, 2021-04-18T19:23:52.973Z, ] `; -exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by age 1`] = `1959-06-26T13:52:19.442Z`; +exports[`date > 42 > betweens > with string dates 1`] = ` +[ + 2021-03-15T19:30:57.091Z, + 2021-04-09T17:05:10.406Z, + 2021-04-18T19:23:52.973Z, +] +`; -exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by age mode 1`] = `1942-09-15T09:55:20.478Z`; +exports[`date > 42 > betweens > with string dates and count 1`] = ` +[ + 2021-03-04T12:54:15.263Z, + 2021-03-15T19:30:57.091Z, + 2021-04-05T21:40:57.315Z, + 2021-04-09T17:05:10.406Z, + 2021-04-18T19:23:52.973Z, +] +`; + +exports[`date > 42 > birthdate > with age and refDate 1`] = `1980-07-07T19:06:53.022Z`; + +exports[`date > 42 > birthdate > with age mode and refDate 1`] = `1963-09-27T06:10:33.792Z`; + +exports[`date > 42 > birthdate > with age range and refDate 1`] = `1962-12-27T20:13:59.702Z`; + +exports[`date > 42 > birthdate > with only refDate 1`] = `1964-08-06T01:03:57.017Z`; -exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by age range 1`] = `1941-12-15T14:59:26.122Z`; +exports[`date > 42 > birthdate > with year and refDate 1`] = `0020-07-07T19:06:53.022Z`; -exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by default 1`] = `1943-08-06T10:03:17.283Z`; +exports[`date > 42 > birthdate > with year mode and refDate 1`] = `1964-08-06T01:03:57.017Z`; -exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by year 1`] = `2000-05-16T22:59:36.513Z`; +exports[`date > 42 > birthdate > with year range and refDate 1`] = `0057-12-20T11:59:23.890Z`; -exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by year mode 1`] = `1943-08-06T10:03:17.283Z`; +exports[`date > 42 > future > with only Date refDate 1`] = `2021-07-08T10:07:33.381Z`; -exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by year range 1`] = `1937-10-30T15:52:07.381Z`; +exports[`date > 42 > future > with only string refDate 1`] = `2021-07-08T10:07:33.381Z`; -exports[`date > seed: 42 > future() > should return deterministic future value on given refDate of type date 1`] = `2021-07-08T10:07:33.381Z`; +exports[`date > 42 > future > with value 1`] = `2024-11-19T18:52:06.785Z`; -exports[`date > seed: 42 > future() > should return deterministic future value on given refDate of type string 1`] = `2021-07-08T10:07:33.381Z`; +exports[`date > 42 > month > noArgs 1`] = `"May"`; -exports[`date > seed: 42 > future() > should return deterministic future value on given years 10 and refDate of type date 1`] = `2024-11-19T18:52:06.785Z`; +exports[`date > 42 > month > with abbr = true 1`] = `"May"`; -exports[`date > seed: 42 > future() > should return deterministic future value on given years 10 and refDate of type string 1`] = `2024-11-19T18:52:06.785Z`; +exports[`date > 42 > month > with abbr = true and context = true 1`] = `"May"`; -exports[`date > seed: 42 > month() > should return deterministic value month by default 1`] = `"May"`; +exports[`date > 42 > month > with context = true 1`] = `"May"`; -exports[`date > seed: 42 > month() > should return deterministic value month with abbr and context true 1`] = `"May"`; +exports[`date > 42 > past > with only Date refDate 1`] = `2020-10-08T00:10:58.041Z`; -exports[`date > seed: 42 > month() > should return deterministic value month with abbr true 1`] = `"May"`; +exports[`date > 42 > past > with only string refDate 1`] = `2020-10-08T00:10:58.041Z`; -exports[`date > seed: 42 > month() > should return deterministic value month with context true 1`] = `"May"`; +exports[`date > 42 > past > with value 1`] = `2017-05-26T15:26:24.637Z`; -exports[`date > seed: 42 > past() > should return deterministic past value on given refDate of type date 1`] = `2020-10-08T00:10:58.041Z`; +exports[`date > 42 > recent > with only Date refDate 1`] = `2021-02-21T08:09:54.820Z`; -exports[`date > seed: 42 > past() > should return deterministic past value on given refDate of type string 1`] = `2020-10-08T00:10:58.041Z`; +exports[`date > 42 > recent > with only string refDate 1`] = `2021-02-21T08:09:54.820Z`; -exports[`date > seed: 42 > past() > should return deterministic past value on given years 10 and refDate of type date 1`] = `2017-05-26T15:26:24.637Z`; +exports[`date > 42 > recent > with value 1`] = `2021-02-17T23:15:52.427Z`; -exports[`date > seed: 42 > past() > should return deterministic past value on given years 10 and refDate of type string 1`] = `2017-05-26T15:26:24.637Z`; +exports[`date > 42 > soon > with only Date refDate 1`] = `2021-02-22T02:08:36.602Z`; -exports[`date > seed: 42 > recent() > should return deterministic value recent to given refDate of type date 1`] = `2021-02-21T08:11:56.820Z`; +exports[`date > 42 > soon > with only string refDate 1`] = `2021-02-22T02:08:36.602Z`; -exports[`date > seed: 42 > recent() > should return deterministic value recent to given refDate of type string 1`] = `2021-02-21T08:11:56.820Z`; +exports[`date > 42 > soon > with value 1`] = `2021-02-25T11:02:38.995Z`; -exports[`date > seed: 42 > soon() > should return deterministic value soon to given refDate of type date 1`] = `2021-03-13T23:15:38.042Z`; +exports[`date > 42 > weekday > noArgs 1`] = `"Tuesday"`; -exports[`date > seed: 42 > soon() > should return deterministic value soon to given refDate of type string 1`] = `2021-03-13T23:15:38.042Z`; +exports[`date > 42 > weekday > with abbr = true 1`] = `"Tue"`; -exports[`date > seed: 42 > weekday() > should return deterministic value weekday by default 1`] = `"Tuesday"`; +exports[`date > 42 > weekday > with abbr = true and context = true 1`] = `"Tue"`; -exports[`date > seed: 42 > weekday() > should return deterministic value weekday with abbr and context true 1`] = `"Tue"`; +exports[`date > 42 > weekday > with context = true 1`] = `"Tuesday"`; -exports[`date > seed: 42 > weekday() > should return deterministic value weekday with abbr true 1`] = `"Tue"`; +exports[`date > 1211 > between > with Date dates 1`] = `2021-04-17T11:58:13.327Z`; -exports[`date > seed: 42 > weekday() > should return deterministic value weekday with context true 1`] = `"Tuesday"`; +exports[`date > 1211 > between > with string dates 1`] = `2021-04-17T11:58:13.327Z`; -exports[`date > seed: 1211 > between() > should return deterministic value between given real dates 1`] = `2021-04-17T11:58:13.327Z`; +exports[`date > 1211 > betweens > with Date dates 1`] = ` +[ + 2021-03-20T19:08:07.621Z, + 2021-04-15T10:20:25.794Z, + 2021-04-17T11:58:13.327Z, +] +`; -exports[`date > seed: 1211 > between() > should return deterministic value between given string dates 1`] = `2021-04-17T11:58:13.327Z`; +exports[`date > 1211 > betweens > with Date dates and count 1`] = ` +[ + 2021-03-07T00:34:12.770Z, + 2021-03-20T19:08:07.621Z, + 2021-04-08T15:12:37.581Z, + 2021-04-15T10:20:25.794Z, + 2021-04-17T11:58:13.327Z, +] +`; -exports[`date > seed: 1211 > betweens() > should return deterministic value betweens given dates 1`] = ` +exports[`date > 1211 > betweens > with string dates 1`] = ` [ 2021-03-20T19:08:07.621Z, 2021-04-15T10:20:25.794Z, @@ -86,73 +124,93 @@ exports[`date > seed: 1211 > betweens() > should return deterministic value betw ] `; -exports[`date > seed: 1211 > betweens() > should return deterministic value betweens given string dates 1`] = ` +exports[`date > 1211 > betweens > with string dates and count 1`] = ` [ + 2021-03-07T00:34:12.770Z, 2021-03-20T19:08:07.621Z, + 2021-04-08T15:12:37.581Z, 2021-04-15T10:20:25.794Z, 2021-04-17T11:58:13.327Z, ] `; -exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by age 1`] = `1960-01-14T18:44:13.966Z`; +exports[`date > 1211 > birthdate > with age and refDate 1`] = `1981-01-26T13:16:31.421Z`; + +exports[`date > 1211 > birthdate > with age mode and refDate 1`] = `1998-08-21T21:24:30.782Z`; -exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by age mode 1`] = `1977-08-10T01:09:17.468Z`; +exports[`date > 1211 > birthdate > with age range and refDate 1`] = `1996-10-13T01:44:07.645Z`; -exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by age range 1`] = `1975-10-01T07:11:50.190Z`; +exports[`date > 1211 > birthdate > with only refDate 1`] = `1999-06-29T11:06:58.506Z`; -exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by default 1`] = `1978-06-29T09:24:02.647Z`; +exports[`date > 1211 > birthdate > with year and refDate 1`] = `0021-01-26T13:16:31.421Z`; -exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by year 1`] = `2000-12-04T01:16:03.286Z`; +exports[`date > 1211 > birthdate > with year mode and refDate 1`] = `1999-06-29T11:06:58.506Z`; -exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by year mode 1`] = `1978-06-29T09:24:02.647Z`; +exports[`date > 1211 > birthdate > with year range and refDate 1`] = `0113-12-03T19:45:27.654Z`; -exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by year range 1`] = `1993-10-11T07:44:59.519Z`; +exports[`date > 1211 > future > with only Date refDate 1`] = `2022-01-26T14:59:27.351Z`; -exports[`date > seed: 1211 > future() > should return deterministic future value on given refDate of type date 1`] = `2022-01-26T14:59:27.351Z`; +exports[`date > 1211 > future > with only string refDate 1`] = `2022-01-26T14:59:27.351Z`; -exports[`date > seed: 1211 > future() > should return deterministic future value on given refDate of type string 1`] = `2022-01-26T14:59:27.351Z`; +exports[`date > 1211 > future > with value 1`] = `2030-06-03T19:31:11.467Z`; -exports[`date > seed: 1211 > future() > should return deterministic future value on given years 10 and refDate of type date 1`] = `2030-06-03T19:31:11.467Z`; +exports[`date > 1211 > month > noArgs 1`] = `"December"`; -exports[`date > seed: 1211 > future() > should return deterministic future value on given years 10 and refDate of type string 1`] = `2030-06-03T19:31:11.467Z`; +exports[`date > 1211 > month > with abbr = true 1`] = `"Dec"`; -exports[`date > seed: 1211 > month() > should return deterministic value month by default 1`] = `"December"`; +exports[`date > 1211 > month > with abbr = true and context = true 1`] = `"Dec"`; -exports[`date > seed: 1211 > month() > should return deterministic value month with abbr and context true 1`] = `"Dec"`; +exports[`date > 1211 > month > with context = true 1`] = `"December"`; -exports[`date > seed: 1211 > month() > should return deterministic value month with abbr true 1`] = `"Dec"`; +exports[`date > 1211 > past > with only Date refDate 1`] = `2020-03-19T19:19:04.071Z`; -exports[`date > seed: 1211 > month() > should return deterministic value month with context true 1`] = `"December"`; +exports[`date > 1211 > past > with only string refDate 1`] = `2020-03-19T19:19:04.071Z`; -exports[`date > seed: 1211 > past() > should return deterministic past value on given refDate of type date 1`] = `2020-03-19T19:19:04.071Z`; +exports[`date > 1211 > past > with value 1`] = `2011-11-12T14:47:19.955Z`; -exports[`date > seed: 1211 > past() > should return deterministic past value on given refDate of type string 1`] = `2020-03-19T19:19:04.071Z`; +exports[`date > 1211 > recent > with only Date refDate 1`] = `2021-02-20T18:52:11.498Z`; -exports[`date > seed: 1211 > past() > should return deterministic past value on given years 10 and refDate of type date 1`] = `2011-11-12T14:47:19.955Z`; +exports[`date > 1211 > recent > with only string refDate 1`] = `2021-02-20T18:52:11.498Z`; -exports[`date > seed: 1211 > past() > should return deterministic past value on given years 10 and refDate of type string 1`] = `2011-11-12T14:47:19.955Z`; +exports[`date > 1211 > recent > with value 1`] = `2021-02-12T10:18:34.226Z`; -exports[`date > seed: 1211 > recent() > should return deterministic value recent to given refDate of type date 1`] = `2021-02-20T18:54:13.498Z`; +exports[`date > 1211 > soon > with only Date refDate 1`] = `2021-02-22T15:26:19.924Z`; -exports[`date > seed: 1211 > recent() > should return deterministic value recent to given refDate of type string 1`] = `2021-02-20T18:54:13.498Z`; +exports[`date > 1211 > soon > with only string refDate 1`] = `2021-02-22T15:26:19.924Z`; -exports[`date > seed: 1211 > soon() > should return deterministic value soon to given refDate of type date 1`] = `2021-03-14T12:33:21.364Z`; +exports[`date > 1211 > soon > with value 1`] = `2021-03-02T23:59:57.196Z`; -exports[`date > seed: 1211 > soon() > should return deterministic value soon to given refDate of type string 1`] = `2021-03-14T12:33:21.364Z`; +exports[`date > 1211 > weekday > noArgs 1`] = `"Saturday"`; -exports[`date > seed: 1211 > weekday() > should return deterministic value weekday by default 1`] = `"Saturday"`; +exports[`date > 1211 > weekday > with abbr = true 1`] = `"Sat"`; -exports[`date > seed: 1211 > weekday() > should return deterministic value weekday with abbr and context true 1`] = `"Sat"`; +exports[`date > 1211 > weekday > with abbr = true and context = true 1`] = `"Sat"`; -exports[`date > seed: 1211 > weekday() > should return deterministic value weekday with abbr true 1`] = `"Sat"`; +exports[`date > 1211 > weekday > with context = true 1`] = `"Saturday"`; -exports[`date > seed: 1211 > weekday() > should return deterministic value weekday with context true 1`] = `"Saturday"`; +exports[`date > 1337 > between > with Date dates 1`] = `2021-03-09T04:11:24.667Z`; -exports[`date > seed: 1337 > between() > should return deterministic value between given real dates 1`] = `2021-03-09T04:11:24.667Z`; +exports[`date > 1337 > between > with string dates 1`] = `2021-03-09T04:11:24.667Z`; -exports[`date > seed: 1337 > between() > should return deterministic value between given string dates 1`] = `2021-03-09T04:11:24.667Z`; +exports[`date > 1337 > betweens > with Date dates 1`] = ` +[ + 2021-03-03T01:51:22.512Z, + 2021-03-09T04:11:24.667Z, + 2021-03-26T18:53:00.564Z, +] +`; + +exports[`date > 1337 > betweens > with Date dates and count 1`] = ` +[ + 2021-03-03T01:51:22.512Z, + 2021-03-06T06:11:08.446Z, + 2021-03-09T04:11:24.667Z, + 2021-03-10T02:59:27.376Z, + 2021-03-26T18:53:00.564Z, +] +`; -exports[`date > seed: 1337 > betweens() > should return deterministic value betweens given dates 1`] = ` +exports[`date > 1337 > betweens > with string dates 1`] = ` [ 2021-03-03T01:51:22.512Z, 2021-03-09T04:11:24.667Z, @@ -160,64 +218,66 @@ exports[`date > seed: 1337 > betweens() > should return deterministic value betw ] `; -exports[`date > seed: 1337 > betweens() > should return deterministic value betweens given string dates 1`] = ` +exports[`date > 1337 > betweens > with string dates and count 1`] = ` [ 2021-03-03T01:51:22.512Z, + 2021-03-06T06:11:08.446Z, 2021-03-09T04:11:24.667Z, + 2021-03-10T02:59:27.376Z, 2021-03-26T18:53:00.564Z, ] `; -exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by age 1`] = `1959-05-16T12:14:12.585Z`; +exports[`date > 1337 > birthdate > with age and refDate 1`] = `1980-05-27T14:46:44.831Z`; -exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by age mode 1`] = `1935-08-14T07:41:47.183Z`; +exports[`date > 1337 > birthdate > with age mode and refDate 1`] = `1956-08-25T03:57:00.497Z`; -exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by age range 1`] = `1935-02-03T18:44:07.874Z`; +exports[`date > 1337 > birthdate > with age range and refDate 1`] = `1956-02-15T21:16:40.120Z`; -exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by default 1`] = `1936-07-04T15:55:47.989Z`; +exports[`date > 1337 > birthdate > with only refDate 1`] = `1957-07-05T09:38:29.057Z`; -exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by year 1`] = `2000-04-06T02:45:32.324Z`; +exports[`date > 1337 > birthdate > with year and refDate 1`] = `0020-05-27T14:46:44.831Z`; -exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by year mode 1`] = `1936-07-04T15:55:47.989Z`; +exports[`date > 1337 > birthdate > with year mode and refDate 1`] = `1957-07-05T09:38:29.057Z`; -exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by year range 1`] = `1926-06-20T07:18:05.539Z`; +exports[`date > 1337 > birthdate > with year range and refDate 1`] = `0046-08-09T19:19:18.047Z`; -exports[`date > seed: 1337 > future() > should return deterministic future value on given refDate of type date 1`] = `2021-05-28T08:29:26.637Z`; +exports[`date > 1337 > future > with only Date refDate 1`] = `2021-05-28T08:29:26.637Z`; -exports[`date > seed: 1337 > future() > should return deterministic future value on given refDate of type string 1`] = `2021-05-28T08:29:26.637Z`; +exports[`date > 1337 > future > with only string refDate 1`] = `2021-05-28T08:29:26.637Z`; -exports[`date > seed: 1337 > future() > should return deterministic future value on given years 10 and refDate of type date 1`] = `2023-10-06T02:30:58.333Z`; +exports[`date > 1337 > future > with value 1`] = `2023-10-06T02:30:58.333Z`; -exports[`date > seed: 1337 > future() > should return deterministic future value on given years 10 and refDate of type string 1`] = `2023-10-06T02:30:58.333Z`; +exports[`date > 1337 > month > noArgs 1`] = `"April"`; -exports[`date > seed: 1337 > month() > should return deterministic value month by default 1`] = `"April"`; +exports[`date > 1337 > month > with abbr = true 1`] = `"Apr"`; -exports[`date > seed: 1337 > month() > should return deterministic value month with abbr and context true 1`] = `"Apr"`; +exports[`date > 1337 > month > with abbr = true and context = true 1`] = `"Apr"`; -exports[`date > seed: 1337 > month() > should return deterministic value month with abbr true 1`] = `"Apr"`; +exports[`date > 1337 > month > with context = true 1`] = `"April"`; -exports[`date > seed: 1337 > month() > should return deterministic value month with context true 1`] = `"April"`; +exports[`date > 1337 > past > with only Date refDate 1`] = `2020-11-18T01:49:04.785Z`; -exports[`date > seed: 1337 > past() > should return deterministic past value on given refDate of type date 1`] = `2020-11-18T01:49:04.785Z`; +exports[`date > 1337 > past > with only string refDate 1`] = `2020-11-18T01:49:04.785Z`; -exports[`date > seed: 1337 > past() > should return deterministic past value on given refDate of type string 1`] = `2020-11-18T01:49:04.785Z`; +exports[`date > 1337 > past > with value 1`] = `2018-07-11T07:47:33.089Z`; -exports[`date > seed: 1337 > past() > should return deterministic past value on given years 10 and refDate of type date 1`] = `2018-07-11T07:47:33.089Z`; +exports[`date > 1337 > recent > with only Date refDate 1`] = `2021-02-21T10:51:56.041Z`; -exports[`date > seed: 1337 > past() > should return deterministic past value on given years 10 and refDate of type string 1`] = `2018-07-11T07:47:33.089Z`; +exports[`date > 1337 > recent > with only string refDate 1`] = `2021-02-21T10:51:56.041Z`; -exports[`date > seed: 1337 > recent() > should return deterministic value recent to given refDate of type date 1`] = `2021-02-21T10:53:58.041Z`; +exports[`date > 1337 > recent > with value 1`] = `2021-02-19T02:16:05.653Z`; -exports[`date > seed: 1337 > recent() > should return deterministic value recent to given refDate of type string 1`] = `2021-02-21T10:53:58.041Z`; +exports[`date > 1337 > soon > with only Date refDate 1`] = `2021-02-21T23:26:35.381Z`; -exports[`date > seed: 1337 > soon() > should return deterministic value soon to given refDate of type date 1`] = `2021-03-13T20:33:36.821Z`; +exports[`date > 1337 > soon > with only string refDate 1`] = `2021-02-21T23:26:35.381Z`; -exports[`date > seed: 1337 > soon() > should return deterministic value soon to given refDate of type string 1`] = `2021-03-13T20:33:36.821Z`; +exports[`date > 1337 > soon > with value 1`] = `2021-02-24T08:02:25.769Z`; -exports[`date > seed: 1337 > weekday() > should return deterministic value weekday by default 1`] = `"Monday"`; +exports[`date > 1337 > weekday > noArgs 1`] = `"Monday"`; -exports[`date > seed: 1337 > weekday() > should return deterministic value weekday with abbr and context true 1`] = `"Mon"`; +exports[`date > 1337 > weekday > with abbr = true 1`] = `"Mon"`; -exports[`date > seed: 1337 > weekday() > should return deterministic value weekday with abbr true 1`] = `"Mon"`; +exports[`date > 1337 > weekday > with abbr = true and context = true 1`] = `"Mon"`; -exports[`date > seed: 1337 > weekday() > should return deterministic value weekday with context true 1`] = `"Monday"`; +exports[`date > 1337 > weekday > with context = true 1`] = `"Monday"`; diff --git a/test/__snapshots__/git.spec.ts.snap b/test/__snapshots__/git.spec.ts.snap index 11b82fbe686..9c7367ac7cc 100644 --- a/test/__snapshots__/git.spec.ts.snap +++ b/test/__snapshots__/git.spec.ts.snap @@ -1,25 +1,25 @@ // Vitest Snapshot v1 -exports[`git > seed: 42 > branch() 1`] = `"array-transmit"`; +exports[`git > 42 > branch 1`] = `"array-transmit"`; -exports[`git > seed: 42 > commitMessage() 1`] = `"navigate neural capacitor"`; +exports[`git > 42 > commitMessage 1`] = `"navigate neural capacitor"`; -exports[`git > seed: 42 > commitSha() 1`] = `"5cf2bc99272107d592ba00fbdf302f2949806048"`; +exports[`git > 42 > commitSha 1`] = `"5cf2bc99272107d592ba00fbdf302f2949806048"`; -exports[`git > seed: 42 > shortSha() 1`] = `"5cf2bc9"`; +exports[`git > 42 > shortSha 1`] = `"5cf2bc9"`; -exports[`git > seed: 1211 > branch() 1`] = `"capacitor-connect"`; +exports[`git > 1211 > branch 1`] = `"capacitor-connect"`; -exports[`git > seed: 1211 > commitMessage() 1`] = `"reboot online circuit"`; +exports[`git > 1211 > commitMessage 1`] = `"reboot online circuit"`; -exports[`git > seed: 1211 > commitSha() 1`] = `"e7ec32f0a2a3c652bbd0caabde64dfdf379e3259"`; +exports[`git > 1211 > commitSha 1`] = `"e7ec32f0a2a3c652bbd0caabde64dfdf379e3259"`; -exports[`git > seed: 1211 > shortSha() 1`] = `"e7ec32f"`; +exports[`git > 1211 > shortSha 1`] = `"e7ec32f"`; -exports[`git > seed: 1337 > branch() 1`] = `"port-quantify"`; +exports[`git > 1337 > branch 1`] = `"port-quantify"`; -exports[`git > seed: 1337 > commitMessage() 1`] = `"compress multi-byte panel"`; +exports[`git > 1337 > commitMessage 1`] = `"compress multi-byte panel"`; -exports[`git > seed: 1337 > commitSha() 1`] = `"48234870538945f4b41c61a52bf27dccc0576698"`; +exports[`git > 1337 > commitSha 1`] = `"48234870538945f4b41c61a52bf27dccc0576698"`; -exports[`git > seed: 1337 > shortSha() 1`] = `"4823487"`; +exports[`git > 1337 > shortSha 1`] = `"4823487"`; diff --git a/test/__snapshots__/hacker.spec.ts.snap b/test/__snapshots__/hacker.spec.ts.snap index 29f6a9f2628..69742770faf 100644 --- a/test/__snapshots__/hacker.spec.ts.snap +++ b/test/__snapshots__/hacker.spec.ts.snap @@ -1,37 +1,37 @@ // Vitest Snapshot v1 -exports[`name > seed: 42 > abbreviation() 1`] = `"HTTP"`; +exports[`hacker > 42 > abbreviation 1`] = `"HTTP"`; -exports[`name > seed: 42 > adjective() 1`] = `"cross-platform"`; +exports[`hacker > 42 > adjective 1`] = `"cross-platform"`; -exports[`name > seed: 42 > ingverb() 1`] = `"copying"`; +exports[`hacker > 42 > ingverb 1`] = `"copying"`; -exports[`name > seed: 42 > noun() 1`] = `"array"`; +exports[`hacker > 42 > noun 1`] = `"array"`; -exports[`name > seed: 42 > phrase() 1`] = `"Try to transmit the TCP microchip, maybe it will quantify the mobile monitor!"`; +exports[`hacker > 42 > phrase 1`] = `"Try to transmit the TCP microchip, maybe it will quantify the mobile monitor!"`; -exports[`name > seed: 42 > verb() 1`] = `"navigate"`; +exports[`hacker > 42 > verb 1`] = `"navigate"`; -exports[`name > seed: 1211 > abbreviation() 1`] = `"UTF8"`; +exports[`hacker > 1211 > abbreviation 1`] = `"UTF8"`; -exports[`name > seed: 1211 > adjective() 1`] = `"solid state"`; +exports[`hacker > 1211 > adjective 1`] = `"solid state"`; -exports[`name > seed: 1211 > ingverb() 1`] = `"programming"`; +exports[`hacker > 1211 > ingverb 1`] = `"programming"`; -exports[`name > seed: 1211 > noun() 1`] = `"capacitor"`; +exports[`hacker > 1211 > noun 1`] = `"capacitor"`; -exports[`name > seed: 1211 > phrase() 1`] = `"I'll back up the neural JSON program, that should panel the USB matrix!"`; +exports[`hacker > 1211 > phrase 1`] = `"I'll back up the neural JSON program, that should panel the USB matrix!"`; -exports[`name > seed: 1211 > verb() 1`] = `"reboot"`; +exports[`hacker > 1211 > verb 1`] = `"reboot"`; -exports[`name > seed: 1337 > abbreviation() 1`] = `"FTP"`; +exports[`hacker > 1337 > abbreviation 1`] = `"FTP"`; -exports[`name > seed: 1337 > adjective() 1`] = `"open-source"`; +exports[`hacker > 1337 > adjective 1`] = `"open-source"`; -exports[`name > seed: 1337 > ingverb() 1`] = `"compressing"`; +exports[`hacker > 1337 > ingverb 1`] = `"compressing"`; -exports[`name > seed: 1337 > noun() 1`] = `"port"`; +exports[`hacker > 1337 > noun 1`] = `"port"`; -exports[`name > seed: 1337 > phrase() 1`] = `"Try to generate the RAM program, maybe it will connect the back-end port!"`; +exports[`hacker > 1337 > phrase 1`] = `"Try to generate the RAM program, maybe it will connect the back-end port!"`; -exports[`name > seed: 1337 > verb() 1`] = `"compress"`; +exports[`hacker > 1337 > verb 1`] = `"compress"`; diff --git a/test/__snapshots__/helpers.spec.ts.snap b/test/__snapshots__/helpers.spec.ts.snap index 3c5b3aeff4e..d959cafe430 100644 --- a/test/__snapshots__/helpers.spec.ts.snap +++ b/test/__snapshots__/helpers.spec.ts.snap @@ -1,55 +1,313 @@ // Vitest Snapshot v1 -exports[`helpers > seed: 42 > mustache() 1`] = `""`; +exports[`helpers > 42 > arrayElement > noArgs 1`] = `"b"`; -exports[`helpers > seed: 42 > regexpStyleStringParse() 1`] = `""`; +exports[`helpers > 42 > arrayElement > with array 1`] = `"o"`; -exports[`helpers > seed: 42 > repeatString() 1`] = `""`; +exports[`helpers > 42 > arrayElements > noArgs 1`] = ` +[ + "b", + "c", +] +`; -exports[`helpers > seed: 42 > replaceCreditCardSymbols() 1`] = `"6453-3791-7755-1410-0489"`; +exports[`helpers > 42 > arrayElements > with array 1`] = ` +[ + "r", + "W", + "e", + "d", + "l", +] +`; -exports[`helpers > seed: 42 > replaceSymbolWithNumber() 1`] = `""`; +exports[`helpers > 42 > arrayElements > with array 2`] = ` +[ + "l", + "r", + "o", +] +`; -exports[`helpers > seed: 42 > replaceSymbols() 1`] = `""`; +exports[`helpers > 42 > maybe > with only value 1`] = `"Hello World!"`; -exports[`helpers > seed: 42 > shuffle() 1`] = `[]`; +exports[`helpers > 42 > maybe > with value and probability 1`] = `undefined`; -exports[`helpers > seed: 42 > slugify() 1`] = `""`; +exports[`helpers > 42 > mustache > template with method 1`] = `"Hello John!"`; -exports[`helpers > seed: 42 > uniqueArray() 1`] = `[]`; +exports[`helpers > 42 > mustache > template with string 1`] = `"Hello John!"`; -exports[`helpers > seed: 1211 > mustache() 1`] = `""`; +exports[`helpers > 42 > objectKey > simple 1`] = `"b"`; -exports[`helpers > seed: 1211 > regexpStyleStringParse() 1`] = `""`; +exports[`helpers > 42 > objectValue > simple 1`] = `2`; -exports[`helpers > seed: 1211 > repeatString() 1`] = `""`; +exports[`helpers > 42 > regexpStyleStringParse > noArgs 1`] = `""`; -exports[`helpers > seed: 1211 > replaceCreditCardSymbols() 1`] = `"6453-9487-2190-6162-7434"`; +exports[`helpers > 42 > regexpStyleStringParse > only symbols 1`] = `"###test2"`; -exports[`helpers > seed: 1211 > replaceSymbolWithNumber() 1`] = `""`; +exports[`helpers > 42 > regexpStyleStringParse > some string 1`] = `"Hello !###test2"`; -exports[`helpers > seed: 1211 > replaceSymbols() 1`] = `""`; +exports[`helpers > 42 > repeatString > noArgs 1`] = `""`; -exports[`helpers > seed: 1211 > shuffle() 1`] = `[]`; +exports[`helpers > 42 > repeatString > with only text 1`] = `""`; -exports[`helpers > seed: 1211 > slugify() 1`] = `""`; +exports[`helpers > 42 > repeatString > with text and repetitions 1`] = `"Hello World! Hello World! Hello World! "`; -exports[`helpers > seed: 1211 > uniqueArray() 1`] = `[]`; +exports[`helpers > 42 > replaceCreditCardSymbols > noArgs 1`] = `"6453-3791-7755-1410-0489"`; -exports[`helpers > seed: 1337 > mustache() 1`] = `""`; +exports[`helpers > 42 > replaceCreditCardSymbols > only symbols 1`] = `"7917-6-7563-4"`; -exports[`helpers > seed: 1337 > regexpStyleStringParse() 1`] = `""`; +exports[`helpers > 42 > replaceCreditCardSymbols > some string 1`] = `"^1234567890ß´°4\\"§$%&/()=?\`+7*,..-;:_NaN"`; -exports[`helpers > seed: 1337 > repeatString() 1`] = `""`; +exports[`helpers > 42 > replaceSymbolWithNumber > noArgs 1`] = `""`; -exports[`helpers > seed: 1337 > replaceCreditCardSymbols() 1`] = `"6453-2512-2540-3255-2399"`; +exports[`helpers > 42 > replaceSymbolWithNumber > only symbols 1`] = `"47917"`; -exports[`helpers > seed: 1337 > replaceSymbolWithNumber() 1`] = `""`; +exports[`helpers > 42 > replaceSymbolWithNumber > some string 1`] = `"^1234567890ß´°4\\"§$%&/()=?\`+7*,..-;:_"`; -exports[`helpers > seed: 1337 > replaceSymbols() 1`] = `""`; +exports[`helpers > 42 > replaceSymbols > noArgs 1`] = `""`; -exports[`helpers > seed: 1337 > shuffle() 1`] = `[]`; +exports[`helpers > 42 > replaceSymbols > only symbols 1`] = `"3UE7UP"`; -exports[`helpers > seed: 1337 > slugify() 1`] = `""`; +exports[`helpers > 42 > replaceSymbols > some string 1`] = `"^1234567890ß´°!\\"§$%&/()=J\`+7E,..-;:_"`; -exports[`helpers > seed: 1337 > uniqueArray() 1`] = `[]`; +exports[`helpers > 42 > shuffle > noArgs 1`] = `[]`; + +exports[`helpers > 42 > shuffle > with array 1`] = ` +[ + "!", + "W", + "d", + "H", + "l", + "l", + "o", + " ", + "e", + "l", + "r", + "o", +] +`; + +exports[`helpers > 42 > slugify > noArgs 1`] = `""`; + +exports[`helpers > 42 > slugify > some string 1`] = `"hello-world"`; + +exports[`helpers > 42 > uniqueArray > with array 1`] = ` +[ + "H", + "l", + "W", +] +`; + +exports[`helpers > 1211 > arrayElement > noArgs 1`] = `"c"`; + +exports[`helpers > 1211 > arrayElement > with array 1`] = `"!"`; + +exports[`helpers > 1211 > arrayElements > noArgs 1`] = ` +[ + "a", + "c", + "b", +] +`; + +exports[`helpers > 1211 > arrayElements > with array 1`] = ` +[ + "r", + "o", + "l", + "!", + "l", + "d", + "W", + "H", + "e", + "o", + "l", + " ", +] +`; + +exports[`helpers > 1211 > arrayElements > with array 2`] = ` +[ + "r", + "o", + "!", +] +`; + +exports[`helpers > 1211 > maybe > with only value 1`] = `undefined`; + +exports[`helpers > 1211 > maybe > with value and probability 1`] = `undefined`; + +exports[`helpers > 1211 > mustache > template with method 1`] = `"Hello John!"`; + +exports[`helpers > 1211 > mustache > template with string 1`] = `"Hello John!"`; + +exports[`helpers > 1211 > objectKey > simple 1`] = `"c"`; + +exports[`helpers > 1211 > objectValue > simple 1`] = `3`; + +exports[`helpers > 1211 > regexpStyleStringParse > noArgs 1`] = `""`; + +exports[`helpers > 1211 > regexpStyleStringParse > only symbols 1`] = `"###test5"`; + +exports[`helpers > 1211 > regexpStyleStringParse > some string 1`] = `"Hello !###test5"`; + +exports[`helpers > 1211 > repeatString > noArgs 1`] = `""`; + +exports[`helpers > 1211 > repeatString > with only text 1`] = `""`; + +exports[`helpers > 1211 > repeatString > with text and repetitions 1`] = `"Hello World! Hello World! Hello World! "`; + +exports[`helpers > 1211 > replaceCreditCardSymbols > noArgs 1`] = `"6453-9487-2190-6162-7434"`; + +exports[`helpers > 1211 > replaceCreditCardSymbols > only symbols 1`] = `"4872-9-1927-1"`; + +exports[`helpers > 1211 > replaceCreditCardSymbols > some string 1`] = `"^1234567890ß´°9\\"§$%&/()=?\`+4*,..-;:_NaN"`; + +exports[`helpers > 1211 > replaceSymbolWithNumber > noArgs 1`] = `""`; + +exports[`helpers > 1211 > replaceSymbolWithNumber > only symbols 1`] = `"94872"`; + +exports[`helpers > 1211 > replaceSymbolWithNumber > some string 1`] = `"^1234567890ß´°9\\"§$%&/()=?\`+4*,..-;:_"`; + +exports[`helpers > 1211 > replaceSymbols > noArgs 1`] = `""`; + +exports[`helpers > 1211 > replaceSymbols > only symbols 1`] = `"9LU2DA"`; + +exports[`helpers > 1211 > replaceSymbols > some string 1`] = `"^1234567890ß´°!\\"§$%&/()=Y\`+4U,..-;:_"`; + +exports[`helpers > 1211 > shuffle > noArgs 1`] = `[]`; + +exports[`helpers > 1211 > shuffle > with array 1`] = ` +[ + "l", + "l", + "o", + "l", + "W", + "d", + "H", + "e", + "o", + "r", + " ", + "!", +] +`; + +exports[`helpers > 1211 > slugify > noArgs 1`] = `""`; + +exports[`helpers > 1211 > slugify > some string 1`] = `"hello-world"`; + +exports[`helpers > 1211 > uniqueArray > with array 1`] = ` +[ + "W", + "d", + "l", +] +`; + +exports[`helpers > 1337 > arrayElement > noArgs 1`] = `"a"`; + +exports[`helpers > 1337 > arrayElement > with array 1`] = `"l"`; + +exports[`helpers > 1337 > arrayElements > noArgs 1`] = ` +[ + "b", +] +`; + +exports[`helpers > 1337 > arrayElements > with array 1`] = ` +[ + "l", + "l", + "e", + "W", +] +`; + +exports[`helpers > 1337 > arrayElements > with array 2`] = ` +[ + "e", + "W", + "l", +] +`; + +exports[`helpers > 1337 > maybe > with only value 1`] = `"Hello World!"`; + +exports[`helpers > 1337 > maybe > with value and probability 1`] = `undefined`; + +exports[`helpers > 1337 > mustache > template with method 1`] = `"Hello John!"`; + +exports[`helpers > 1337 > mustache > template with string 1`] = `"Hello John!"`; + +exports[`helpers > 1337 > objectKey > simple 1`] = `"a"`; + +exports[`helpers > 1337 > objectValue > simple 1`] = `1`; + +exports[`helpers > 1337 > regexpStyleStringParse > noArgs 1`] = `""`; + +exports[`helpers > 1337 > regexpStyleStringParse > only symbols 1`] = `"###test2"`; + +exports[`helpers > 1337 > regexpStyleStringParse > some string 1`] = `"Hello !###test2"`; + +exports[`helpers > 1337 > repeatString > noArgs 1`] = `""`; + +exports[`helpers > 1337 > repeatString > with only text 1`] = `""`; + +exports[`helpers > 1337 > repeatString > with text and repetitions 1`] = `"Hello World! Hello World! Hello World! "`; + +exports[`helpers > 1337 > replaceCreditCardSymbols > noArgs 1`] = `"6453-2512-2540-3255-2399"`; + +exports[`helpers > 1337 > replaceCreditCardSymbols > only symbols 1`] = `"5122-5-5424-8"`; + +exports[`helpers > 1337 > replaceCreditCardSymbols > some string 1`] = `"^1234567890ß´°4\\"§$%&/()=?\`+5*,..-;:_NaN"`; + +exports[`helpers > 1337 > replaceSymbolWithNumber > noArgs 1`] = `""`; + +exports[`helpers > 1337 > replaceSymbolWithNumber > only symbols 1`] = `"45122"`; + +exports[`helpers > 1337 > replaceSymbolWithNumber > some string 1`] = `"^1234567890ß´°4\\"§$%&/()=?\`+5*,..-;:_"`; + +exports[`helpers > 1337 > replaceSymbols > noArgs 1`] = `""`; + +exports[`helpers > 1337 > replaceSymbols > only symbols 1`] = `"2O22O0"`; + +exports[`helpers > 1337 > replaceSymbols > some string 1`] = `"^1234567890ß´°!\\"§$%&/()=G\`+52,..-;:_"`; + +exports[`helpers > 1337 > shuffle > noArgs 1`] = `[]`; + +exports[`helpers > 1337 > shuffle > with array 1`] = ` +[ + " ", + "d", + "o", + "r", + "H", + "o", + "!", + "l", + "l", + "e", + "W", + "l", +] +`; + +exports[`helpers > 1337 > slugify > noArgs 1`] = `""`; + +exports[`helpers > 1337 > slugify > some string 1`] = `"hello-world"`; + +exports[`helpers > 1337 > uniqueArray > with array 1`] = ` +[ + "o", + "H", + "d", +] +`; diff --git a/test/__snapshots__/internet.spec.ts.snap b/test/__snapshots__/internet.spec.ts.snap index 4ff73c9c151..75f60a8163a 100644 --- a/test/__snapshots__/internet.spec.ts.snap +++ b/test/__snapshots__/internet.spec.ts.snap @@ -1,115 +1,181 @@ // Vitest Snapshot v1 -exports[`internet > seed: 42 > avatar() 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/468.jpg"`; +exports[`internet > 42 > avatar 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/468.jpg"`; -exports[`internet > seed: 42 > color() 1`] = `"#30667a"`; +exports[`internet > 42 > color > noArgs 1`] = `"#30667a"`; -exports[`internet > seed: 42 > domainName() 1`] = `"harmonious-shift.org"`; +exports[`internet > 42 > color > with color base 1`] = `"#6298ac"`; -exports[`internet > seed: 42 > domainSuffix() 1`] = `"info"`; +exports[`internet > 42 > domainName 1`] = `"harmonious-shift.org"`; -exports[`internet > seed: 42 > domainWord() 1`] = `"harmonious-shift"`; +exports[`internet > 42 > domainSuffix 1`] = `"info"`; -exports[`internet > seed: 42 > email() 1`] = `"Peyton73@yahoo.com"`; +exports[`internet > 42 > domainWord 1`] = `"harmonious-shift"`; -exports[`internet > seed: 42 > emoji() 1`] = `"🕸️"`; +exports[`internet > 42 > email > noArgs 1`] = `"Peyton73@yahoo.com"`; -exports[`internet > seed: 42 > exampleEmail() 1`] = `"Peyton73@example.com"`; +exports[`internet > 42 > email > with names 1`] = `"Jane_Doe18@yahoo.com"`; -exports[`internet > seed: 42 > httpMethod() 1`] = `"POST"`; +exports[`internet > 42 > email > with names and provider 1`] = `"Jane_Doe@fakerjs.dev"`; -exports[`internet > seed: 42 > httpStatusCode() 1`] = `207`; +exports[`internet > 42 > email > with provider 1`] = `"Garnett.Schinner73@fakerjs.dev"`; -exports[`internet > seed: 42 > ip() 1`] = `"95.203.243.46"`; +exports[`internet > 42 > emoji > noArgs 1`] = `"🕸️"`; -exports[`internet > seed: 42 > ipv6() 1`] = `"5cf2:bc99:2721:07d5:92ba:00fb:df30:2f29"`; +exports[`internet > 42 > emoji > with options 1`] = `"🦔"`; -exports[`internet > seed: 42 > mac() 1`] = `"5c:f2:bc:99:27:21"`; +exports[`internet > 42 > exampleEmail > noArgs 1`] = `"Peyton73@example.com"`; -exports[`internet > seed: 42 > password() 1`] = `"Dl2fkYYKLsZdepz"`; +exports[`internet > 42 > exampleEmail > with names 1`] = `"Jane_Doe18@example.com"`; -exports[`internet > seed: 42 > port() 1`] = `24545`; +exports[`internet > 42 > httpMethod 1`] = `"POST"`; -exports[`internet > seed: 42 > protocol() 1`] = `"http"`; +exports[`internet > 42 > httpStatusCode > noArgs 1`] = `207`; -exports[`internet > seed: 42 > url() 1`] = `"http://stable-vehicle.biz"`; +exports[`internet > 42 > httpStatusCode > with options 1`] = `410`; -exports[`internet > seed: 42 > userAgent() 1`] = `"Mozilla/5.0 (Windows; U; Windows NT 6.2) AppleWebKit/538.0.2 (KHTML, like Gecko) Chrome/29.0.815.0 Safari/538.0.2"`; +exports[`internet > 42 > ip 1`] = `"95.203.243.46"`; -exports[`internet > seed: 42 > userName() 1`] = `"Garnett.Schinner73"`; +exports[`internet > 42 > ipv4 1`] = `"95.203.243.46"`; -exports[`internet > seed: 1211 > avatar() 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/1160.jpg"`; +exports[`internet > 42 > ipv6 1`] = `"5cf2:bc99:2721:07d5:92ba:00fb:df30:2f29"`; -exports[`internet > seed: 1211 > color() 1`] = `"#773a72"`; +exports[`internet > 42 > mac > noArgs 1`] = `"5c:f2:bc:99:27:21"`; -exports[`internet > seed: 1211 > domainName() 1`] = `"verifiable-infection.org"`; +exports[`internet > 42 > mac > with separator 1`] = `"5c:f2:bc:99:27:21"`; -exports[`internet > seed: 1211 > domainSuffix() 1`] = `"org"`; +exports[`internet > 42 > password > noArgs 1`] = `"Dl2fkYYKLsZdepz"`; -exports[`internet > seed: 1211 > domainWord() 1`] = `"verifiable-infection"`; +exports[`internet > 42 > password > with length 1`] = `"Dl2fkYYKLs"`; -exports[`internet > seed: 1211 > email() 1`] = `"Jadon.Trantow12@hotmail.com"`; +exports[`internet > 42 > port 1`] = `24545`; -exports[`internet > seed: 1211 > emoji() 1`] = `"🇮🇸"`; +exports[`internet > 42 > protocol 1`] = `"http"`; -exports[`internet > seed: 1211 > exampleEmail() 1`] = `"Jadon.Trantow12@example.net"`; +exports[`internet > 42 > url 1`] = `"http://stable-vehicle.biz"`; -exports[`internet > seed: 1211 > httpMethod() 1`] = `"PATCH"`; +exports[`internet > 42 > userAgent 1`] = `"Mozilla/5.0 (Windows; U; Windows NT 6.2) AppleWebKit/538.0.2 (KHTML, like Gecko) Chrome/29.0.815.0 Safari/538.0.2"`; -exports[`internet > seed: 1211 > httpStatusCode() 1`] = `505`; +exports[`internet > 42 > userName > noArgs 1`] = `"Garnett.Schinner73"`; -exports[`internet > seed: 1211 > ip() 1`] = `"237.117.228.199"`; +exports[`internet > 42 > userName > with names 1`] = `"Jane_Doe"`; -exports[`internet > seed: 1211 > ipv6() 1`] = `"e7ec:32f0:a2a3:c652:bbd0:caab:de64:dfdf"`; +exports[`internet > 1211 > avatar 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/1160.jpg"`; -exports[`internet > seed: 1211 > mac() 1`] = `"e7:ec:32:f0:a2:a3"`; +exports[`internet > 1211 > color > noArgs 1`] = `"#773a72"`; -exports[`internet > seed: 1211 > password() 1`] = `"yLuj60b5iHB0bhn"`; +exports[`internet > 1211 > color > with color base 1`] = `"#a96ca4"`; -exports[`internet > seed: 1211 > port() 1`] = `60851`; +exports[`internet > 1211 > domainName 1`] = `"verifiable-infection.org"`; -exports[`internet > seed: 1211 > protocol() 1`] = `"https"`; +exports[`internet > 1211 > domainSuffix 1`] = `"org"`; -exports[`internet > seed: 1211 > url() 1`] = `"https://joyous-temperature.net"`; +exports[`internet > 1211 > domainWord 1`] = `"verifiable-infection"`; -exports[`internet > seed: 1211 > userAgent() 1`] = `"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6 rv:3.0; PT) AppleWebKit/538.2.0 (KHTML, like Gecko) Version/4.1.0 Safari/538.2.0"`; +exports[`internet > 1211 > email > noArgs 1`] = `"Jadon.Trantow12@hotmail.com"`; -exports[`internet > seed: 1211 > userName() 1`] = `"Tito_Koch22"`; +exports[`internet > 1211 > email > with names 1`] = `"Jane_Doe@hotmail.com"`; -exports[`internet > seed: 1337 > avatar() 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/327.jpg"`; +exports[`internet > 1211 > email > with names and provider 1`] = `"Jane.Doe89@fakerjs.dev"`; -exports[`internet > seed: 1337 > color() 1`] = `"#214814"`; +exports[`internet > 1211 > email > with provider 1`] = `"Tito_Koch22@fakerjs.dev"`; -exports[`internet > seed: 1337 > domainName() 1`] = `"fabulous-might.com"`; +exports[`internet > 1211 > emoji > noArgs 1`] = `"🇮🇸"`; -exports[`internet > seed: 1337 > domainSuffix() 1`] = `"biz"`; +exports[`internet > 1211 > emoji > with options 1`] = `"🌲"`; -exports[`internet > seed: 1337 > domainWord() 1`] = `"fabulous-might"`; +exports[`internet > 1211 > exampleEmail > noArgs 1`] = `"Jadon.Trantow12@example.net"`; -exports[`internet > seed: 1337 > email() 1`] = `"Keith27@gmail.com"`; +exports[`internet > 1211 > exampleEmail > with names 1`] = `"Jane_Doe@example.net"`; -exports[`internet > seed: 1337 > emoji() 1`] = `"💇🏼‍♀️"`; +exports[`internet > 1211 > httpMethod 1`] = `"PATCH"`; -exports[`internet > seed: 1337 > exampleEmail() 1`] = `"Keith27@example.org"`; +exports[`internet > 1211 > httpStatusCode > noArgs 1`] = `505`; -exports[`internet > seed: 1337 > httpMethod() 1`] = `"POST"`; +exports[`internet > 1211 > httpStatusCode > with options 1`] = `429`; -exports[`internet > seed: 1337 > httpStatusCode() 1`] = `205`; +exports[`internet > 1211 > ip 1`] = `"237.117.228.199"`; -exports[`internet > seed: 1337 > ip() 1`] = `"67.143.40.54"`; +exports[`internet > 1211 > ipv4 1`] = `"237.117.228.199"`; -exports[`internet > seed: 1337 > ipv6() 1`] = `"4823:4870:5389:45f4:b41c:61a5:2bf2:7dcc"`; +exports[`internet > 1211 > ipv6 1`] = `"e7ec:32f0:a2a3:c652:bbd0:caab:de64:dfdf"`; -exports[`internet > seed: 1337 > mac() 1`] = `"48:23:48:70:53:89"`; +exports[`internet > 1211 > mac > noArgs 1`] = `"e7:ec:32:f0:a2:a3"`; -exports[`internet > seed: 1337 > password() 1`] = `"9V05TL7RY9fmECg"`; +exports[`internet > 1211 > mac > with separator 1`] = `"e7:ec:32:f0:a2:a3"`; -exports[`internet > seed: 1337 > port() 1`] = `17172`; +exports[`internet > 1211 > password > noArgs 1`] = `"yLuj60b5iHB0bhn"`; -exports[`internet > seed: 1337 > protocol() 1`] = `"http"`; +exports[`internet > 1211 > password > with length 1`] = `"yLuj60b5iH"`; -exports[`internet > seed: 1337 > url() 1`] = `"http://neat-chopsticks.biz"`; +exports[`internet > 1211 > port 1`] = `60851`; -exports[`internet > seed: 1337 > userAgent() 1`] = `"Mozilla/5.0 (Windows; U; Windows NT 6.1) AppleWebKit/532.0.0 (KHTML, like Gecko) Chrome/13.0.832.0 Safari/532.0.0"`; +exports[`internet > 1211 > protocol 1`] = `"https"`; -exports[`internet > seed: 1337 > userName() 1`] = `"Devyn21"`; +exports[`internet > 1211 > url 1`] = `"https://joyous-temperature.net"`; + +exports[`internet > 1211 > userAgent 1`] = `"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6 rv:3.0; PT) AppleWebKit/538.2.0 (KHTML, like Gecko) Version/4.1.0 Safari/538.2.0"`; + +exports[`internet > 1211 > userName > noArgs 1`] = `"Tito_Koch22"`; + +exports[`internet > 1211 > userName > with names 1`] = `"Jane.Doe89"`; + +exports[`internet > 1337 > avatar 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/327.jpg"`; + +exports[`internet > 1337 > color > noArgs 1`] = `"#214814"`; + +exports[`internet > 1337 > color > with color base 1`] = `"#537a46"`; + +exports[`internet > 1337 > domainName 1`] = `"fabulous-might.com"`; + +exports[`internet > 1337 > domainSuffix 1`] = `"biz"`; + +exports[`internet > 1337 > domainWord 1`] = `"fabulous-might"`; + +exports[`internet > 1337 > email > noArgs 1`] = `"Keith27@gmail.com"`; + +exports[`internet > 1337 > email > with names 1`] = `"Jane.Doe@gmail.com"`; + +exports[`internet > 1337 > email > with names and provider 1`] = `"Jane56@fakerjs.dev"`; + +exports[`internet > 1337 > email > with provider 1`] = `"Devyn21@fakerjs.dev"`; + +exports[`internet > 1337 > emoji > noArgs 1`] = `"💇🏼‍♀️"`; + +exports[`internet > 1337 > emoji > with options 1`] = `"🐪"`; + +exports[`internet > 1337 > exampleEmail > noArgs 1`] = `"Keith27@example.org"`; + +exports[`internet > 1337 > exampleEmail > with names 1`] = `"Jane.Doe@example.org"`; + +exports[`internet > 1337 > httpMethod 1`] = `"POST"`; + +exports[`internet > 1337 > httpStatusCode > noArgs 1`] = `205`; + +exports[`internet > 1337 > httpStatusCode > with options 1`] = `407`; + +exports[`internet > 1337 > ip 1`] = `"67.143.40.54"`; + +exports[`internet > 1337 > ipv4 1`] = `"67.143.40.54"`; + +exports[`internet > 1337 > ipv6 1`] = `"4823:4870:5389:45f4:b41c:61a5:2bf2:7dcc"`; + +exports[`internet > 1337 > mac > noArgs 1`] = `"48:23:48:70:53:89"`; + +exports[`internet > 1337 > mac > with separator 1`] = `"48:23:48:70:53:89"`; + +exports[`internet > 1337 > password > noArgs 1`] = `"9V05TL7RY9fmECg"`; + +exports[`internet > 1337 > password > with length 1`] = `"9V05TL7RY9"`; + +exports[`internet > 1337 > port 1`] = `17172`; + +exports[`internet > 1337 > protocol 1`] = `"http"`; + +exports[`internet > 1337 > url 1`] = `"http://neat-chopsticks.biz"`; + +exports[`internet > 1337 > userAgent 1`] = `"Mozilla/5.0 (Windows; U; Windows NT 6.1) AppleWebKit/532.0.0 (KHTML, like Gecko) Chrome/13.0.832.0 Safari/532.0.0"`; + +exports[`internet > 1337 > userName > noArgs 1`] = `"Devyn21"`; + +exports[`internet > 1337 > userName > with names 1`] = `"Jane56"`; diff --git a/test/__snapshots__/lorem.spec.ts.snap b/test/__snapshots__/lorem.spec.ts.snap index e9ecfc5ab69..fb617ce7617 100644 --- a/test/__snapshots__/lorem.spec.ts.snap +++ b/test/__snapshots__/lorem.spec.ts.snap @@ -1,31 +1,71 @@ // Vitest Snapshot v1 -exports[`lorem > seed: 42 > lines() 1`] = ` +exports[`lorem > 42 > lines > noArgs 1`] = ` "Hic sit minus dolor animi mollitia sequi ducimus sequi. Inventore praesentium et." `; -exports[`lorem > seed: 42 > paragraph() 1`] = `"Hic sit minus dolor animi mollitia sequi ducimus sequi. Inventore praesentium et. Animi qui impedit et voluptatem. Ut quisquam fugiat."`; +exports[`lorem > 42 > lines > with length 1`] = ` +"Quibusdam hic sit minus dolor. +Mollitia sequi ducimus sequi aspernatur inventore praesentium. +Suscipit animi qui impedit et voluptatem inventore ut quisquam. +Itaque non alias sit asperiores sit et corporis laborum. +Consequatur et voluptatem nostrum cupiditate laborum in. +Quae nostrum aut consequatur. +Blanditiis sunt repellendus et. +Eum sint voluptatibus deserunt. +Quae eos est soluta ipsum qui. +Perferendis hic earum." +`; + +exports[`lorem > 42 > paragraph > noArgs 1`] = `"Hic sit minus dolor animi mollitia sequi ducimus sequi. Inventore praesentium et. Animi qui impedit et voluptatem. Ut quisquam fugiat."`; + +exports[`lorem > 42 > paragraph > with length 1`] = `"Hic sit minus dolor animi mollitia sequi ducimus sequi. Inventore praesentium et. Animi qui impedit et voluptatem. Ut quisquam fugiat. Non alias sit asperiores sit et corporis laborum cupiditate consequatur. Voluptatem nostrum cupiditate laborum in eos. Nostrum aut consequatur. Blanditiis sunt repellendus et. Eum sint voluptatibus deserunt. Quae eos est soluta ipsum qui. Perferendis hic earum."`; -exports[`lorem > seed: 42 > paragraphs() 1`] = ` +exports[`lorem > 42 > paragraphs > noArgs 1`] = ` "Hic sit minus dolor animi mollitia sequi ducimus sequi. Inventore praesentium et. Animi qui impedit et voluptatem. Ut quisquam fugiat. Alias sit asperiores sit. Corporis laborum cupiditate consequatur et voluptatem nostrum. Laborum in eos quae nostrum aut consequatur. Blanditiis sunt repellendus et. Eum sint voluptatibus deserunt. Quae eos est soluta ipsum qui. Hic earum delectus. Consequatur eum corporis perferendis aspernatur incidunt nobis. Odio nobis quia est." `; -exports[`lorem > seed: 42 > sentence() 1`] = `"Quibusdam hic sit minus dolor."`; +exports[`lorem > 42 > paragraphs > with length 1`] = ` +"Hic sit minus dolor animi mollitia sequi ducimus sequi. Inventore praesentium et. Animi qui impedit et voluptatem. Ut quisquam fugiat. +Alias sit asperiores sit. Corporis laborum cupiditate consequatur et voluptatem nostrum. Laborum in eos quae nostrum aut consequatur. Blanditiis sunt repellendus et. Eum sint voluptatibus deserunt. Quae eos est soluta ipsum qui. +Hic earum delectus. Consequatur eum corporis perferendis aspernatur incidunt nobis. Odio nobis quia est. +Aperiam quia voluptates reprehenderit quaerat sit distinctio possimus enim. Occaecati quia unde similique amet doloremque. Voluptas omnis ducimus itaque qui saepe molestiae mollitia qui et. Sunt sunt adipisci occaecati quae. +Nulla iure placeat enim ut. Officia ex delectus minima est perspiciatis ad qui exercitationem. Dolorem architecto perferendis maiores nihil est qui velit exercitationem. Perferendis illum velit. Quo qui temporibus est id architecto molestiae ea. Fugit repudiandae eos pariatur fuga ducimus sit explicabo. +Enim libero quia nam qui. Quidem ad rerum natus rem eum sed. Quo pariatur omnis quisquam natus ut assumenda aliquam quos ipsa. +Molestiae aut accusantium odio odit sed doloremque eveniet. Voluptatum ipsam error molestias optio et eos magnam. Velit ut possimus sed tempora earum beatae. Nostrum optio neque aut non fuga consequatur. Harum odit accusamus blanditiis aut. +Esse saepe aut ut. Consequatur quia eveniet ex voluptatem. Aut enim tempora est molestiae alias illum aliquid eos corporis. +Excepturi provident esse atque. Eligendi sed enim laboriosam. Earum dolorem quia eius. +Nihil ea commodi et ut aliquam sapiente. Magnam optio dolores quo. Ratione veniam repellat eaque ut. Reiciendis quas velit ab aperiam minima nisi. Harum labore soluta ratione provident corrupti ducimus maiores omnis et." +`; + +exports[`lorem > 42 > sentence > noArgs 1`] = `"Quibusdam hic sit minus dolor."`; + +exports[`lorem > 42 > sentence > with length 1`] = `"Autem quibusdam hic sit minus dolor animi mollitia sequi ducimus."`; + +exports[`lorem > 42 > sentences > noArgs 1`] = `"Hic sit minus dolor animi mollitia sequi ducimus sequi. Inventore praesentium et. Animi qui impedit et voluptatem."`; + +exports[`lorem > 42 > sentences > with length 1`] = `"Quibusdam hic sit minus dolor. Mollitia sequi ducimus sequi aspernatur inventore praesentium. Suscipit animi qui impedit et voluptatem inventore ut quisquam. Itaque non alias sit asperiores sit et corporis laborum. Consequatur et voluptatem nostrum cupiditate laborum in. Quae nostrum aut consequatur. Blanditiis sunt repellendus et. Eum sint voluptatibus deserunt. Quae eos est soluta ipsum qui. Perferendis hic earum."`; + +exports[`lorem > 42 > slug > noArgs 1`] = `"autem-quibusdam-hic"`; -exports[`lorem > seed: 42 > sentences() 1`] = `"Hic sit minus dolor animi mollitia sequi ducimus sequi. Inventore praesentium et. Animi qui impedit et voluptatem."`; +exports[`lorem > 42 > slug > with length 1`] = `"autem-quibusdam-hic-sit-minus-dolor-animi-mollitia-sequi-ducimus"`; -exports[`lorem > seed: 42 > slug() 1`] = `"autem-quibusdam-hic"`; +exports[`lorem > 42 > text > noArgs 1`] = `"Hic sit minus dolor animi mollitia sequi ducimus sequi."`; -exports[`lorem > seed: 42 > text() 1`] = `"Hic sit minus dolor animi mollitia sequi ducimus sequi."`; +exports[`lorem > 42 > text > with length 1`] = `"Hic sit minus dolor animi mollitia sequi ducimus sequi."`; -exports[`lorem > seed: 42 > word() 1`] = `"autem"`; +exports[`lorem > 42 > word > noArgs 1`] = `"autem"`; -exports[`lorem > seed: 42 > words() 1`] = `"autem quibusdam hic"`; +exports[`lorem > 42 > word > with length 1`] = `"voluptatem"`; -exports[`lorem > seed: 1211 > lines() 1`] = ` +exports[`lorem > 42 > words > noArgs 1`] = `"autem quibusdam hic"`; + +exports[`lorem > 42 > words > with length 1`] = `"autem quibusdam hic sit minus dolor animi mollitia sequi ducimus"`; + +exports[`lorem > 1211 > lines > noArgs 1`] = ` "Saepe omnis tempora magni repellat eaque. Nesciunt nobis non voluptas quam ex neque eligendi. Vel perferendis assumenda nam expedita est eum molestiae. @@ -33,51 +73,135 @@ Ullam et maiores vero doloribus eius. Officia et velit voluptatem quis dolorum." `; -exports[`lorem > seed: 1211 > paragraph() 1`] = `"Saepe omnis tempora magni repellat eaque. Nesciunt nobis non voluptas quam ex neque eligendi. Vel perferendis assumenda nam expedita est eum molestiae. Ullam et maiores vero doloribus eius. Officia et velit voluptatem quis dolorum. Dignissimos voluptas aut qui corporis itaque sit provident quam aut."`; +exports[`lorem > 1211 > lines > with length 1`] = ` +"Praesentium saepe omnis tempora magni repellat eaque tempore nesciunt nobis. +Voluptas quam ex neque. +Placeat vel perferendis assumenda nam expedita est eum. +Iusto ullam et maiores vero doloribus eius qui officia et. +Voluptatem quis dolorum maiores. +Voluptas aut qui corporis itaque sit. +Quam aut nesciunt modi in ullam quia. +Iure occaecati repudiandae ut maiores pariatur enim vel. +Voluptatem in enim in quia beatae natus. +Eligendi tempora eos ipsa." +`; + +exports[`lorem > 1211 > paragraph > noArgs 1`] = `"Saepe omnis tempora magni repellat eaque. Nesciunt nobis non voluptas quam ex neque eligendi. Vel perferendis assumenda nam expedita est eum molestiae. Ullam et maiores vero doloribus eius. Officia et velit voluptatem quis dolorum. Dignissimos voluptas aut qui corporis itaque sit provident quam aut."`; + +exports[`lorem > 1211 > paragraph > with length 1`] = `"Saepe omnis tempora magni repellat eaque. Nesciunt nobis non voluptas quam ex neque eligendi. Vel perferendis assumenda nam expedita est eum molestiae. Ullam et maiores vero doloribus eius. Officia et velit voluptatem quis dolorum. Dignissimos voluptas aut qui corporis itaque sit provident quam aut. Modi in ullam quia. Iure occaecati repudiandae ut maiores pariatur enim vel. Voluptatem in enim in quia beatae natus. Eligendi tempora eos ipsa. Nulla quos quidem et sed voluptate et quia. Nulla esse in similique deleniti beatae eaque. Optio unde sit dolorum impedit et ad voluptatem."`; -exports[`lorem > seed: 1211 > paragraphs() 1`] = ` +exports[`lorem > 1211 > paragraphs > noArgs 1`] = ` "Saepe omnis tempora magni repellat eaque. Nesciunt nobis non voluptas quam ex neque eligendi. Vel perferendis assumenda nam expedita est eum molestiae. Ullam et maiores vero doloribus eius. Officia et velit voluptatem quis dolorum. Dignissimos voluptas aut qui corporis itaque sit provident quam aut. In ullam quia impedit. Occaecati repudiandae ut maiores pariatur enim. Deserunt voluptatem in enim in quia. Ut eligendi tempora eos ipsa cumque nulla. Quidem et sed voluptate et quia. Nulla esse in similique deleniti beatae eaque." `; -exports[`lorem > seed: 1211 > sentence() 1`] = `"Praesentium saepe omnis tempora magni repellat eaque tempore nesciunt nobis."`; +exports[`lorem > 1211 > paragraphs > with length 1`] = ` +"Saepe omnis tempora magni repellat eaque. Nesciunt nobis non voluptas quam ex neque eligendi. Vel perferendis assumenda nam expedita est eum molestiae. Ullam et maiores vero doloribus eius. Officia et velit voluptatem quis dolorum. Dignissimos voluptas aut qui corporis itaque sit provident quam aut. +In ullam quia impedit. Occaecati repudiandae ut maiores pariatur enim. Deserunt voluptatem in enim in quia. +Ut eligendi tempora eos ipsa cumque nulla. Quidem et sed voluptate et quia. Nulla esse in similique deleniti beatae eaque. +Unde sit dolorum impedit et ad voluptatem omnis. Excepturi optio laudantium atque eius sequi laborum perspiciatis. Ducimus aut cupiditate pariatur laudantium laudantium inventore autem qui. Quo sunt sunt consequatur rerum perspiciatis. Non tenetur ut quod vel explicabo officiis. +Cumque porro nam fugiat. Laboriosam qui necessitatibus alias voluptatem placeat. Vel omnis maiores totam ut vitae accusamus. +Eos natus minima voluptates non iusto voluptates. Asperiores dolore esse consequatur consectetur qui laborum quia error et. Vel et facere vel et harum vero. Facilis facere odio nulla et voluptates earum sed libero. +Sed eius ducimus. Ut ducimus eum perferendis velit quia rerum doloribus explicabo labore. Dolores eaque voluptas non. Quam eveniet sint sapiente mollitia magnam a quibusdam. +Aliquid ea et nisi placeat voluptas et. Magni eveniet cupiditate debitis est qui minus aut. Perspiciatis fugiat rerum recusandae atque. Magnam nihil est architecto. Iusto corrupti harum vero ipsam. Accusantium possimus tempora nihil incidunt qui molestiae saepe mollitia. +Velit sed incidunt nam assumenda mollitia voluptas eveniet. Ducimus voluptatem totam fugiat qui aspernatur omnis libero voluptatem sed. Maxime totam non odio facilis explicabo quidem. Quisquam esse perferendis voluptatem molestiae dolorem ut. +Et quo maiores ut et. Dolor velit rem officiis praesentium quia hic quo aut. Facilis voluptatem est aut sint. Illum quia architecto asperiores. Aut qui commodi aut ut quo." +`; + +exports[`lorem > 1211 > sentence > noArgs 1`] = `"Praesentium saepe omnis tempora magni repellat eaque tempore nesciunt nobis."`; + +exports[`lorem > 1211 > sentence > with length 1`] = `"Non praesentium saepe omnis tempora magni repellat eaque tempore nesciunt."`; + +exports[`lorem > 1211 > sentences > noArgs 1`] = `"Saepe omnis tempora magni repellat eaque. Nesciunt nobis non voluptas quam ex neque eligendi. Vel perferendis assumenda nam expedita est eum molestiae. Ullam et maiores vero doloribus eius. Officia et velit voluptatem quis dolorum. Dignissimos voluptas aut qui corporis itaque sit provident quam aut."`; -exports[`lorem > seed: 1211 > sentences() 1`] = `"Saepe omnis tempora magni repellat eaque. Nesciunt nobis non voluptas quam ex neque eligendi. Vel perferendis assumenda nam expedita est eum molestiae. Ullam et maiores vero doloribus eius. Officia et velit voluptatem quis dolorum. Dignissimos voluptas aut qui corporis itaque sit provident quam aut."`; +exports[`lorem > 1211 > sentences > with length 1`] = `"Praesentium saepe omnis tempora magni repellat eaque tempore nesciunt nobis. Voluptas quam ex neque. Placeat vel perferendis assumenda nam expedita est eum. Iusto ullam et maiores vero doloribus eius qui officia et. Voluptatem quis dolorum maiores. Voluptas aut qui corporis itaque sit. Quam aut nesciunt modi in ullam quia. Iure occaecati repudiandae ut maiores pariatur enim vel. Voluptatem in enim in quia beatae natus. Eligendi tempora eos ipsa."`; -exports[`lorem > seed: 1211 > slug() 1`] = `"non-praesentium-saepe"`; +exports[`lorem > 1211 > slug > noArgs 1`] = `"non-praesentium-saepe"`; -exports[`lorem > seed: 1211 > text() 1`] = ` +exports[`lorem > 1211 > slug > with length 1`] = `"non-praesentium-saepe-omnis-tempora-magni-repellat-eaque-tempore-nesciunt"`; + +exports[`lorem > 1211 > text > noArgs 1`] = ` +"Omnis tempora magni repellat eaque tempore nesciunt nobis non voluptas. +Ex neque eligendi placeat vel perferendis. +Nam expedita est eum molestiae iusto ullam et maiores." +`; + +exports[`lorem > 1211 > text > with length 1`] = ` "Omnis tempora magni repellat eaque tempore nesciunt nobis non voluptas. Ex neque eligendi placeat vel perferendis. Nam expedita est eum molestiae iusto ullam et maiores." `; -exports[`lorem > seed: 1211 > word() 1`] = `"non"`; +exports[`lorem > 1211 > word > noArgs 1`] = `"non"`; -exports[`lorem > seed: 1211 > words() 1`] = `"non praesentium saepe"`; +exports[`lorem > 1211 > word > with length 1`] = `"reiciendis"`; -exports[`lorem > seed: 1337 > lines() 1`] = ` +exports[`lorem > 1211 > words > noArgs 1`] = `"non praesentium saepe"`; + +exports[`lorem > 1211 > words > with length 1`] = `"non praesentium saepe omnis tempora magni repellat eaque tempore nesciunt"`; + +exports[`lorem > 1337 > lines > noArgs 1`] = ` "Nesciunt non minima perspiciatis praesentium aperiam voluptatem. Occaecati deserunt voluptatem suscipit." `; -exports[`lorem > seed: 1337 > paragraph() 1`] = `"Nesciunt non minima perspiciatis praesentium aperiam voluptatem. Occaecati deserunt voluptatem suscipit. Enim minus nemo fugit et iure explicabo et commodi consequuntur. Voluptatibus nesciunt dignissimos eos temporibus temporibus autem consequatur."`; +exports[`lorem > 1337 > lines > with length 1`] = ` +"Natus nesciunt non minima perspiciatis. +Aperiam voluptatem ut occaecati deserunt voluptatem. +Reiciendis enim minus nemo fugit. +Iure explicabo et commodi consequuntur quod voluptatibus nesciunt dignissimos. +Temporibus temporibus autem consequatur ea laudantium esse vel qui. +Omnis quis amet voluptatum quis et libero. +Et odio dolor qui velit qui. +Eveniet provident non fugiat. +Amet a a aut nihil vel quas. +Excepturi eligendi perferendis quo minus et asperiores nam." +`; + +exports[`lorem > 1337 > paragraph > noArgs 1`] = `"Nesciunt non minima perspiciatis praesentium aperiam voluptatem. Occaecati deserunt voluptatem suscipit. Enim minus nemo fugit et iure explicabo et commodi consequuntur. Voluptatibus nesciunt dignissimos eos temporibus temporibus autem consequatur."`; + +exports[`lorem > 1337 > paragraph > with length 1`] = `"Nesciunt non minima perspiciatis praesentium aperiam voluptatem. Occaecati deserunt voluptatem suscipit. Enim minus nemo fugit et iure explicabo et commodi consequuntur. Voluptatibus nesciunt dignissimos eos temporibus temporibus autem consequatur. Laudantium esse vel qui occaecati. Quis amet voluptatum quis et libero ea et odio. Qui velit qui velit. Provident non fugiat dolorum amet a a aut nihil vel. Eligendi excepturi eligendi perferendis quo minus et. Nam neque blanditiis consequuntur esse autem harum eligendi aut alias. Consequatur pariatur inventore omnis temporibus sapiente aliquid illo."`; -exports[`lorem > seed: 1337 > paragraphs() 1`] = ` +exports[`lorem > 1337 > paragraphs > noArgs 1`] = ` "Nesciunt non minima perspiciatis praesentium aperiam voluptatem. Occaecati deserunt voluptatem suscipit. Enim minus nemo fugit et iure explicabo et commodi consequuntur. Voluptatibus nesciunt dignissimos eos temporibus temporibus autem consequatur. Esse vel qui occaecati omnis quis. Voluptatum quis et libero. Et odio dolor qui velit qui. Eveniet provident non fugiat. A a aut nihil. Quas eligendi excepturi eligendi perferendis quo minus et asperiores. Neque blanditiis consequuntur esse autem harum eligendi aut. Cum consequatur pariatur. Omnis temporibus sapiente." `; -exports[`lorem > seed: 1337 > sentence() 1`] = `"Natus nesciunt non minima perspiciatis."`; +exports[`lorem > 1337 > paragraphs > with length 1`] = ` +"Nesciunt non minima perspiciatis praesentium aperiam voluptatem. Occaecati deserunt voluptatem suscipit. Enim minus nemo fugit et iure explicabo et commodi consequuntur. Voluptatibus nesciunt dignissimos eos temporibus temporibus autem consequatur. +Esse vel qui occaecati omnis quis. Voluptatum quis et libero. Et odio dolor qui velit qui. Eveniet provident non fugiat. +A a aut nihil. Quas eligendi excepturi eligendi perferendis quo minus et asperiores. Neque blanditiis consequuntur esse autem harum eligendi aut. Cum consequatur pariatur. Omnis temporibus sapiente. +Cumque cupiditate quos. Aut placeat quo ut est ut error quo. Id aliquam eos perferendis corporis sunt est itaque ad aut. Quos quis laboriosam molestias quisquam ratione aut est omnis necessitatibus. +Consectetur voluptas nam praesentium voluptates libero neque. Voluptates temporibus quia officiis cumque eos ut. Occaecati voluptatibus dolor est totam. Ducimus tempore qui rerum autem atque. Esse est inventore autem eligendi aliquid. +Quis quo deserunt eveniet deleniti quam sed totam nam et. Harum totam provident sit labore voluptatem rerum non natus ratione. Quas ut corporis et vel qui doloribus excepturi autem. +Nobis natus accusantium expedita. Impedit id cupiditate recusandae. Laborum beatae voluptate consequatur at. +Et exercitationem est reprehenderit placeat cumque modi ex modi doloremque. Ut corrupti atque velit ab laboriosam. Accusamus est rem est qui aspernatur hic eaque est quaerat. +Alias labore suscipit soluta. Deleniti sit itaque blanditiis culpa modi amet eum amet. Laboriosam aperiam et eius beatae ad quidem quasi inventore praesentium. Ut distinctio voluptas aut aut voluptas at laboriosam. +Error suscipit autem culpa dolorem ipsum ex nulla rerum. Animi maxime repellendus error dolorum. Eveniet unde velit accusantium eum vitae error tenetur deserunt blanditiis. Ratione explicabo cum optio fuga voluptate omnis ut et. Eveniet minus voluptatem ipsa quisquam est atque id." +`; + +exports[`lorem > 1337 > sentence > noArgs 1`] = `"Natus nesciunt non minima perspiciatis."`; + +exports[`lorem > 1337 > sentence > with length 1`] = `"Voluptatem natus nesciunt non minima perspiciatis praesentium aperiam voluptatem ut."`; + +exports[`lorem > 1337 > sentences > noArgs 1`] = `"Nesciunt non minima perspiciatis praesentium aperiam voluptatem. Occaecati deserunt voluptatem suscipit. Enim minus nemo fugit et iure explicabo et commodi consequuntur."`; + +exports[`lorem > 1337 > sentences > with length 1`] = `"Natus nesciunt non minima perspiciatis. Aperiam voluptatem ut occaecati deserunt voluptatem. Reiciendis enim minus nemo fugit. Iure explicabo et commodi consequuntur quod voluptatibus nesciunt dignissimos. Temporibus temporibus autem consequatur ea laudantium esse vel qui. Omnis quis amet voluptatum quis et libero. Et odio dolor qui velit qui. Eveniet provident non fugiat. Amet a a aut nihil vel quas. Excepturi eligendi perferendis quo minus et asperiores nam."`; + +exports[`lorem > 1337 > slug > noArgs 1`] = `"voluptatem-natus-nesciunt"`; + +exports[`lorem > 1337 > slug > with length 1`] = `"voluptatem-natus-nesciunt-non-minima-perspiciatis-praesentium-aperiam-voluptatem-ut"`; + +exports[`lorem > 1337 > text > noArgs 1`] = `"natus nesciunt non"`; -exports[`lorem > seed: 1337 > sentences() 1`] = `"Nesciunt non minima perspiciatis praesentium aperiam voluptatem. Occaecati deserunt voluptatem suscipit. Enim minus nemo fugit et iure explicabo et commodi consequuntur."`; +exports[`lorem > 1337 > text > with length 1`] = `"natus nesciunt non"`; -exports[`lorem > seed: 1337 > slug() 1`] = `"voluptatem-natus-nesciunt"`; +exports[`lorem > 1337 > word > noArgs 1`] = `"voluptatem"`; -exports[`lorem > seed: 1337 > text() 1`] = `"natus nesciunt non"`; +exports[`lorem > 1337 > word > with length 1`] = `"voluptatem"`; -exports[`lorem > seed: 1337 > word() 1`] = `"voluptatem"`; +exports[`lorem > 1337 > words > noArgs 1`] = `"voluptatem natus nesciunt"`; -exports[`lorem > seed: 1337 > words() 1`] = `"voluptatem natus nesciunt"`; +exports[`lorem > 1337 > words > with length 1`] = `"voluptatem natus nesciunt non minima perspiciatis praesentium aperiam voluptatem ut"`; diff --git a/test/__snapshots__/music.spec.ts.snap b/test/__snapshots__/music.spec.ts.snap index 7ae987ec79c..e319a18d629 100644 --- a/test/__snapshots__/music.spec.ts.snap +++ b/test/__snapshots__/music.spec.ts.snap @@ -1,13 +1,13 @@ // Vitest Snapshot v1 -exports[`music > seed: 42 > genre() 1`] = `"Country"`; +exports[`music > 42 > genre 1`] = `"Country"`; -exports[`music > seed: 42 > songName() 1`] = `"Only The Lonely (Know The Way I Feel)"`; +exports[`music > 42 > songName 1`] = `"Only The Lonely (Know The Way I Feel)"`; -exports[`music > seed: 1211 > genre() 1`] = `"Non Music"`; +exports[`music > 1211 > genre 1`] = `"Non Music"`; -exports[`music > seed: 1211 > songName() 1`] = `"The End of the World"`; +exports[`music > 1211 > songName 1`] = `"The End of the World"`; -exports[`music > seed: 1337 > genre() 1`] = `"Folk"`; +exports[`music > 1337 > genre 1`] = `"Folk"`; -exports[`music > seed: 1337 > songName() 1`] = `"Turn! Turn! Turn! (To Everything There is a Season)"`; +exports[`music > 1337 > songName 1`] = `"Turn! Turn! Turn! (To Everything There is a Season)"`; diff --git a/test/__snapshots__/name.spec.ts.snap b/test/__snapshots__/name.spec.ts.snap index 32cd8cdca64..dc56d58ea46 100644 --- a/test/__snapshots__/name.spec.ts.snap +++ b/test/__snapshots__/name.spec.ts.snap @@ -1,73 +1,151 @@ // Vitest Snapshot v1 -exports[`name > seed: 42 > findName() 1`] = `"Sadie Wiegand"`; +exports[`name > 42 > findName > noArgs 1`] = `"Sadie Wiegand"`; -exports[`name > seed: 42 > firstName() 1`] = `"Garnett"`; +exports[`name > 42 > findName > with gender 1`] = `"Melanie Schinner"`; -exports[`name > seed: 42 > fullName() 1`] = `"Sadie Wiegand"`; +exports[`name > 42 > findName > with name 1`] = `"John Doe"`; -exports[`name > seed: 42 > gender() 1`] = `"Gender nonconforming"`; +exports[`name > 42 > findName > with name and gender 1`] = `"John Doe"`; -exports[`name > seed: 42 > jobArea() 1`] = `"Identity"`; +exports[`name > 42 > firstName > noArgs 1`] = `"Garnett"`; -exports[`name > seed: 42 > jobDescriptor() 1`] = `"Regional"`; +exports[`name > 42 > firstName > with gender 1`] = `"Glen"`; -exports[`name > seed: 42 > jobTitle() 1`] = `"Regional Data Representative"`; +exports[`name > 42 > fullName > noArgs 1`] = `"Sadie Wiegand"`; -exports[`name > seed: 42 > jobType() 1`] = `"Coordinator"`; +exports[`name > 42 > fullName > with all 1`] = `"John Doe"`; -exports[`name > seed: 42 > lastName() 1`] = `"Hintz"`; +exports[`name > 42 > fullName > with firstName 1`] = `"John Schinner"`; -exports[`name > seed: 42 > middleName() 1`] = `"Greer"`; +exports[`name > 42 > fullName > with gender 1`] = `"Melanie Schinner"`; -exports[`name > seed: 42 > prefix() 1`] = `"Mrs."`; +exports[`name > 42 > fullName > with lastName 1`] = `"Sadie Doe"`; -exports[`name > seed: 42 > suffix() 1`] = `"III"`; +exports[`name > 42 > gender > noArgs 1`] = `"Gender nonconforming"`; -exports[`name > seed: 1211 > findName() 1`] = `"Claude Trantow"`; +exports[`name > 42 > gender > with gender 1`] = `"Female"`; -exports[`name > seed: 1211 > firstName() 1`] = `"Tito"`; +exports[`name > 42 > jobArea 1`] = `"Identity"`; -exports[`name > seed: 1211 > fullName() 1`] = `"Claude Trantow"`; +exports[`name > 42 > jobDescriptor 1`] = `"Regional"`; -exports[`name > seed: 1211 > gender() 1`] = `"Trigender"`; +exports[`name > 42 > jobTitle 1`] = `"Regional Data Representative"`; -exports[`name > seed: 1211 > jobArea() 1`] = `"Factors"`; +exports[`name > 42 > jobType 1`] = `"Coordinator"`; -exports[`name > seed: 1211 > jobDescriptor() 1`] = `"Chief"`; +exports[`name > 42 > lastName > noArgs 1`] = `"Hintz"`; -exports[`name > seed: 1211 > jobTitle() 1`] = `"Chief Division Agent"`; +exports[`name > 42 > lastName > with gender 1`] = `"Hintz"`; -exports[`name > seed: 1211 > jobType() 1`] = `"Representative"`; +exports[`name > 42 > middleName > noArgs 1`] = `"Greer"`; -exports[`name > seed: 1211 > lastName() 1`] = `"Ward"`; +exports[`name > 42 > middleName > with gender 1`] = `"Houston"`; -exports[`name > seed: 1211 > middleName() 1`] = `"Sawyer"`; +exports[`name > 42 > prefix > noArgs 1`] = `"Mrs."`; -exports[`name > seed: 1211 > prefix() 1`] = `"Dr."`; +exports[`name > 42 > prefix > with gender 1`] = `"Mrs."`; -exports[`name > seed: 1211 > suffix() 1`] = `"DVM"`; +exports[`name > 42 > suffix > noArgs 1`] = `"III"`; -exports[`name > seed: 1337 > findName() 1`] = `"Leona Cronin"`; +exports[`name > 42 > suffix > with gender 1`] = `"III"`; -exports[`name > seed: 1337 > firstName() 1`] = `"Devyn"`; +exports[`name > 1211 > findName > noArgs 1`] = `"Claude Trantow"`; -exports[`name > seed: 1337 > fullName() 1`] = `"Leona Cronin"`; +exports[`name > 1211 > findName > with gender 1`] = `"Patti Koch"`; -exports[`name > seed: 1337 > gender() 1`] = `"Demigender"`; +exports[`name > 1211 > findName > with name 1`] = `"John Doe"`; -exports[`name > seed: 1337 > jobArea() 1`] = `"Functionality"`; +exports[`name > 1211 > findName > with name and gender 1`] = `"John Doe"`; -exports[`name > seed: 1337 > jobDescriptor() 1`] = `"Future"`; +exports[`name > 1211 > firstName > noArgs 1`] = `"Tito"`; -exports[`name > seed: 1337 > jobTitle() 1`] = `"Future Infrastructure Liaison"`; +exports[`name > 1211 > firstName > with gender 1`] = `"Percy"`; -exports[`name > seed: 1337 > jobType() 1`] = `"Engineer"`; +exports[`name > 1211 > fullName > noArgs 1`] = `"Claude Trantow"`; -exports[`name > seed: 1337 > lastName() 1`] = `"Gibson"`; +exports[`name > 1211 > fullName > with all 1`] = `"John Doe"`; -exports[`name > seed: 1337 > middleName() 1`] = `"Dakota"`; +exports[`name > 1211 > fullName > with firstName 1`] = `"John Koch"`; -exports[`name > seed: 1337 > prefix() 1`] = `"Mrs."`; +exports[`name > 1211 > fullName > with gender 1`] = `"Patti Koch"`; -exports[`name > seed: 1337 > suffix() 1`] = `"I"`; +exports[`name > 1211 > fullName > with lastName 1`] = `"Claude Doe"`; + +exports[`name > 1211 > gender > noArgs 1`] = `"Trigender"`; + +exports[`name > 1211 > gender > with gender 1`] = `"Male"`; + +exports[`name > 1211 > jobArea 1`] = `"Factors"`; + +exports[`name > 1211 > jobDescriptor 1`] = `"Chief"`; + +exports[`name > 1211 > jobTitle 1`] = `"Chief Division Agent"`; + +exports[`name > 1211 > jobType 1`] = `"Representative"`; + +exports[`name > 1211 > lastName > noArgs 1`] = `"Ward"`; + +exports[`name > 1211 > lastName > with gender 1`] = `"Ward"`; + +exports[`name > 1211 > middleName > noArgs 1`] = `"Sawyer"`; + +exports[`name > 1211 > middleName > with gender 1`] = `"Walter"`; + +exports[`name > 1211 > prefix > noArgs 1`] = `"Dr."`; + +exports[`name > 1211 > prefix > with gender 1`] = `"Dr."`; + +exports[`name > 1211 > suffix > noArgs 1`] = `"DVM"`; + +exports[`name > 1211 > suffix > with gender 1`] = `"DVM"`; + +exports[`name > 1337 > findName > noArgs 1`] = `"Leona Cronin"`; + +exports[`name > 1337 > findName > with gender 1`] = `"Esther Macejkovic"`; + +exports[`name > 1337 > findName > with name 1`] = `"John Doe"`; + +exports[`name > 1337 > findName > with name and gender 1`] = `"John Doe"`; + +exports[`name > 1337 > firstName > noArgs 1`] = `"Devyn"`; + +exports[`name > 1337 > firstName > with gender 1`] = `"Ray"`; + +exports[`name > 1337 > fullName > noArgs 1`] = `"Leona Cronin"`; + +exports[`name > 1337 > fullName > with all 1`] = `"John Doe"`; + +exports[`name > 1337 > fullName > with firstName 1`] = `"John Macejkovic"`; + +exports[`name > 1337 > fullName > with gender 1`] = `"Esther Macejkovic"`; + +exports[`name > 1337 > fullName > with lastName 1`] = `"Leona Doe"`; + +exports[`name > 1337 > gender > noArgs 1`] = `"Demigender"`; + +exports[`name > 1337 > gender > with gender 1`] = `"Female"`; + +exports[`name > 1337 > jobArea 1`] = `"Functionality"`; + +exports[`name > 1337 > jobDescriptor 1`] = `"Future"`; + +exports[`name > 1337 > jobTitle 1`] = `"Future Infrastructure Liaison"`; + +exports[`name > 1337 > jobType 1`] = `"Engineer"`; + +exports[`name > 1337 > lastName > noArgs 1`] = `"Gibson"`; + +exports[`name > 1337 > lastName > with gender 1`] = `"Gibson"`; + +exports[`name > 1337 > middleName > noArgs 1`] = `"Dakota"`; + +exports[`name > 1337 > middleName > with gender 1`] = `"Ethan"`; + +exports[`name > 1337 > prefix > noArgs 1`] = `"Mrs."`; + +exports[`name > 1337 > prefix > with gender 1`] = `"Mrs."`; + +exports[`name > 1337 > suffix > noArgs 1`] = `"I"`; + +exports[`name > 1337 > suffix > with gender 1`] = `"I"`; diff --git a/test/__snapshots__/phone.spec.ts.snap b/test/__snapshots__/phone.spec.ts.snap index 5c66e04156a..8fc1a1bf10e 100644 --- a/test/__snapshots__/phone.spec.ts.snap +++ b/test/__snapshots__/phone.spec.ts.snap @@ -1,55 +1,73 @@ // Vitest Snapshot v1 -exports[`phone > seed: 42 > imei() 1`] = `"37-917755-141004-5"`; +exports[`phone > 42 > imei 1`] = `"37-917755-141004-5"`; -exports[`phone > seed: 42 > number() 1`] = `"891.775.5141"`; +exports[`phone > 42 > number > format 1`] = `"379-177-5514"`; -exports[`phone > seed: 42 > phoneFormats() 1`] = `"!##.!##.####"`; +exports[`phone > 42 > number > noArgs 1`] = `"891.775.5141"`; -exports[`phone > seed: 42 > phoneNumber() 1`] = `"891.775.5141"`; +exports[`phone > 42 > phoneFormats 1`] = `"!##.!##.####"`; -exports[`phone > seed: 42 > phoneNumberFormat > should return deterministic values for 1 1`] = `"(479) 377-5514"`; +exports[`phone > 42 > phoneNumber > format 1`] = `"379-177-5514"`; -exports[`phone > seed: 42 > phoneNumberFormat > should return deterministic values for 2 1`] = `"1-479-377-5514"`; +exports[`phone > 42 > phoneNumber > noArgs 1`] = `"891.775.5141"`; -exports[`phone > seed: 42 > phoneNumberFormat > should return deterministic values for 3 1`] = `"479.377.5514"`; +exports[`phone > 42 > phoneNumberFormat > noArgs 1`] = `"479-377-5514"`; -exports[`phone > seed: 42 > phoneNumberFormat > should return deterministic values for 4 1`] = `"479-377-5514"`; +exports[`phone > 42 > phoneNumberFormat > with index = 0 1`] = `"479-377-5514"`; -exports[`phone > seed: 42 > phoneNumberFormat() 1`] = `"479-377-5514"`; +exports[`phone > 42 > phoneNumberFormat > with index = 1 1`] = `"(479) 377-5514"`; -exports[`phone > seed: 1211 > imei() 1`] = `"94-872190-616274-4"`; +exports[`phone > 42 > phoneNumberFormat > with index = 2 1`] = `"1-479-377-5514"`; -exports[`phone > seed: 1211 > number() 1`] = `"1-587-319-0616 x27431"`; +exports[`phone > 42 > phoneNumberFormat > with index = 3 1`] = `"479.377.5514"`; -exports[`phone > seed: 1211 > phoneFormats() 1`] = `"1-!##-!##-#### x#####"`; +exports[`phone > 42 > phoneNumberFormat > with index = 4 1`] = `"479-377-5514"`; -exports[`phone > seed: 1211 > phoneNumber() 1`] = `"1-587-319-0616 x27431"`; +exports[`phone > 1211 > imei 1`] = `"94-872190-616274-4"`; -exports[`phone > seed: 1211 > phoneNumberFormat > should return deterministic values for 1 1`] = `"(948) 821-9061"`; +exports[`phone > 1211 > number > format 1`] = `"948-721-9061"`; -exports[`phone > seed: 1211 > phoneNumberFormat > should return deterministic values for 2 1`] = `"1-948-821-9061"`; +exports[`phone > 1211 > number > noArgs 1`] = `"1-587-319-0616 x27431"`; -exports[`phone > seed: 1211 > phoneNumberFormat > should return deterministic values for 3 1`] = `"948.821.9061"`; +exports[`phone > 1211 > phoneFormats 1`] = `"1-!##-!##-#### x#####"`; -exports[`phone > seed: 1211 > phoneNumberFormat > should return deterministic values for 4 1`] = `"948-821-9061"`; +exports[`phone > 1211 > phoneNumber > format 1`] = `"948-721-9061"`; -exports[`phone > seed: 1211 > phoneNumberFormat() 1`] = `"948-821-9061"`; +exports[`phone > 1211 > phoneNumber > noArgs 1`] = `"1-587-319-0616 x27431"`; -exports[`phone > seed: 1337 > imei() 1`] = `"25-122540-325523-4"`; +exports[`phone > 1211 > phoneNumberFormat > noArgs 1`] = `"948-821-9061"`; -exports[`phone > seed: 1337 > number() 1`] = `"(612) 454-0325"`; +exports[`phone > 1211 > phoneNumberFormat > with index = 0 1`] = `"948-821-9061"`; -exports[`phone > seed: 1337 > phoneFormats() 1`] = `"(!##) !##-####"`; +exports[`phone > 1211 > phoneNumberFormat > with index = 1 1`] = `"(948) 821-9061"`; -exports[`phone > seed: 1337 > phoneNumber() 1`] = `"(612) 454-0325"`; +exports[`phone > 1211 > phoneNumberFormat > with index = 2 1`] = `"1-948-821-9061"`; -exports[`phone > seed: 1337 > phoneNumberFormat > should return deterministic values for 1 1`] = `"(451) 325-4032"`; +exports[`phone > 1211 > phoneNumberFormat > with index = 3 1`] = `"948.821.9061"`; -exports[`phone > seed: 1337 > phoneNumberFormat > should return deterministic values for 2 1`] = `"1-451-325-4032"`; +exports[`phone > 1211 > phoneNumberFormat > with index = 4 1`] = `"948-821-9061"`; -exports[`phone > seed: 1337 > phoneNumberFormat > should return deterministic values for 3 1`] = `"451.325.4032"`; +exports[`phone > 1337 > imei 1`] = `"25-122540-325523-4"`; -exports[`phone > seed: 1337 > phoneNumberFormat > should return deterministic values for 4 1`] = `"451-325-4032"`; +exports[`phone > 1337 > number > format 1`] = `"251-225-4032"`; -exports[`phone > seed: 1337 > phoneNumberFormat() 1`] = `"451-325-4032"`; +exports[`phone > 1337 > number > noArgs 1`] = `"(612) 454-0325"`; + +exports[`phone > 1337 > phoneFormats 1`] = `"(!##) !##-####"`; + +exports[`phone > 1337 > phoneNumber > format 1`] = `"251-225-4032"`; + +exports[`phone > 1337 > phoneNumber > noArgs 1`] = `"(612) 454-0325"`; + +exports[`phone > 1337 > phoneNumberFormat > noArgs 1`] = `"451-325-4032"`; + +exports[`phone > 1337 > phoneNumberFormat > with index = 0 1`] = `"451-325-4032"`; + +exports[`phone > 1337 > phoneNumberFormat > with index = 1 1`] = `"(451) 325-4032"`; + +exports[`phone > 1337 > phoneNumberFormat > with index = 2 1`] = `"1-451-325-4032"`; + +exports[`phone > 1337 > phoneNumberFormat > with index = 3 1`] = `"451.325.4032"`; + +exports[`phone > 1337 > phoneNumberFormat > with index = 4 1`] = `"451-325-4032"`; diff --git a/test/__snapshots__/random.spec.ts.snap b/test/__snapshots__/random.spec.ts.snap index 7102da68baa..b664767a423 100644 --- a/test/__snapshots__/random.spec.ts.snap +++ b/test/__snapshots__/random.spec.ts.snap @@ -1,37 +1,61 @@ // Vitest Snapshot v1 -exports[`random > seed: 42 > alpha() 1`] = `"j"`; +exports[`random > 42 > alpha > noArgs 1`] = `"j"`; -exports[`random > seed: 42 > alphaNumeric() 1`] = `"d"`; +exports[`random > 42 > alpha > withLength 1`] = `"juyet"`; -exports[`random > seed: 42 > locale() 1`] = `"es_MX"`; +exports[`random > 42 > alphaNumeric > noArgs 1`] = `"d"`; -exports[`random > seed: 42 > numeric() 1`] = `"4"`; +exports[`random > 42 > alphaNumeric > withLength 1`] = `"dsy6q"`; -exports[`random > seed: 42 > word() 1`] = `"extend"`; +exports[`random > 42 > locale 1`] = `"es_MX"`; -exports[`random > seed: 42 > words() 1`] = `"mobile Fish"`; +exports[`random > 42 > numeric > noArgs 1`] = `"4"`; -exports[`random > seed: 1211 > alpha() 1`] = `"y"`; +exports[`random > 42 > numeric > withLength 1`] = `"47917"`; -exports[`random > seed: 1211 > alphaNumeric() 1`] = `"x"`; +exports[`random > 42 > word 1`] = `"extend"`; -exports[`random > seed: 1211 > locale() 1`] = `"ur"`; +exports[`random > 42 > words > noArgs 1`] = `"mobile Fish"`; -exports[`random > seed: 1211 > numeric() 1`] = `"9"`; +exports[`random > 42 > words > withLength 1`] = `"extend Directives application Home Dam"`; -exports[`random > seed: 1211 > word() 1`] = `"Division"`; +exports[`random > 1211 > alpha > noArgs 1`] = `"y"`; -exports[`random > seed: 1211 > words() 1`] = `"Turnpike Frozen Handcrafted"`; +exports[`random > 1211 > alpha > withLength 1`] = `"ylxuf"`; -exports[`random > seed: 1337 > alpha() 1`] = `"g"`; +exports[`random > 1211 > alphaNumeric > noArgs 1`] = `"x"`; -exports[`random > seed: 1337 > alphaNumeric() 1`] = `"9"`; +exports[`random > 1211 > alphaNumeric > withLength 1`] = `"xgws8"`; -exports[`random > seed: 1337 > locale() 1`] = `"en_GH"`; +exports[`random > 1211 > locale 1`] = `"ur"`; -exports[`random > seed: 1337 > numeric() 1`] = `"3"`; +exports[`random > 1211 > numeric > noArgs 1`] = `"9"`; -exports[`random > seed: 1337 > word() 1`] = `"leading"`; +exports[`random > 1211 > numeric > withLength 1`] = `"94872"`; -exports[`random > seed: 1337 > words() 1`] = `"Delaware"`; +exports[`random > 1211 > word 1`] = `"Division"`; + +exports[`random > 1211 > words > noArgs 1`] = `"Turnpike Frozen Handcrafted"`; + +exports[`random > 1211 > words > withLength 1`] = `"Division Forward Supervisor Peso ivory"`; + +exports[`random > 1337 > alpha > noArgs 1`] = `"g"`; + +exports[`random > 1337 > alpha > withLength 1`] = `"goefh"`; + +exports[`random > 1337 > alphaNumeric > noArgs 1`] = `"9"`; + +exports[`random > 1337 > alphaNumeric > withLength 1`] = `"9k57a"`; + +exports[`random > 1337 > locale 1`] = `"en_GH"`; + +exports[`random > 1337 > numeric > noArgs 1`] = `"3"`; + +exports[`random > 1337 > numeric > withLength 1`] = `"35122"`; + +exports[`random > 1337 > word 1`] = `"leading"`; + +exports[`random > 1337 > words > noArgs 1`] = `"Delaware"`; + +exports[`random > 1337 > words > withLength 1`] = `"leading black Kiribati Garden Indiana"`; diff --git a/test/__snapshots__/science.spec.ts.snap b/test/__snapshots__/science.spec.ts.snap index bc7b0586044..b8350a247f5 100644 --- a/test/__snapshots__/science.spec.ts.snap +++ b/test/__snapshots__/science.spec.ts.snap @@ -1,6 +1,6 @@ // Vitest Snapshot v1 -exports[`science > seed: 42 > chemicalElement() 1`] = ` +exports[`science > 42 > chemicalElement 1`] = ` { "atomicNumber": 45, "name": "Rhodium", @@ -8,14 +8,14 @@ exports[`science > seed: 42 > chemicalElement() 1`] = ` } `; -exports[`science > seed: 42 > unit() 1`] = ` +exports[`science > 42 > unit 1`] = ` { "name": "hertz", "symbol": "Hz", } `; -exports[`science > seed: 1211 > chemicalElement() 1`] = ` +exports[`science > 1211 > chemicalElement 1`] = ` { "atomicNumber": 110, "name": "Darmstadtium", @@ -23,14 +23,14 @@ exports[`science > seed: 1211 > chemicalElement() 1`] = ` } `; -exports[`science > seed: 1211 > unit() 1`] = ` +exports[`science > 1211 > unit 1`] = ` { "name": "gray", "symbol": "Gy", } `; -exports[`science > seed: 1337 > chemicalElement() 1`] = ` +exports[`science > 1337 > chemicalElement 1`] = ` { "atomicNumber": 31, "name": "Gallium", @@ -38,7 +38,7 @@ exports[`science > seed: 1337 > chemicalElement() 1`] = ` } `; -exports[`science > seed: 1337 > unit() 1`] = ` +exports[`science > 1337 > unit 1`] = ` { "name": "candela", "symbol": "cd", diff --git a/test/__snapshots__/system.spec.ts.snap b/test/__snapshots__/system.spec.ts.snap index 3ed44caaa1a..eb08bcc75e8 100644 --- a/test/__snapshots__/system.spec.ts.snap +++ b/test/__snapshots__/system.spec.ts.snap @@ -1,5 +1,83 @@ // Vitest Snapshot v1 +exports[`system > 42 > commonFileExt 1`] = `"png"`; + +exports[`system > 42 > commonFileName > noArgs 1`] = `"mobile_fish.mpe"`; + +exports[`system > 42 > commonFileName > with extension 1`] = `"mobile_fish.ext"`; + +exports[`system > 42 > commonFileType 1`] = `"audio"`; + +exports[`system > 42 > directoryPath 1`] = `"/opt/bin"`; + +exports[`system > 42 > fileExt > noArgs 1`] = `"lrm"`; + +exports[`system > 42 > fileExt > with mimeType 1`] = `"json"`; + +exports[`system > 42 > fileName > noArgs 1`] = `"mobile_fish.jxsc"`; + +exports[`system > 42 > fileName > with extensionCount 1`] = `"mobile_fish.jxsc.jardiff"`; + +exports[`system > 42 > filePath 1`] = `"/opt/bin/directives_application_home.ptid"`; + +exports[`system > 42 > fileType 1`] = `"image"`; + +exports[`system > 42 > mimeType 1`] = `"application/vnd.ibm.rights-management"`; + +exports[`system > 42 > semver 1`] = `"3.7.9"`; + +exports[`system > 1211 > commonFileExt 1`] = `"htm"`; + +exports[`system > 1211 > commonFileName > noArgs 1`] = `"turnpike_frozen_handcrafted.mp4v"`; + +exports[`system > 1211 > commonFileName > with extension 1`] = `"turnpike_frozen_handcrafted.ext"`; + +exports[`system > 1211 > commonFileType 1`] = `"application"`; + +exports[`system > 1211 > directoryPath 1`] = `"/var/log"`; + +exports[`system > 1211 > fileExt > noArgs 1`] = `"dic"`; + +exports[`system > 1211 > fileExt > with mimeType 1`] = `"map"`; + +exports[`system > 1211 > fileName > noArgs 1`] = `"turnpike_frozen_handcrafted.heifs"`; + +exports[`system > 1211 > fileName > with extensionCount 1`] = `"turnpike_frozen_handcrafted.heifs.oth"`; + +exports[`system > 1211 > filePath 1`] = `"/var/log/forward_supervisor.z2"`; + +exports[`system > 1211 > fileType 1`] = `"x-shader"`; + +exports[`system > 1211 > mimeType 1`] = `"text/vnd.dmclientscript"`; + +exports[`system > 1211 > semver 1`] = `"9.4.8"`; + +exports[`system > 1337 > commonFileExt 1`] = `"wav"`; + +exports[`system > 1337 > commonFileName > noArgs 1`] = `"delaware.mp2"`; + +exports[`system > 1337 > commonFileName > with extension 1`] = `"delaware.ext"`; + +exports[`system > 1337 > commonFileType 1`] = `"audio"`; + +exports[`system > 1337 > directoryPath 1`] = `"/Library"`; + +exports[`system > 1337 > fileExt > noArgs 1`] = `"oa3"`; + +exports[`system > 1337 > fileExt > with mimeType 1`] = `"json"`; + +exports[`system > 1337 > fileName > noArgs 1`] = `"delaware.cmc"`; + +exports[`system > 1337 > fileName > with extensionCount 1`] = `"delaware.cmc.kml"`; + +exports[`system > 1337 > filePath 1`] = `"/Library/bike_interactive.link66"`; + +exports[`system > 1337 > fileType 1`] = `"font"`; + +exports[`system > 1337 > mimeType 1`] = `"application/vnd.chipnuts.karaoke-mmd"`; + +exports[`system > 1337 > semver 1`] = `"2.5.1"`; + exports[`system > seed: 42 > commonFileExt() 1`] = `"png"`; exports[`system > seed: 42 > commonFileName() 1`] = `"mobile_fish.mpe"`; diff --git a/test/__snapshots__/vehicle.spec.ts.snap b/test/__snapshots__/vehicle.spec.ts.snap index a9d7599d591..96ae881355c 100644 --- a/test/__snapshots__/vehicle.spec.ts.snap +++ b/test/__snapshots__/vehicle.spec.ts.snap @@ -1,55 +1,55 @@ // Vitest Snapshot v1 -exports[`vehicle > seed: 42 > bicycle() 1`] = `"Fitness Bicycle"`; +exports[`vehicle > 42 > bicycle 1`] = `"Fitness Bicycle"`; -exports[`vehicle > seed: 42 > color() 1`] = `"grey"`; +exports[`vehicle > 42 > color 1`] = `"grey"`; -exports[`vehicle > seed: 42 > fuel() 1`] = `"Electric"`; +exports[`vehicle > 42 > fuel 1`] = `"Electric"`; -exports[`vehicle > seed: 42 > manufacturer() 1`] = `"Ford"`; +exports[`vehicle > 42 > manufacturer 1`] = `"Ford"`; -exports[`vehicle > seed: 42 > model() 1`] = `"Alpine"`; +exports[`vehicle > 42 > model 1`] = `"Alpine"`; -exports[`vehicle > seed: 42 > type() 1`] = `"Extended Cab Pickup"`; +exports[`vehicle > 42 > type 1`] = `"Extended Cab Pickup"`; -exports[`vehicle > seed: 42 > vehicle() 1`] = `"Ford Jetta"`; +exports[`vehicle > 42 > vehicle 1`] = `"Ford Jetta"`; -exports[`vehicle > seed: 42 > vin() 1`] = `"CTY6RSKK5ED315227"`; +exports[`vehicle > 42 > vin 1`] = `"CTY6RSKK5ED315227"`; -exports[`vehicle > seed: 42 > vrm() 1`] = `"JU91TUP"`; +exports[`vehicle > 42 > vrm 1`] = `"JU91TUP"`; -exports[`vehicle > seed: 1211 > bicycle() 1`] = `"Triathlon/Time Trial Bicycle"`; +exports[`vehicle > 1211 > bicycle 1`] = `"Triathlon/Time Trial Bicycle"`; -exports[`vehicle > seed: 1211 > color() 1`] = `"azure"`; +exports[`vehicle > 1211 > color 1`] = `"azure"`; -exports[`vehicle > seed: 1211 > fuel() 1`] = `"Hybrid"`; +exports[`vehicle > 1211 > fuel 1`] = `"Hybrid"`; -exports[`vehicle > seed: 1211 > manufacturer() 1`] = `"Toyota"`; +exports[`vehicle > 1211 > manufacturer 1`] = `"Toyota"`; -exports[`vehicle > seed: 1211 > model() 1`] = `"2"`; +exports[`vehicle > 1211 > model 1`] = `"2"`; -exports[`vehicle > seed: 1211 > type() 1`] = `"Wagon"`; +exports[`vehicle > 1211 > type 1`] = `"Wagon"`; -exports[`vehicle > seed: 1211 > vehicle() 1`] = `"Toyota Durango"`; +exports[`vehicle > 1211 > vehicle 1`] = `"Toyota Durango"`; -exports[`vehicle > seed: 1211 > vin() 1`] = `"XFWS74Z1N5S678767"`; +exports[`vehicle > 1211 > vin 1`] = `"XFWS74Z1N5S678767"`; -exports[`vehicle > seed: 1211 > vrm() 1`] = `"YL87FDZ"`; +exports[`vehicle > 1211 > vrm 1`] = `"YL87FDZ"`; -exports[`vehicle > seed: 1337 > bicycle() 1`] = `"Cyclocross Bicycle"`; +exports[`vehicle > 1337 > bicycle 1`] = `"Cyclocross Bicycle"`; -exports[`vehicle > seed: 1337 > color() 1`] = `"black"`; +exports[`vehicle > 1337 > color 1`] = `"black"`; -exports[`vehicle > seed: 1337 > fuel() 1`] = `"Electric"`; +exports[`vehicle > 1337 > fuel 1`] = `"Electric"`; -exports[`vehicle > seed: 1337 > manufacturer() 1`] = `"Dodge"`; +exports[`vehicle > 1337 > manufacturer 1`] = `"Dodge"`; -exports[`vehicle > seed: 1337 > model() 1`] = `"Colorado"`; +exports[`vehicle > 1337 > model 1`] = `"Colorado"`; -exports[`vehicle > seed: 1337 > type() 1`] = `"Coupe"`; +exports[`vehicle > 1337 > type 1`] = `"Coupe"`; -exports[`vehicle > seed: 1337 > vehicle() 1`] = `"Dodge Model 3"`; +exports[`vehicle > 1337 > vehicle 1`] = `"Dodge Model 3"`; -exports[`vehicle > seed: 1337 > vin() 1`] = `"8J579HF1A7MK33574"`; +exports[`vehicle > 1337 > vin 1`] = `"8J579HF1A7MK33574"`; -exports[`vehicle > seed: 1337 > vrm() 1`] = `"GO12HOL"`; +exports[`vehicle > 1337 > vrm 1`] = `"GO12HOL"`; diff --git a/test/__snapshots__/word.spec.ts.snap b/test/__snapshots__/word.spec.ts.snap index 0b200ad5d14..76ca9d16375 100644 --- a/test/__snapshots__/word.spec.ts.snap +++ b/test/__snapshots__/word.spec.ts.snap @@ -1,127 +1,127 @@ // Vitest Snapshot v1 -exports[`word > seed: 42 > adjective() 1`] = `"harmonious"`; +exports[`word > 42 > adjective > noArgs 1`] = `"harmonious"`; -exports[`word > seed: 42 > adjective(10) 1`] = `"gregarious"`; +exports[`word > 42 > adjective > with length = 10 1`] = `"gregarious"`; -exports[`word > seed: 42 > adjective(20) 1`] = `"harmonious"`; +exports[`word > 42 > adjective > with length = 20 1`] = `"harmonious"`; -exports[`word > seed: 42 > adverb() 1`] = `"jealously"`; +exports[`word > 42 > adverb > noArgs 1`] = `"jealously"`; -exports[`word > seed: 42 > adverb(10) 1`] = `"generously"`; +exports[`word > 42 > adverb > with length = 10 1`] = `"generously"`; -exports[`word > seed: 42 > adverb(20) 1`] = `"jealously"`; +exports[`word > 42 > adverb > with length = 20 1`] = `"jealously"`; -exports[`word > seed: 42 > conjunction() 1`] = `"however"`; +exports[`word > 42 > conjunction > noArgs 1`] = `"however"`; -exports[`word > seed: 42 > conjunction(10) 1`] = `"as much as"`; +exports[`word > 42 > conjunction > with length = 10 1`] = `"as much as"`; -exports[`word > seed: 42 > conjunction(20) 1`] = `"however"`; +exports[`word > 42 > conjunction > with length = 20 1`] = `"however"`; -exports[`word > seed: 42 > interjection() 1`] = `"yahoo"`; +exports[`word > 42 > interjection > noArgs 1`] = `"yahoo"`; -exports[`word > seed: 42 > interjection(10) 1`] = `"yahoo"`; +exports[`word > 42 > interjection > with length = 10 1`] = `"yahoo"`; -exports[`word > seed: 42 > interjection(20) 1`] = `"yahoo"`; +exports[`word > 42 > interjection > with length = 20 1`] = `"yahoo"`; -exports[`word > seed: 42 > noun() 1`] = `"gale"`; +exports[`word > 42 > noun > noArgs 1`] = `"gale"`; -exports[`word > seed: 42 > noun(10) 1`] = `"exposition"`; +exports[`word > 42 > noun > with length = 10 1`] = `"exposition"`; -exports[`word > seed: 42 > noun(20) 1`] = `"gale"`; +exports[`word > 42 > noun > with length = 20 1`] = `"gale"`; -exports[`word > seed: 42 > preposition() 1`] = `"concerning"`; +exports[`word > 42 > preposition > noArgs 1`] = `"concerning"`; -exports[`word > seed: 42 > preposition(10) 1`] = `"throughout"`; +exports[`word > 42 > preposition > with length = 10 1`] = `"throughout"`; -exports[`word > seed: 42 > preposition(20) 1`] = `"concerning"`; +exports[`word > 42 > preposition > with length = 20 1`] = `"concerning"`; -exports[`word > seed: 42 > verb() 1`] = `"function"`; +exports[`word > 42 > verb > noArgs 1`] = `"function"`; -exports[`word > seed: 42 > verb(10) 1`] = `"exasperate"`; +exports[`word > 42 > verb > with length = 10 1`] = `"exasperate"`; -exports[`word > seed: 42 > verb(20) 1`] = `"function"`; +exports[`word > 42 > verb > with length = 20 1`] = `"function"`; -exports[`word > seed: 1211 > adjective() 1`] = `"verifiable"`; +exports[`word > 1211 > adjective > noArgs 1`] = `"verifiable"`; -exports[`word > seed: 1211 > adjective(10) 1`] = `"unfinished"`; +exports[`word > 1211 > adjective > with length = 10 1`] = `"unfinished"`; -exports[`word > seed: 1211 > adjective(20) 1`] = `"verifiable"`; +exports[`word > 1211 > adjective > with length = 20 1`] = `"verifiable"`; -exports[`word > seed: 1211 > adverb() 1`] = `"viciously"`; +exports[`word > 1211 > adverb > noArgs 1`] = `"viciously"`; -exports[`word > seed: 1211 > adverb(10) 1`] = `"unbearably"`; +exports[`word > 1211 > adverb > with length = 10 1`] = `"unbearably"`; -exports[`word > seed: 1211 > adverb(20) 1`] = `"viciously"`; +exports[`word > 1211 > adverb > with length = 20 1`] = `"viciously"`; -exports[`word > seed: 1211 > conjunction() 1`] = `"whereas"`; +exports[`word > 1211 > conjunction > noArgs 1`] = `"whereas"`; -exports[`word > seed: 1211 > conjunction(10) 1`] = `"as soon as"`; +exports[`word > 1211 > conjunction > with length = 10 1`] = `"as soon as"`; -exports[`word > seed: 1211 > conjunction(20) 1`] = `"whereas"`; +exports[`word > 1211 > conjunction > with length = 20 1`] = `"whereas"`; -exports[`word > seed: 1211 > interjection() 1`] = `"er"`; +exports[`word > 1211 > interjection > noArgs 1`] = `"er"`; -exports[`word > seed: 1211 > interjection(10) 1`] = `"er"`; +exports[`word > 1211 > interjection > with length = 10 1`] = `"er"`; -exports[`word > seed: 1211 > interjection(20) 1`] = `"er"`; +exports[`word > 1211 > interjection > with length = 20 1`] = `"er"`; -exports[`word > seed: 1211 > noun() 1`] = `"trick"`; +exports[`word > 1211 > noun > noArgs 1`] = `"trick"`; -exports[`word > seed: 1211 > noun(10) 1`] = `"trafficker"`; +exports[`word > 1211 > noun > with length = 10 1`] = `"trafficker"`; -exports[`word > seed: 1211 > noun(20) 1`] = `"trick"`; +exports[`word > 1211 > noun > with length = 20 1`] = `"trick"`; -exports[`word > seed: 1211 > preposition() 1`] = `"upon"`; +exports[`word > 1211 > preposition > noArgs 1`] = `"upon"`; -exports[`word > seed: 1211 > preposition(10) 1`] = `"underneath"`; +exports[`word > 1211 > preposition > with length = 10 1`] = `"underneath"`; -exports[`word > seed: 1211 > preposition(20) 1`] = `"upon"`; +exports[`word > 1211 > preposition > with length = 20 1`] = `"upon"`; -exports[`word > seed: 1211 > verb() 1`] = `"trick"`; +exports[`word > 1211 > verb > noArgs 1`] = `"trick"`; -exports[`word > seed: 1211 > verb(10) 1`] = `"trampoline"`; +exports[`word > 1211 > verb > with length = 10 1`] = `"trampoline"`; -exports[`word > seed: 1211 > verb(20) 1`] = `"trick"`; +exports[`word > 1211 > verb > with length = 20 1`] = `"trick"`; -exports[`word > seed: 1337 > adjective() 1`] = `"fabulous"`; +exports[`word > 1337 > adjective > noArgs 1`] = `"fabulous"`; -exports[`word > seed: 1337 > adjective(10) 1`] = `"enchanting"`; +exports[`word > 1337 > adjective > with length = 10 1`] = `"enchanting"`; -exports[`word > seed: 1337 > adjective(20) 1`] = `"fabulous"`; +exports[`word > 1337 > adjective > with length = 20 1`] = `"fabulous"`; -exports[`word > seed: 1337 > adverb() 1`] = `"frankly"`; +exports[`word > 1337 > adverb > noArgs 1`] = `"frankly"`; -exports[`word > seed: 1337 > adverb(10) 1`] = `"enormously"`; +exports[`word > 1337 > adverb > with length = 10 1`] = `"enormously"`; -exports[`word > seed: 1337 > adverb(20) 1`] = `"frankly"`; +exports[`word > 1337 > adverb > with length = 20 1`] = `"frankly"`; -exports[`word > seed: 1337 > conjunction() 1`] = `"even if"`; +exports[`word > 1337 > conjunction > noArgs 1`] = `"even if"`; -exports[`word > seed: 1337 > conjunction(10) 1`] = `"as long as"`; +exports[`word > 1337 > conjunction > with length = 10 1`] = `"as long as"`; -exports[`word > seed: 1337 > conjunction(20) 1`] = `"even if"`; +exports[`word > 1337 > conjunction > with length = 20 1`] = `"even if"`; -exports[`word > seed: 1337 > interjection() 1`] = `"ew"`; +exports[`word > 1337 > interjection > noArgs 1`] = `"ew"`; -exports[`word > seed: 1337 > interjection(10) 1`] = `"ew"`; +exports[`word > 1337 > interjection > with length = 10 1`] = `"ew"`; -exports[`word > seed: 1337 > interjection(20) 1`] = `"ew"`; +exports[`word > 1337 > interjection > with length = 20 1`] = `"ew"`; -exports[`word > seed: 1337 > noun() 1`] = `"digit"`; +exports[`word > 1337 > noun > noArgs 1`] = `"digit"`; -exports[`word > seed: 1337 > noun(10) 1`] = `"depressive"`; +exports[`word > 1337 > noun > with length = 10 1`] = `"depressive"`; -exports[`word > seed: 1337 > noun(20) 1`] = `"digit"`; +exports[`word > 1337 > noun > with length = 20 1`] = `"digit"`; -exports[`word > seed: 1337 > preposition() 1`] = `"barring"`; +exports[`word > 1337 > preposition > noArgs 1`] = `"barring"`; -exports[`word > seed: 1337 > preposition(10) 1`] = `"concerning"`; +exports[`word > 1337 > preposition > with length = 10 1`] = `"concerning"`; -exports[`word > seed: 1337 > preposition(20) 1`] = `"barring"`; +exports[`word > 1337 > preposition > with length = 20 1`] = `"barring"`; -exports[`word > seed: 1337 > verb() 1`] = `"dispense"`; +exports[`word > 1337 > verb > noArgs 1`] = `"dispense"`; -exports[`word > seed: 1337 > verb(10) 1`] = `"demoralize"`; +exports[`word > 1337 > verb > with length = 10 1`] = `"demoralize"`; -exports[`word > seed: 1337 > verb(20) 1`] = `"dispense"`; +exports[`word > 1337 > verb > with length = 20 1`] = `"dispense"`; diff --git a/test/address.spec.ts b/test/address.spec.ts index 76206b93f4d..3c358dd222b 100644 --- a/test/address.spec.ts +++ b/test/address.spec.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; import { times } from './support/times'; function degreesToRadians(degrees: number) { @@ -37,133 +37,71 @@ function haversine( const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'city', - 'cityPrefix', - 'citySuffix', - 'cityName', - 'streetName', - 'streetPrefix', - 'streetSuffix', - 'secondaryAddress', - 'county', - 'country', - 'countryCode', - 'state', - 'stateAbbr', - 'zipCode', - 'timeZone', -]; - describe('address', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.address[functionName](); - expect(actual).toMatchSnapshot(); - }); - } - - describe('streetAddress()', () => { - it('should return street name with a building number', () => { - faker.seed(seed); - - const address = faker.address.streetAddress(); - - expect(address).toMatchSnapshot(); - }); - - it('should return street name with a building number and a secondary address', () => { - faker.seed(seed); - - const address = faker.address.streetAddress(true); - - expect(address).toMatchSnapshot(); - }); - }); - - describe('direction()', () => { - it('returns random direction', () => { - faker.seed(seed); - - const direction = faker.address.direction(); - - expect(direction).toMatchSnapshot(); - }); - - it('should not return abbreviation when useAbbr is false', () => { - faker.seed(seed); - - const direction = faker.address.direction(false); - - expect(direction).toMatchSnapshot(); - }); - - it('returns abbreviation when useAbbr is true', () => { - faker.seed(seed); - - const direction = faker.address.direction(true); - - expect(direction).toMatchSnapshot(); - }); - }); - - describe('ordinalDirection()', () => { - it('returns random ordinal direction', () => { - faker.seed(seed); - - const ordinalDirection = faker.address.ordinalDirection(); + seededTests(faker, 'address', (t) => { + t.itEach('street', 'streetName', 'streetPrefix', 'streetSuffix'); - expect(ordinalDirection).toMatchSnapshot(); - }); + t.it('buildingNumber'); - it('returns abbreviation when useAbbr is true', () => { - faker.seed(seed); - - const ordinalDirection = faker.address.ordinalDirection(true); + t.it('secondaryAddress'); + t.describe('streetAddress', (t) => { + t.it('noArgs') + .it('with useFullAddress = true', true) + .it('with useFullAddress = false', false); + }); - expect(ordinalDirection).toMatchSnapshot(); - }); + t.it('cityName') + .it('cityPrefix') + .it('citySuffix') + .describe('city', (t) => { + t.it('noArgs').it('with given index', 1); }); - describe('cardinalDirection()', () => { - it('returns random cardinal direction', () => { - faker.seed(seed); - - const cardinalDirection = faker.address.cardinalDirection(); - - expect(cardinalDirection).toMatchSnapshot(); - }); - - it('returns abbreviation when useAbbr is true', () => { - faker.seed(seed); + t.it('county'); - const cardinalDirection = faker.address.cardinalDirection(true); + t.it('country').describe('countryCode', (t) => { + t.it('noArgs') + .it('with code = alpha-2', 'alpha-2') + .it('with code = alpha-3', 'alpha-3'); + }); - expect(cardinalDirection).toMatchSnapshot(); - }); - }); + t.describe('latitude', (t) => { + t.it('noArgs'); + }); + t.describe('longitude', (t) => { + t.it('noArgs'); + }); - describe('nearbyGPSCoordinate()', () => { - it('returns expected coordinates', () => { - faker.seed(seed); + t.describe('nearbyGPSCoordinate', (t) => { + t.it('noArgs').it('near origin', [0, 0]); + }); + t.it('state').it('stateAbbr'); + + t.it('timeZone'); + + t.describeEach( + 'direction', + 'cardinalDirection', + 'ordinalDirection' + )((t) => { + t.it('noArgs') + .it('with abbr = true', true) + .it('with abbr = false', false); + }); - // this input is required for all expected results for this function - const coordsInput: [number, number] = [0, 0]; - const coords = faker.address.nearbyGPSCoordinate(coordsInput); + t.describe('zipCode', (t) => { + t.it('noArgs').it('with format', '###-###'); + }); - expect(coords).toMatchSnapshot(); - }); - }); + t.describe('zipCodeByState', (t) => { + t.it('state', 'CA'); + t.it('state2', 'WA'); }); - } + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/animal.spec.ts b/test/animal.spec.ts index 4f3d2370ddb..b3ffe3eac14 100644 --- a/test/animal.spec.ts +++ b/test/animal.spec.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -19,26 +19,16 @@ const functionNames = [ 'rabbit', 'snake', 'type', -]; +] as const; describe('animal', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.animal[functionName](); - - expect(actual).toMatchSnapshot(); - }); - } - }); - } + seededTests(faker, 'animal', (t) => { + t.itEach(...functionNames); + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/color.spec.ts b/test/color.spec.ts index a1b5dd9d905..591cedcbde0 100644 --- a/test/color.spec.ts +++ b/test/color.spec.ts @@ -1,42 +1,30 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; import { CSS_FUNCTIONS, CSS_SPACES } from '../src/modules/color'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'human', - 'space', - 'cssSupportedFunction', - 'cssSupportedSpace', - 'rgb', - 'hsl', - 'hwb', - 'cmyk', - 'lab', - 'lch', - 'colorByCSSColorSpace', -]; - describe('color', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.color[functionName](); - - expect(actual).toMatchSnapshot(); - }); - } - }); - } + seededTests(faker, 'color', (t) => { + t.itEach( + 'human', + 'space', + 'cssSupportedFunction', + 'cssSupportedSpace', + 'rgb', + 'hsl', + 'hwb', + 'cmyk', + 'lab', + 'lch', + 'colorByCSSColorSpace' + ); + }); // Create and log-back the seed for debug purposes faker.seed(Math.ceil(Math.random() * 1_000_000_000)); diff --git a/test/commerce.spec.ts b/test/commerce.spec.ts index bbd33ff0152..f4367b1b4c2 100644 --- a/test/commerce.spec.ts +++ b/test/commerce.spec.ts @@ -1,38 +1,34 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'color', - 'department', - 'productName', - 'price', - 'productAdjective', - 'productMaterial', - 'product', - 'productDescription', -]; - describe('commerce', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.commerce[functionName](); - - expect(actual).toMatchSnapshot(); - }); - } + seededTests(faker, 'commerce', (t) => { + t.itEach( + 'color', + 'department', + 'productName', + 'productAdjective', + 'productMaterial', + 'product', + 'productDescription' + ); + + t.describe('price', (t) => { + t.it('noArgs') + .it('with min', 50) + .it('with max', undefined, 100) + .it('with min and max', 50, 100) + .it('with min and max and decimals', 50, 100, 4) + .it('with min and max and decimals and symbol', 50, 100, 4, '$'); }); - } + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/company.spec.ts b/test/company.spec.ts index b0f207923ee..f1a68423e8b 100644 --- a/test/company.spec.ts +++ b/test/company.spec.ts @@ -1,41 +1,34 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'suffixes', - 'companyName', - 'companySuffix', - 'catchPhrase', - 'bs', - 'catchPhraseAdjective', - 'catchPhraseDescriptor', - 'catchPhraseNoun', - 'bsAdjective', - 'bsBuzz', - 'bsNoun', -]; - describe('company', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.company[functionName](); - - expect(actual).toMatchSnapshot(); - }); - } + seededTests(faker, 'company', (t) => { + t.itEach( + 'suffixes', + 'companySuffix', + 'catchPhrase', + 'bs', + 'catchPhraseAdjective', + 'catchPhraseDescriptor', + 'catchPhraseNoun', + 'bsAdjective', + 'bsBuzz', + 'bsNoun' + ); + t.describeEach( + 'companyName', + 'name' + )((t) => { + t.it('noArgs').it('with index'); }); - } + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() @@ -50,6 +43,40 @@ describe('company', () => { }); }); + describe('name()', () => { + it('should return a random company name', () => { + const actual = faker.company.name(); + + expect(actual).toBeTruthy(); + expect(actual).toBeTypeOf('string'); + }); + + it('should return a random company name with format 0', () => { + const actual = faker.company.name(0); + + expect(actual).toBeTruthy(); + expect(actual).toBeTypeOf('string'); + expect(actual).includes(' '); + }); + + it('should return a random company name with format 1', () => { + const actual = faker.company.name(1); + + expect(actual).toBeTruthy(); + expect(actual).toBeTypeOf('string'); + expect(actual).includes(' - '); + }); + + it('should return a random company name with format 2', () => { + const actual = faker.company.name(2); + + expect(actual).toBeTruthy(); + expect(actual).toBeTypeOf('string'); + expect(actual).includes(', '); + expect(actual).includes(' and '); + }); + }); + describe('companyName()', () => { it('should return a random company name', () => { const actual = faker.company.companyName(); diff --git a/test/database.spec.ts b/test/database.spec.ts index d9f538caab2..a8cf6f4d42a 100644 --- a/test/database.spec.ts +++ b/test/database.spec.ts @@ -1,35 +1,17 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'column', - 'type', - 'collation', - 'engine', - 'mongodbObjectId', -]; - describe('database', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.database[functionName](); - - expect(actual).toMatchSnapshot(); - }); - } - }); - } + seededTests(faker, 'database', (t) => { + t.itEach('column', 'type', 'collation', 'engine', 'mongodbObjectId'); + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/datatype.spec.ts b/test/datatype.spec.ts index 04da02d2826..60650ed6983 100644 --- a/test/datatype.spec.ts +++ b/test/datatype.spec.ts @@ -1,220 +1,77 @@ import { describe, expect, it } from 'vitest'; -import { faker, FakerError } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { faker } from '../src'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 25; -const functionNames = [ - 'number', - 'float', - 'datetime', - 'string', - 'uuid', - 'boolean', - 'hexadecimal', - 'json', - 'array', - 'bigInt', -]; - describe('datatype', () => { - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.datatype[functionName](); - expect(actual).toMatchSnapshot(); - }); - } - - describe('number', () => { - it('should return a deterministic value for given number', () => { - faker.seed(seed); - - for (let i = 0; i < 5; i++) { - const actual = faker.datatype.number(6); - expect(actual).toMatchSnapshot(); - } - }); - - it('should return a deterministic value for given min', () => { - faker.seed(seed); - - const actual = faker.datatype.number({ min: -42 }); - expect(actual).toMatchSnapshot(); - }); - - it('should return a deterministic value for given min and max', () => { - faker.seed(seed); - - const actual = faker.datatype.number({ min: -42, max: 69 }); - expect(actual).toMatchSnapshot(); - }); - - it('should return a deterministic value for given max', () => { - faker.seed(seed); - - const actual = faker.datatype.number({ max: 69 }); - expect(actual).toMatchSnapshot(); - }); - - it('should return a deterministic value for given min, max and precision', () => { - faker.seed(seed); - - const actual = faker.datatype.number({ - min: -42, - max: 69, - precision: 0.01, - }); - expect(actual).toMatchSnapshot(); - }); - - it('should throw when min > max', () => { - const min = 10; - const max = 9; - - faker.seed(seed); - - expect(() => { - faker.datatype.number({ min, max }); - }).toThrowError(`Max ${max} should be greater than min ${min}.`); - }); - }); - - describe('float', () => { - it('should return a deterministic value for given number', () => { - faker.seed(seed); - - for (let i = 0; i < 5; i++) { - const actual = faker.datatype.float(6); - expect(actual).toMatchSnapshot(); - } - }); - - it('should return a deterministic value for given min', () => { - faker.seed(seed); - - const actual = faker.datatype.float({ min: -42 }); - expect(actual).toMatchSnapshot(); - }); - - it('should return a deterministic value for given min and max', () => { - faker.seed(seed); - - const actual = faker.datatype.float({ min: -42, max: 69 }); - expect(actual).toMatchSnapshot(); - }); - - it('should return a deterministic value for given max', () => { - faker.seed(seed); - - const actual = faker.datatype.float({ max: 69 }); - expect(actual).toMatchSnapshot(); - }); - - it('should return a deterministic value for given min, max and precision', () => { - faker.seed(seed); - - const actual = faker.datatype.float({ - min: -42, - max: 69, - precision: 0.0001, - }); - expect(actual).toMatchSnapshot(); + seededTests(faker, 'datatype', (t) => { + t.describe('number', (t) => { + t.it('noArgs') + .itRepeated('repeated', 5, 6) + .it('with min', { min: -42 }) + .it('with max', { max: 69 }) + .it('with min and max', { + min: -42, + max: 69, + }) + .it('with min, max and precision', { + min: -42, + max: 69, + precision: 0.01, }); - }); - - describe('datetime', () => { - it('should return a deterministic date when given a number', () => { - faker.seed(seed); - - const actual = faker.datatype.datetime( - Date.parse('2001-04-03T23:21:10.773Z') - ); - expect(actual).toMatchSnapshot(); - }); - - it('should return a deterministic date when given a min date', () => { - faker.seed(seed); - - const actual = faker.datatype.datetime({ - min: Date.parse('1622-05-23T13:45:08.843Z'), - }); - expect(actual).toMatchSnapshot(); - }); - - it('should return a deterministic date when given a max date', () => { - faker.seed(seed); - - const actual = faker.datatype.datetime({ - max: Date.parse('2002-01-29T19:47:52.605Z'), - }); - expect(actual).toMatchSnapshot(); - }); - - it('should return a deterministic date when given a min and max date', () => { - faker.seed(seed); - - const actual = faker.datatype.datetime({ - min: Date.parse('1622-05-23T13:45:08.843Z'), - max: Date.parse('1802-01-29T19:47:52.605Z'), - }); - expect(actual).toMatchSnapshot(); - }); - }); - - describe('string', () => { - it('should return a deterministic string of given length', () => { - faker.seed(seed); + }); - const actual = faker.datatype.string(42); - expect(actual).toMatchSnapshot(); + t.describe('float', (t) => { + t.it('noArgs') + .itRepeated('repeated', 6) + .it('with min', { min: -42 }) + .it('with max', { max: 69 }) + .it('with min and max', { min: -42, max: 69 }) + .it('with min, max and precision', { + min: -42, + max: 69, + precision: 0.0001, }); - }); - - describe('hexadecimal', () => { - it('should return a deterministic hex of given length', () => { - faker.seed(seed); + }); - const actual = faker.datatype.hexadecimal(42); - expect(actual).toMatchSnapshot(); + t.describe('datetime', (t) => { + t.it('noArgs') + .it('with given number', Date.parse('2001-04-03T23:21:10.773Z')) + .it('with min', { + min: Date.parse('1622-05-23T13:45:08.843Z'), + }) + .it('with max', { + max: Date.parse('2002-01-29T19:47:52.605Z'), + }) + .it('with min and max', { + min: Date.parse('1622-05-23T13:45:08.843Z'), + max: Date.parse('1802-01-29T19:47:52.605Z'), }); - }); + }); - describe('array', () => { - it('should return a deterministic array of given length', () => { - faker.seed(seed); + t.describe('string', (t) => { + t.it('noArgs').it('with length', 42); + }); - const actual = faker.datatype.array(4); - expect(actual).toMatchSnapshot(); - }); - }); + t.itRepeated('uuid', 5); - describe('bigInt', () => { - it('should return a deterministic bigInt of given value', () => { - faker.seed(seed); + t.itRepeated('boolean', 5); - const actual = faker.datatype.bigInt(42); - expect(actual).toMatchSnapshot(); - }); + t.describe('hexadecimal', (t) => { + t.it('noArgs').it('with length', 42); + }); - it('should throw when min > max', () => { - const min = 10000n; - const max = 999n; + t.it('json'); - faker.seed(seed); + t.describe('array', (t) => { + t.it('noArgs').it('with length', 4); + }); - expect(() => { - faker.datatype.bigInt({ min, max }); - }).toThrowError( - new FakerError(`Max ${max} should be larger then min ${min}.`) - ); - }); - }); + t.describe('bigInt', (t) => { + t.it('noArgs').it('with value', 42); }); - } + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() @@ -330,6 +187,15 @@ describe('datatype', () => { expect(() => faker.datatype.number(input)).not.toThrow(); }); + + it('should throw when min > max', () => { + const min = 10; + const max = 9; + + expect(() => { + faker.datatype.number({ min, max }); + }).toThrowError(`Max ${max} should be greater than min ${min}.`); + }); }); describe('float', () => { diff --git a/test/date.spec.ts b/test/date.spec.ts index f6f64dbe839..57beebbe242 100644 --- a/test/date.spec.ts +++ b/test/date.spec.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const converterMap = [ (d: Date) => d, @@ -9,345 +9,111 @@ const converterMap = [ ]; const NON_SEEDED_BASED_RUN = 5; +const refDate = '2021-02-21T17:09:15.711Z'; describe('date', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - describe('past()', () => { - it('should return deterministic past value on given refDate of type string', () => { - faker.seed(seed); - - const actual = faker.date.past(undefined, '2021-02-21T17:09:15.711Z'); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic past value on given refDate of type date', () => { - faker.seed(seed); - - const actual = faker.date.past( - undefined, - new Date('2021-02-21T17:09:15.711Z') - ); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic past value on given years 10 and refDate of type string', () => { - faker.seed(seed); - - const actual = faker.date.past(10, '2021-02-21T17:09:15.711Z'); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic past value on given years 10 and refDate of type date', () => { - faker.seed(seed); - - const actual = faker.date.past( - 10, - new Date('2021-02-21T17:09:15.711Z') - ); - - expect(actual).toMatchSnapshot(); - }); - }); - - describe('future()', () => { - it('should return deterministic future value on given refDate of type string', () => { - faker.seed(seed); - - const actual = faker.date.future( - undefined, - '2021-02-21T17:09:15.711Z' - ); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic future value on given refDate of type date', () => { - faker.seed(seed); - - const actual = faker.date.future( - undefined, - new Date('2021-02-21T17:09:15.711Z') - ); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic future value on given years 10 and refDate of type string', () => { - faker.seed(seed); - - const actual = faker.date.future(10, '2021-02-21T17:09:15.711Z'); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic future value on given years 10 and refDate of type date', () => { - faker.seed(seed); - - const actual = faker.date.future( - 10, - new Date('2021-02-21T17:09:15.711Z') - ); - - expect(actual).toMatchSnapshot(); - }); - }); - - describe('between()', () => { - it('should return deterministic value between given string dates', () => { - faker.seed(seed); - - const actual = faker.date.between( - '2021-02-21T17:09:15.711Z', - '2021-04-21T17:11:17.711Z' - ); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value between given real dates', () => { - faker.seed(seed); - - const actual = faker.date.between( - new Date('2021-02-21T17:09:15.711Z'), - new Date('2021-04-21T17:11:17.711Z') - ); - - expect(actual).toMatchSnapshot(); - }); - }); - - describe('betweens()', () => { - it('should return deterministic value betweens given string dates', () => { - faker.seed(seed); - - const actual = faker.date.betweens( - '2021-02-21T17:09:15.711Z', - '2021-04-21T17:11:17.711Z' - ); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value betweens given dates', () => { - faker.seed(seed); - - const actual = faker.date.betweens( - new Date('2021-02-21T17:09:15.711Z'), - new Date('2021-04-21T17:11:17.711Z') - ); - - expect(actual).toMatchSnapshot(); - }); - }); - - describe('recent()', () => { - it('should return deterministic value recent to given refDate of type string', () => { - faker.seed(seed); - - const actual = faker.date.recent( - undefined, - '2021-02-21T17:11:17.711Z' - ); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value recent to given refDate of type date', () => { - faker.seed(seed); - - const actual = faker.date.recent( - undefined, - new Date('2021-02-21T17:11:17.711Z') - ); - - expect(actual).toMatchSnapshot(); - }); - }); - - describe('soon()', () => { - it('should return deterministic value soon to given refDate of type string', () => { - faker.seed(seed); - - const actual = faker.date.soon(undefined, '2021-03-13T14:16:17.151Z'); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value soon to given refDate of type date', () => { - faker.seed(seed); - - const actual = faker.date.soon( - undefined, - new Date('2021-03-13T14:16:17.151Z') - ); - - expect(actual).toMatchSnapshot(); - }); - }); - - describe('month()', () => { - it('should return deterministic value month by default', () => { - faker.seed(seed); - - const actual = faker.date.month(); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value month with abbr true', () => { - faker.seed(seed); - - const actual = faker.date.month({ abbr: true }); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value month with context true', () => { - faker.seed(seed); - - const actual = faker.date.month({ context: true }); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value month with abbr and context true', () => { - faker.seed(seed); - - const actual = faker.date.month({ abbr: true, context: true }); - - expect(actual).toMatchSnapshot(); - }); - }); - - describe('weekday()', () => { - it('should return deterministic value weekday by default', () => { - faker.seed(seed); - - const actual = faker.date.weekday(); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value weekday with abbr true', () => { - faker.seed(seed); - - const actual = faker.date.weekday({ abbr: true }); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value weekday with context true', () => { - faker.seed(seed); - - const actual = faker.date.weekday({ context: true }); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value weekday with abbr and context true', () => { - faker.seed(seed); - - const actual = faker.date.weekday({ abbr: true, context: true }); - - expect(actual).toMatchSnapshot(); - }); - }); - - describe('birthdate()', () => { - it('should return deterministic value birthdate by default', () => { - faker.seed(seed); - - const actual = faker.date.birthdate({ - refDate: '2000-02-09T20:54:02.397Z', - }); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value birthdate by age mode ', () => { - faker.seed(seed); - - const actual = faker.date.birthdate({ - mode: 'age', - refDate: '2000-02-09T20:54:02.397Z', - }); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value birthdate by age range', () => { - faker.seed(seed); - - const actual = faker.date.birthdate({ - min: 20, - max: 80, - mode: 'age', - refDate: '2000-02-09T20:54:02.397Z', - }); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value birthdate by age', () => { - faker.seed(seed); - - const actual = faker.date.birthdate({ - min: 40, - max: 40, - mode: 'age', - refDate: '2000-02-09T20:54:02.397Z', - }); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value birthdate by year mode', () => { - faker.seed(seed); - - const actual = faker.date.birthdate({ - mode: 'year', - refDate: '2000-02-09T20:54:02.397Z', - }); - - expect(actual).toMatchSnapshot(); - }); - - it('should return deterministic value birthdate by year range', () => { - faker.seed(seed); - - const actual = faker.date.birthdate({ - min: 1900, - max: 2000, - mode: 'year', - refDate: '2000-02-09T20:54:02.397Z', - }); + seededTests(faker, 'date', (t) => { + t.describeEach( + 'past', + 'recent', + 'soon', + 'future' + )((t) => { + t.it('with only string refDate', undefined, refDate) + .it('with only Date refDate', undefined, new Date(refDate)) + .it('with value', 10, refDate); + }); - expect(actual).toMatchSnapshot(); + t.describeEach( + 'weekday', + 'month' + )((t) => { + t.it('noArgs') + .it('with abbr = true', { abbr: true }) + .it('with context = true', { context: true }) + .it('with abbr = true and context = true', { + abbr: true, + context: true, }); + }); - it('should return deterministic value birthdate by year', () => { - faker.seed(seed); + t.describe('between', (t) => { + t.it( + 'with string dates', + '2021-02-21T17:09:15.711Z', + '2021-04-21T17:11:17.711Z' + ).it( + 'with Date dates', + new Date('2021-02-21T17:09:15.711Z'), + new Date('2021-04-21T17:11:17.711Z') + ); + }); - const actual = faker.date.birthdate({ - min: 2000, - max: 2000, - mode: 'year', - refDate: '2000-02-09T20:54:02.397Z', - }); + t.describe('betweens', (t) => { + t.it( + 'with string dates', + '2021-02-21T17:09:15.711Z', + '2021-04-21T17:11:17.711Z' + ) + .it( + 'with Date dates', + new Date('2021-02-21T17:09:15.711Z'), + new Date('2021-04-21T17:11:17.711Z') + ) + .it( + 'with string dates and count', + '2021-02-21T17:09:15.711Z', + '2021-04-21T17:11:17.711Z', + 5 + ) + .it( + 'with Date dates and count', + new Date('2021-02-21T17:09:15.711Z'), + new Date('2021-04-21T17:11:17.711Z'), + 5 + ); + }); - expect(actual).toMatchSnapshot(); + t.describe('birthdate', (t) => { + t.it('with only refDate', { refDate }) + .it('with age mode and refDate', { + mode: 'age', + refDate, + }) + .it('with age and refDate', { + min: 40, + max: 40, + mode: 'age', + refDate, + }) + .it('with age range and refDate', { + min: 20, + max: 80, + mode: 'age', + refDate, + }) + .it('with year mode and refDate', { + mode: 'year', + refDate, + }) + .it('with year and refDate', { + min: 2000, + max: 2000, + mode: 'age', + refDate, + }) + .it('with year range and refDate', { + min: 1900, + max: 2000, + mode: 'age', + refDate, }); - }); }); - } + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/finance.spec.ts b/test/finance.spec.ts index 83f997815c1..d37a4f1d842 100644 --- a/test/finance.spec.ts +++ b/test/finance.spec.ts @@ -3,28 +3,7 @@ import { faker } from '../src'; import { FakerError } from '../src/errors/faker-error'; import ibanLib from '../src/modules/finance/iban'; import { luhnCheck } from '../src/modules/helpers/luhn-check'; -import { seededRuns } from './support/seededRuns'; - -const functionNames = [ - 'account', - 'accountName', - 'routingNumber', - 'mask', - 'amount', - 'transactionType', - 'currencyCode', - 'currencyName', - 'currencySymbol', - 'bitcoinAddress', - 'litecoinAddress', - 'creditCardNumber', - 'creditCardCVV', - 'pin', - 'ethereumAddress', - 'iban', - 'bic', - 'transactionDescription', -]; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -33,19 +12,56 @@ describe('finance', () => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); + seededTests(faker, 'finance', (t) => { + t.itEach( + 'accountName', + 'routingNumber', + 'transactionType', + 'creditCardIssuer', + 'currencyCode', + 'currencyName', + 'currencySymbol', + 'bitcoinAddress', + 'litecoinAddress', + 'creditCardCVV', + 'ethereumAddress', + 'bic', + 'transactionDescription' + ); + + t.describeEach( + 'account', + 'pin' + )((t) => { + t.it('noArgs').it('with length', 10); + }); - const actual = faker.finance[functionName](); + t.describe('amount', (t) => { + t.it('noArgs') + .it('with min', 10) + .it('with max', undefined, 50) + .it('with dec', undefined, undefined, 5) + .it('with min and max and dec and symbol', 10, 50, 5, '$'); + }); - expect(actual).toMatchSnapshot(); - }); - } + t.describe('iban', (t) => { + t.it('noArgs') + .it('with formatted', true) + .it('with formatted and countryCode', true, 'DE'); }); - } + + t.describe('creditCardNumber', (t) => { + t.it('noArgs').it('with issuer', 'visa'); + }); + + t.describe('mask', (t) => { + t.it('noArgs') + .it('with length', 5) + .it('with parenthesis', undefined, true) + .it('with ellipsis', undefined, undefined, true) + .it('with length, parenthesis, and ellipsis', 5, true, true); + }); + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() @@ -468,11 +484,9 @@ describe('finance', () => { describe('bic()', () => { it('should return a random yet formally correct BIC number', () => { const bic = faker.finance.bic(); + const countryCodes = ibanLib.iso3166.join('|'); const expr = new RegExp( - `^[A-Z]{4}(${ibanLib.iso3166.join( - '|' - )})[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3})?\$`, - 'i' + `^[A-Z]{4}(${countryCodes})[A-Z0-9]{2}([A-Z0-9]{3})?\$` ); expect(bic).toBeTypeOf('string'); diff --git a/test/git.spec.ts b/test/git.spec.ts index 19c9c4ee249..c7349a700e9 100644 --- a/test/git.spec.ts +++ b/test/git.spec.ts @@ -1,42 +1,21 @@ import validator from 'validator'; import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'branch', - 'commitEntry', - 'commitMessage', - 'commitSha', - 'shortSha', -]; - describe('git', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - if (functionName === 'commitEntry') { - // The timestamp is not fixed, so we can't compare it. - it.todo(`${functionName}()`); - continue; - } - - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.git[functionName](); + seededTests(faker, 'git', (t) => { + t.itEach('branch', 'commitMessage', 'commitSha', 'shortSha'); - expect(actual).toMatchSnapshot(); - }); - } - }); - } + // The timestamp is not fixed, so we can't compare it + t.todo('commitEntry'); + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/hacker.spec.ts b/test/hacker.spec.ts index ca0e686ff53..a591602c5e5 100644 --- a/test/hacker.spec.ts +++ b/test/hacker.spec.ts @@ -1,36 +1,17 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'abbreviation', - 'adjective', - 'noun', - 'verb', - 'ingverb', - 'phrase', -]; - -describe('name', () => { +describe('hacker', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.hacker[functionName](); - - expect(actual).toMatchSnapshot(); - }); - } - }); - } + seededTests(faker, 'hacker', (t) => { + t.itEach('abbreviation', 'adjective', 'noun', 'verb', 'ingverb', 'phrase'); + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/helpers.spec.ts b/test/helpers.spec.ts index 497fb85b669..5da314dd5a8 100644 --- a/test/helpers.spec.ts +++ b/test/helpers.spec.ts @@ -1,40 +1,92 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; import { luhnCheck } from '../src/modules/helpers/luhn-check'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'slugify', - 'replaceSymbolWithNumber', - 'replaceSymbols', - 'replaceCreditCardSymbols', - 'repeatString', - 'regexpStyleStringParse', - 'shuffle', - 'uniqueArray', - 'mustache', -]; - describe('helpers', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); + seededTests(faker, 'helpers', (t) => { + t.describe('slugify', (t) => { + t.it('noArgs').it('some string', 'hello world'); + }); - const actual = faker.helpers[functionName](); + t.describe('replaceSymbolWithNumber', (t) => { + t.it('noArgs') + .it('only symbols', '!####') + .it('some string', '^1234567890ß´°!"§$%&/()=?`+#*,..-;:_'); + }); - expect(actual).toMatchSnapshot(); - }); - } + t.describe('replaceSymbols', (t) => { + t.it('noArgs') + .it('only symbols', '#?*#?*') + .it('some string', '^1234567890ß´°!"§$%&/()=?`+#*,..-;:_'); + }); + + t.describe('replaceCreditCardSymbols', (t) => { + t.it('noArgs') + .it('only symbols', '####-[4-9]-##!!-L') + .it('some string', '^1234567890ß´°!"§$%&/()=?`+#*,..-;:_L'); + }); + + t.describe('regexpStyleStringParse', (t) => { + t.it('noArgs') + .it('only symbols', '#{3}test[1-5]') + .it('some string', 'Hello !#{3}test[1-5]'); + }); + + t.describe('mustache', (t) => { + t.it('template with string', 'Hello {{name}}!', { name: 'John' }).it( + 'template with method', + 'Hello {{name}}!', + { name: () => 'John' } + ); + }); + + t.describe('repeatString', (t) => { + t.it('noArgs') + .it('with only text', 'Hello World!') + .it('with text and repetitions', 'Hello World! ', 3); + }); + + t.describe('arrayElement', (t) => { + t.it('noArgs').it('with array', 'Hello World!'.split('')); }); - } + + t.describe('arrayElements', (t) => { + t.it('noArgs') + .it('with array', 'Hello World!'.split('')) + .it('with array', 'Hello World!'.split(''), 3); + }); + + t.describe('shuffle', (t) => { + t.it('noArgs').it('with array', 'Hello World!'.split('')); + }); + + t.describe('uniqueArray', (t) => { + t.it('with array', 'Hello World!'.split(''), 3); + }); + + t.describe('maybe', (t) => { + t.it('with only value', () => 'Hello World!').it( + 'with value and probability', + () => 'Hello World!', + { probability: 0.1 } + ); + }); + + t.describe('objectKey', (t) => { + t.it('simple', { a: 1, b: 2, c: 3 }); + }); + + t.describe('objectValue', (t) => { + t.it('simple', { a: 1, b: 2, c: 3 }); + }); + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/internet.spec.ts b/test/internet.spec.ts index 7d4d9aad6fc..f831107e43d 100644 --- a/test/internet.spec.ts +++ b/test/internet.spec.ts @@ -1,51 +1,67 @@ import validator from 'validator'; import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; import { times } from './support/times'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'avatar', - 'email', - 'exampleEmail', - 'userName', - 'protocol', - 'httpMethod', - 'httpStatusCode', - 'url', - 'domainName', - 'domainSuffix', - 'domainWord', - 'ip', - 'ipv6', - 'port', - 'userAgent', - 'color', - 'mac', - 'password', - 'emoji', -]; - describe('internet', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); + seededTests(faker, 'internet', (t) => { + t.itEach( + 'avatar', + 'protocol', + 'httpMethod', + 'url', + 'domainName', + 'domainSuffix', + 'domainWord', + 'ip', + 'ipv4', + 'ipv6', + 'port', + 'userAgent' + ); + + t.describe('email', (t) => { + t.it('noArgs') + .it('with names', 'Jane', 'Doe') + .it('with provider', undefined, undefined, 'fakerjs.dev') + .it('with names and provider', 'Jane', 'Doe', 'fakerjs.dev'); + }); - const actual = faker.internet[functionName](); + t.describe('exampleEmail', (t) => { + t.it('noArgs').it('with names', 'Jane', 'Doe'); + }); - expect(actual).toMatchSnapshot(); - }); - } + t.describe('userName', (t) => { + t.it('noArgs').it('with names', 'Jane', 'Doe'); + }); + + t.describe('password', (t) => { + t.it('noArgs').it('with length', 10); + }); + + t.describe('httpStatusCode', (t) => { + t.it('noArgs').it('with options', { types: ['clientError'] }); }); - } + + t.describe('color', (t) => { + t.it('noArgs').it('with color base', 100, 100, 100); + }); + + t.describe('mac', (t) => { + t.it('noArgs').it('with separator', ':'); + }); + + t.describe('emoji', (t) => { + t.it('noArgs').it('with options', { types: ['nature'] }); + }); + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/lorem.spec.ts b/test/lorem.spec.ts index 17721b92ba0..67fe26e976f 100644 --- a/test/lorem.spec.ts +++ b/test/lorem.spec.ts @@ -1,42 +1,31 @@ import validator from 'validator'; import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; import { times } from './support/times'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'word', - 'words', - 'sentence', - 'slug', - 'sentences', - 'paragraph', - 'paragraphs', - 'text', - 'lines', -]; - describe('lorem', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.lorem[functionName](); - - expect(actual).toBeTypeOf('string'); - expect(actual).toMatchSnapshot(); - }); - } + seededTests(faker, 'lorem', (t) => { + t.describeEach( + 'word', + 'words', + 'sentence', + 'slug', + 'sentences', + 'paragraph', + 'paragraphs', + 'text', + 'lines' + )((t) => { + t.it('noArgs').it('with length', 10); }); - } + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/music.spec.ts b/test/music.spec.ts index 40b24854dbf..806bcc50649 100644 --- a/test/music.spec.ts +++ b/test/music.spec.ts @@ -1,8 +1,6 @@ import { beforeEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; - -const functionNames = ['genre', 'songName']; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -11,19 +9,9 @@ describe('music', () => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.music[functionName](); - - expect(actual).toMatchSnapshot(); - }); - } - }); - } + seededTests(faker, 'music', (t) => { + t.itEach('genre', 'songName'); + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/name.spec.ts b/test/name.spec.ts index c7baf5a9283..c3b0b95c942 100644 --- a/test/name.spec.ts +++ b/test/name.spec.ts @@ -1,44 +1,46 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import type { Name } from '../src/modules/name'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; -const functionNames: (keyof Name)[] = [ - 'findName', - 'firstName', - 'fullName', - 'gender', - 'jobArea', - 'jobDescriptor', - 'jobTitle', - 'jobType', - 'lastName', - 'middleName', - 'prefix', - 'suffix', -]; - describe('name', () => { afterEach(() => { faker.locale = 'en'; faker.localeFallback = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.name[functionName](); + seededTests(faker, 'name', (t) => { + t.itEach('jobTitle', 'jobDescriptor', 'jobArea', 'jobType'); + + t.describeEach( + 'firstName', + 'lastName', + 'middleName', + 'gender', + 'prefix', + 'suffix' + )((t) => t.it('noArgs').it('with gender', 'male')); + + t.describe('findName', (t) => { + t.it('noArgs') + .it('with name', 'John', 'Doe') + .it('with gender', undefined, undefined, 'female') + .it('with name and gender', 'John', 'Doe', 'female'); + }); - expect(actual).toMatchSnapshot(); + t.describe('fullName', (t) => { + t.it('noArgs') + .it('with firstName', { firstName: 'John' }) + .it('with lastName', { lastName: 'Doe' }) + .it('with gender', { gender: 'female' }) + .it('with all', { + firstName: 'John', + lastName: 'Doe', + gender: 'female', }); - } }); - } + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/phone.spec.ts b/test/phone.spec.ts index 2cea76c2d50..46a8b023c31 100644 --- a/test/phone.spec.ts +++ b/test/phone.spec.ts @@ -1,15 +1,7 @@ import { beforeEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; import { luhnCheck } from '../src/modules/helpers/luhn-check'; -import { seededRuns } from './support/seededRuns'; - -const functionNames = [ - 'phoneNumber', - 'number', - 'phoneNumberFormat', - 'phoneFormats', - 'imei', -]; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 25; @@ -18,32 +10,23 @@ describe('phone', () => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); + seededTests(faker, 'phone', (t) => { + t.itEach('phoneFormats', 'imei'); - const actual = faker.phone[functionName](); + t.describeEach( + 'phoneNumber', + 'number' + )((t) => { + t.it('noArgs').it('format', '###-###-####'); + }); - expect(actual).toMatchSnapshot(); - }); + t.describe('phoneNumberFormat', (t) => { + t.it('noArgs'); + for (const index of [0, 1, 2, 3, 4]) { + t.it(`with index = ${index}`, index); } - - describe('phoneNumberFormat', () => { - it.each([1, 2, 3, 4])( - `should return deterministic values for %s`, - (index) => { - faker.seed(seed); - - const actual = faker.phone.phoneNumberFormat(index); - - expect(actual).toMatchSnapshot(); - } - ); - }); }); - } + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/random.spec.ts b/test/random.spec.ts index 4eedf6aec50..69ad1ed2b3d 100644 --- a/test/random.spec.ts +++ b/test/random.spec.ts @@ -1,33 +1,23 @@ import { beforeEach, describe, expect, it } from 'vitest'; import { faker, FakerError } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; import { times } from './support/times'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'alpha', - 'alphaNumeric', - 'locale', - 'numeric', - 'word', - 'words', -]; - describe('random', () => { - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.random[functionName](); - - expect(actual).toMatchSnapshot(); - }); - } + seededTests(faker, 'random', (t) => { + t.itEach('locale', 'word'); + + t.describeEach( + 'alpha', + 'alphaNumeric', + 'numeric', + 'words' + )((t) => { + t.it('noArgs').it('withLength', 5); }); - } + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/science.spec.ts b/test/science.spec.ts index f7f51d6b84b..c1f185024c0 100644 --- a/test/science.spec.ts +++ b/test/science.spec.ts @@ -1,29 +1,17 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = ['chemicalElement', 'unit']; - describe('science', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.science[functionName](); - - expect(actual).toMatchSnapshot(); - }); - } - }); - } + seededTests(faker, 'science', (t) => { + t.itEach('chemicalElement', 'unit'); + }); // Create and log-back the seed for debug purposes faker.seed(Math.ceil(Math.random() * 1_000_000_000)); diff --git a/test/support/seededRuns.ts b/test/support/seededRuns.ts index 6e6539b78a2..be61cfad3fd 100644 --- a/test/support/seededRuns.ts +++ b/test/support/seededRuns.ts @@ -1 +1,319 @@ +import { describe, describe as vi_describe, expect, it as vi_it } from 'vitest'; +import type { Faker } from '../../src/faker'; +import type { Callable, MethodOf } from '../../src/utils/types'; + export const seededRuns = [42, 1337, 1211]; + +/** + * A type allowing only the names of faker modules. + */ +type FakerModules = { + [Key in keyof Faker]: Faker[Key] extends Callable | string | number | number[] + ? never + : Key extends 'definitions' | 'locales' + ? never + : Key; +}[keyof Faker]; + +/** + * Picks only the methods from the given type. + */ +type OnlyMethods = Pick>; + +/** + * A Faker type with modules trimmed to only methods. + */ +type OnlyMethodsFaker = { + [Key in FakerModules]: OnlyMethods; +}; + +/** + * The type allowing only the names of methods that have exactly zero arguments. + */ +type NoArgsMethodOf = MethodOf & + { + [Key in MethodOf unknown>]: ObjectType[Key] extends ( + arg0: string | number | boolean | Record, + ...args + ) => unknown + ? Key + : never; + }[MethodOf unknown>]; + +/** + * Method that prepares seeded tests. + * + * It ensures that all methods in that module have exactly one test case or block associated to them. + * Duplicate calls to `t.it(methodName)` or `t.describe(methodName)` will directly throw an error. + * Before the method returns it will check that there are tests for all methods of the module. + * + * You may add custom vitest's `it` and `describe` blocks both on a module and method level, + * however these will be ignored by the completeness checks and you have to call the `setup()` callback yourself. + * + * @param faker The faker instance to use for the tests. + * @param module The name of the faker module to test. + * @param factory The factory used to create the seeded tests. Supports both fluent and individual calls. + * + * @example + * seededTests(faker, 'random', (t) => { + * t.it('methodWithoutArgs') + * .itRepeated('methodWithoutArgs2', 5) + * .describe('methodWithArgs3', (t) => { + * t.it('noArgs') + * .it('withParam1', 1337) + * .it('variant1', { min: 0}) + * .it('variant2', { max: 1337}) + * .it('variant1And2', { min: 0, max: 1337}) + * }); + * }) + */ +export function seededTests< + K extends FakerModules, + M extends Record = OnlyMethodsFaker[K] +>( + faker: Faker, + module: K, + factory: (tg: TestGenerator, setup: () => void) => void +): void { + describe.each(seededRuns)('%s', (seed) => { + const testGenerator: TestGenerator = new TestGenerator( + faker, + seed, + module + ); + factory(testGenerator, () => testGenerator.setup()); + + testGenerator.expectAllMethodsToBeTested(); + }); +} + +/** + * Generator for seed based tests. + * + * The individual methods generate default test blocks, that use test snapshots to verify consistent return values. + */ +class TestGenerator< + ModuleName extends FakerModules, + Module extends Record = OnlyMethodsFaker[ModuleName] +> { + private readonly tested: Set> = new Set(); + private readonly module: Module; + + constructor( + private readonly faker: Faker, + private readonly seed: number, + private readonly moduleName: ModuleName + ) { + this.module = this.faker[moduleName] as unknown as Module; + } + + /** + * Ensures that there is only one test block for each method. + * + * @param method The method name to check. + */ + private expectNotTested(method: MethodOf): void { + expect( + this.tested.has(method), + `${method} not to be tested yet` + ).toBeFalsy(); + this.tested.add(method); + } + + /** + * Should never be called from tests. + * + * Configures the faker instance for the test by resetting the seed. + * + * This method will automatically be called by the default methods + * and should be called at the beginning of custom vitest's `it` blocks. + */ + setup(): void { + this.faker.seed(this.seed); + this.faker.locale = 'en'; + } + + /** + * Runs the instructions for a vitest's `it` block. + * + * @param method The method name to call. + * @param args The arguments to call it with. + * @param repetitions The number of times to call it. + */ + private callAndVerify>( + method: MethodName, + args: Parameters, + repetitions: number = 1 + ): void { + this.setup(); + for (let i = 0; i < repetitions; i++) { + const callable = this.module[method]; + const value = callable(...args); + expect(value).toMatchSnapshot(); + } + } + + /** + * Permanently ignores this method. + * + * @param method The name of the method. + */ + skip(method: MethodOf): this { + this.expectNotTested(method); + vi_it.skip(method); + return this; + } + + /** + * Temporarily ignores this method. Useful for testing purposes. + * + * @param method The name of the method. + * + * @deprecated Implement a proper test. + */ + todo(method: MethodOf): this { + this.expectNotTested(method); + vi_it.todo(method); + return this; + } + + /** + * Generates a test for a method without arguments. + * + * @param method The name of the method. + */ + it>(method: MethodName): this { + return this.itRepeated(method, 1); + } + + /** + * Generates a repeated test for a method without arguments. + * The seed is not reset between repetitions. + * + * @param method The name of the method. + * @param repetitions The number of repetitions to run. + */ + itRepeated>( + method: MethodName, + repetitions: number + ): this { + this.expectNotTested(method); + vi_it(method, () => + this.callAndVerify( + method, + [] as Parameters, + repetitions + ) + ); + return this; + } + + /** + * Generates no argument tests for the given methods. + * + * @param methods The names of the methods. + */ + itEach>( + ...methods: MethodName[] + ): this { + for (const method of methods) { + this.it(method); + } + return this; + } + + /** + * Generates a test section for a method. + * Useful to cover multiple argument variations. + * + * @param method The name of the method. + * @param factory The factory used to generate the individual tests. + */ + describe>( + method: MethodName, + factory: (tester: MethodTester) => void + ): this { + this.expectNotTested(method); + const callAndVerify: TestGenerator['callAndVerify'] = + this.callAndVerify.bind(this); + const tester: MethodTester = { + it(name: string, ...args: Parameters) { + vi_it(name, () => callAndVerify(method, args)); + return tester; + }, + itRepeated( + name: string, + repetitions: number, + ...args: Parameters + ) { + vi_it(name, () => callAndVerify(method, args, repetitions)); + return tester; + }, + }; + vi_describe(method, () => { + factory(tester); + }); + return this; + } + + /** + * Generates a test section for multiple methods with a similar signature. + * Useful to cover multiple argument variations. + * + * @param methods The names of the methods to generate the tests for. + */ + describeEach>( + ...methods: MethodName[] + ): (factory: (tester: MethodTester) => void) => this { + return (factory) => { + for (const method of methods) { + this.describe(method, factory); + } + return this; + }; + } + + /** + * Should never be called from tests. + * + * Checks that all methods in the module have associated tests. + * This method will be called automatically at the end of each run. + */ + expectAllMethodsToBeTested(): void { + const actual = Array.from(this.tested).sort(); + const expected = Object.entries(this.module) + .filter(([, value]) => typeof value === 'function') + .map(([key]) => key) + .sort(); + vi_it('should test all methods', () => { + expect(actual).toEqual(expected); + }); + } +} + +/** + * Simple interface for a test generator for a given method. + */ +interface MethodTester { + /** + * Generates a test for the method. + * + * @param name The name of the test case. + * @param args The arguments to use in the test. + */ + it(name: string, ...args: Parameters): this; + + /** + * Generates a repeated test for the method. + * The seed is not reset between repetitions. + * + * @param name The name of the test case. + * @param repetitions The number of repetitions to run. + * @param args The arguments to use in the test. + */ + itRepeated( + name: string, + repetitions: number, + ...args: Parameters + ): this; +} diff --git a/test/system.spec.ts b/test/system.spec.ts index f795abfbaaa..a531752033d 100644 --- a/test/system.spec.ts +++ b/test/system.spec.ts @@ -1,7 +1,7 @@ import validator from 'validator'; import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededRuns, seededTests } from './support/seededRuns'; import { times } from './support/times'; const NON_SEEDED_BASED_RUN = 5; @@ -24,6 +24,30 @@ describe('system', () => { faker.locale = 'en'; }); + seededTests(faker, 'system', (t) => { + t.itEach( + 'commonFileExt', + 'commonFileType', + 'directoryPath', + 'filePath', + 'fileType', + 'mimeType', + 'semver' + ); + + t.describe('fileName', (t) => { + t.it('noArgs').it('with extensionCount', { extensionCount: 2 }); + }); + + t.describe('commonFileName', (t) => { + t.it('noArgs').it('with extension', 'ext'); + }); + + t.describe('fileExt', (t) => { + t.it('noArgs').it('with mimeType', 'application/json'); + }); + }); + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { for (const functionName of functionNames) { diff --git a/test/vehicle.spec.ts b/test/vehicle.spec.ts index c8cb9ae4df5..1d7d72afea6 100644 --- a/test/vehicle.spec.ts +++ b/test/vehicle.spec.ts @@ -1,39 +1,27 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'vehicle', - 'manufacturer', - 'model', - 'type', - 'fuel', - 'vin', - 'color', - 'vrm', - 'bicycle', -]; - describe('vehicle', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.vehicle[functionName](); - - expect(actual).toMatchSnapshot(); - }); - } - }); - } + seededTests(faker, 'vehicle', (t) => { + t.itEach( + 'vehicle', + 'manufacturer', + 'model', + 'type', + 'fuel', + 'vin', + 'color', + 'vrm', + 'bicycle' + ); + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() diff --git a/test/word.spec.ts b/test/word.spec.ts index f3508c380fd..2d4f42c7303 100644 --- a/test/word.spec.ts +++ b/test/word.spec.ts @@ -1,56 +1,27 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; -import { seededRuns } from './support/seededRuns'; +import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; -const functionNames = [ - 'adjective', - 'adverb', - 'conjunction', - 'interjection', - 'noun', - 'preposition', - 'verb', -]; - describe('word', () => { afterEach(() => { faker.locale = 'en'; }); - for (const seed of seededRuns) { - describe(`seed: ${seed}`, () => { - for (const functionName of functionNames) { - it(`${functionName}()`, () => { - faker.seed(seed); - - const actual = faker.word[functionName](); - - expect(actual).toBeTypeOf('string'); - expect(actual).toMatchSnapshot(); - }); - - it(`${functionName}(10)`, () => { - faker.seed(seed); - - const actual = faker.word[functionName](10); - - expect(actual).toBeTypeOf('string'); - expect(actual).toMatchSnapshot(); - }); - - it(`${functionName}(20)`, () => { - faker.seed(seed); - - const actual = faker.word[functionName](20); - - expect(actual).toBeTypeOf('string'); - expect(actual).toMatchSnapshot(); - }); - } + seededTests(faker, 'word', (t) => { + t.describeEach( + 'adjective', + 'adverb', + 'conjunction', + 'interjection', + 'noun', + 'preposition', + 'verb' + )((t) => { + t.it('noArgs').it('with length = 10', 10).it('with length = 20', 20); }); - } + }); describe(`random seeded tests for seed ${JSON.stringify( faker.seed() From 9115fae8aa44189ee50c3b056deeb308a1282d30 Mon Sep 17 00:00:00 2001 From: Hanna Kuczynska Date: Tue, 26 Jul 2022 20:07:00 +0200 Subject: [PATCH 4/5] fix: bic test --- src/modules/finance/index.ts | 8 +++++--- test/__snapshots__/finance.spec.ts.snap | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index 5e24c3b518b..7085ea3654c 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -390,7 +390,7 @@ export class Finance { } /** - * Generates a random SWIFT/BIC code. + * Generates a random SWIFT/BIC code based on the [ISO-9362](https://en.wikipedia.org/wiki/ISO_9362) format. * * @example * faker.finance.bic() // 'WYAUPGX1432' @@ -403,7 +403,9 @@ export class Finance { const countryCode = this.faker.helpers.arrayElement(iban.iso3166); const locationCode = this.faker.random.alphaNumeric(2, { casing: 'upper' }); const branchCode = this.faker.datatype.boolean() - ? this.faker.random.alphaNumeric(3, { casing: 'upper' }) + ? this.faker.datatype.boolean() + ? this.faker.random.alphaNumeric(3, { casing: 'upper' }) + : 'XXX' : ''; return `${bankIdentifier}${countryCode}${locationCode}${branchCode}`; @@ -418,7 +420,7 @@ export class Finance { */ transactionDescription(): string { const amount = this.amount(); - const company = this.faker.company.companyName(); + const company = this.faker.company.name(); const transactionType = this.transactionType(); const account = this.account(); const card = this.mask(); diff --git a/test/__snapshots__/finance.spec.ts.snap b/test/__snapshots__/finance.spec.ts.snap index f45679f49bf..1e7486db53e 100644 --- a/test/__snapshots__/finance.spec.ts.snap +++ b/test/__snapshots__/finance.spec.ts.snap @@ -16,7 +16,7 @@ exports[`finance > 42 > amount > with min 1`] = `"380.79"`; exports[`finance > 42 > amount > with min and max and dec and symbol 1`] = `"$24.98160"`; -exports[`finance > 42 > bic 1`] = `"UYEOSCP1514"`; +exports[`finance > 42 > bic 1`] = `"JUYEPSSLXXX"`; exports[`finance > 42 > bitcoinAddress 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1b"`; @@ -80,7 +80,7 @@ exports[`finance > 1211 > amount > with min 1`] = `"929.24"`; exports[`finance > 1211 > amount > with min and max and dec and symbol 1`] = `"$47.14081"`; -exports[`finance > 1211 > bic 1`] = `"LXUEBTZ1"`; +exports[`finance > 1211 > bic 1`] = `"YLXUDE4Z"`; exports[`finance > 1211 > bitcoinAddress 1`] = `"1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsA"`; @@ -144,7 +144,7 @@ exports[`finance > 1337 > amount > with min 1`] = `"269.40"`; exports[`finance > 1337 > amount > with min and max and dec and symbol 1`] = `"$20.48098"`; -exports[`finance > 1337 > bic 1`] = `"OEFELYL1032"`; +exports[`finance > 1337 > bic 1`] = `"GOEFFIJG"`; exports[`finance > 1337 > bitcoinAddress 1`] = `"3adhxs2jewAgkYgJi7No6Cn8JZa"`; From 73280f7d67a6c91a4f5e89c42433200c4909f9d1 Mon Sep 17 00:00:00 2001 From: Hanna Kuczynska Date: Mon, 1 Aug 2022 15:57:24 +0200 Subject: [PATCH 5/5] test: slight change to the way bic test works --- test/finance.spec.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/finance.spec.ts b/test/finance.spec.ts index d37a4f1d842..d9149772a07 100644 --- a/test/finance.spec.ts +++ b/test/finance.spec.ts @@ -484,13 +484,10 @@ describe('finance', () => { describe('bic()', () => { it('should return a random yet formally correct BIC number', () => { const bic = faker.finance.bic(); - const countryCodes = ibanLib.iso3166.join('|'); - const expr = new RegExp( - `^[A-Z]{4}(${countryCodes})[A-Z0-9]{2}([A-Z0-9]{3})?\$` - ); expect(bic).toBeTypeOf('string'); - expect(bic).toMatch(expr); + expect(bic).toMatch(/^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/); + expect(ibanLib.iso3166).toContain(bic.substring(4, 6)); }); });