diff --git a/CHANGELOG.md b/CHANGELOG.md index 84f8e80c43a..c6609adc2a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [7.3.0](https://github.com/faker-js/faker/compare/v7.2.0...v7.3.0) (2022-06-20) + +### New & Noteworthy + +* Webpack v4 should now be supported 🚀 + + +### Features + +* add abbreviations to `hacker.abbreviation()` in the `en` locale ([#1086](https://github.com/faker-js/faker/issues/1086)) ([c5d8934](https://github.com/faker-js/faker/commit/c5d893401be7b9cdf3e54930df0681ea9f43be06)) +* improve norwegian translations ([#1042](https://github.com/faker-js/faker/issues/1042)) ([e071c78](https://github.com/faker-js/faker/commit/e071c78df7a40813228aeed0ad54f10471289b3f)) +* throw error on unknown locale ([#1071](https://github.com/faker-js/faker/issues/1071)) ([5ea8252](https://github.com/faker-js/faker/commit/5ea8252f727e2e577c2adca9650ac8f24a171632)) + + +### Bug Fixes + +* lower target to support Webpack 4 ([#1085](https://github.com/faker-js/faker/issues/1085)) ([080e51d](https://github.com/faker-js/faker/commit/080e51d19afc5c426b804f6afbd44333bbd0d1c9)) + ## [7.2.0](https://github.com/faker-js/faker/compare/v7.0.1...v7.2.0) (2022-06-06) diff --git a/README.md b/README.md index 04dfde5dd22..14192bc6abd 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,10 @@ - 🧍 Names - Generate virtual humans with a complete online and offline identity. - 🔢 Numbers - Of course, we can also generate random numbers and strings. +> **Note**: Faker tries to generate realistic data and not obvious fake data. +> The generated names, addresses, emails, phone numbers, and/or other data might be coincidentally valid information. +> Please do not send any of your messages/calls to them from your test setup. + ## 📦 Install ```bash diff --git a/package.json b/package.json index 628e9d7cbce..b3d1687901f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@faker-js/faker", - "version": "7.2.0", + "version": "7.3.0", "description": "Generate massive amounts of fake contextual data", "keywords": [ "faker", @@ -100,18 +100,18 @@ "@types/react": "~18.0.14", "@types/sanitize-html": "~2.6.2", "@types/validator": "~13.7.3", - "@typescript-eslint/eslint-plugin": "~5.28.0", - "@typescript-eslint/parser": "~5.28.0", + "@typescript-eslint/eslint-plugin": "~5.29.0", + "@typescript-eslint/parser": "~5.29.0", "@vitest/ui": "~0.15.1", "c8": "~7.11.3", "conventional-changelog-cli": "~2.2.2", - "cypress": "~10.1.0", - "esbuild": "~0.14.45", - "eslint": "~8.17.0", + "cypress": "~10.2.0", + "esbuild": "~0.14.47", + "eslint": "~8.18.0", "eslint-config-prettier": "~8.5.0", "eslint-define-config": "~1.5.1", "eslint-gitignore": "~0.1.0", - "eslint-plugin-jsdoc": "~39.3.2", + "eslint-plugin-jsdoc": "~39.3.3", "eslint-plugin-prettier": "~4.0.0", "glob": "~8.0.3", "lint-staged": "~13.0.2", @@ -126,7 +126,7 @@ "sanitize-html": "~2.7.0", "simple-git-hooks": "~2.8.0", "standard-version": "~9.5.0", - "tsx": "~3.4.3", + "tsx": "~3.5.0", "typedoc": "~0.22.17", "typedoc-plugin-missing-exports": "~0.22.6", "typescript": "~4.7.4", @@ -135,7 +135,7 @@ "vitepress": "~0.22.4", "vitest": "~0.15.1" }, - "packageManager": "pnpm@7.2.1", + "packageManager": "pnpm@7.3.0", "engines": { "node": ">=14.0.0", "npm": ">=6.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b757b7435e1..3e0db035108 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,18 +8,18 @@ specifiers: '@types/react': ~18.0.14 '@types/sanitize-html': ~2.6.2 '@types/validator': ~13.7.3 - '@typescript-eslint/eslint-plugin': ~5.28.0 - '@typescript-eslint/parser': ~5.28.0 + '@typescript-eslint/eslint-plugin': ~5.29.0 + '@typescript-eslint/parser': ~5.29.0 '@vitest/ui': ~0.15.1 c8: ~7.11.3 conventional-changelog-cli: ~2.2.2 - cypress: ~10.1.0 - esbuild: ~0.14.45 - eslint: ~8.17.0 + cypress: ~10.2.0 + esbuild: ~0.14.47 + eslint: ~8.18.0 eslint-config-prettier: ~8.5.0 eslint-define-config: ~1.5.1 eslint-gitignore: ~0.1.0 - eslint-plugin-jsdoc: ~39.3.2 + eslint-plugin-jsdoc: ~39.3.3 eslint-plugin-prettier: ~4.0.0 glob: ~8.0.3 lint-staged: ~13.0.2 @@ -34,7 +34,7 @@ specifiers: sanitize-html: ~2.7.0 simple-git-hooks: ~2.8.0 standard-version: ~9.5.0 - tsx: ~3.4.3 + tsx: ~3.5.0 typedoc: ~0.22.17 typedoc-plugin-missing-exports: ~0.22.6 typescript: ~4.7.4 @@ -51,19 +51,19 @@ devDependencies: '@types/react': 18.0.14 '@types/sanitize-html': 2.6.2 '@types/validator': 13.7.3 - '@typescript-eslint/eslint-plugin': 5.28.0_bwdgjzdjqqu6lnspjrilve2nye - '@typescript-eslint/parser': 5.28.0_n4lrrl552kqf5nk4rgej5xdcha + '@typescript-eslint/eslint-plugin': 5.29.0_qqmbkyiaixvppdwswpytuf2hgm + '@typescript-eslint/parser': 5.29.0_b5e7v2qnwxfo6hmiq56u52mz3e '@vitest/ui': 0.15.1 c8: 7.11.3 conventional-changelog-cli: 2.2.2 - cypress: 10.1.0 - esbuild: 0.14.45 - eslint: 8.17.0 - eslint-config-prettier: 8.5.0_eslint@8.17.0 + cypress: 10.2.0 + esbuild: 0.14.47 + eslint: 8.18.0 + eslint-config-prettier: 8.5.0_eslint@8.18.0 eslint-define-config: 1.5.1 - eslint-gitignore: 0.1.0_eslint@8.17.0 - eslint-plugin-jsdoc: 39.3.2_eslint@8.17.0 - eslint-plugin-prettier: 4.0.0_hsbo72uvra2cjko46y2c4fgzzm + eslint-gitignore: 0.1.0_eslint@8.18.0 + eslint-plugin-jsdoc: 39.3.3_eslint@8.18.0 + eslint-plugin-prettier: 4.0.0_xu6ewijrtliw5q5lksq5uixwby glob: 8.0.3 lint-staged: 13.0.2 mime-db: 1.52.0 @@ -77,7 +77,7 @@ devDependencies: sanitize-html: 2.7.0 simple-git-hooks: 2.8.0 standard-version: 9.5.0 - tsx: 3.4.3 + tsx: 3.5.0 typedoc: 0.22.17_typescript@4.7.4 typedoc-plugin-missing-exports: 0.22.6_typedoc@0.22.17 typescript: 4.7.4 @@ -308,25 +308,25 @@ packages: jsdoc-type-pratt-parser: 3.1.0 dev: true - /@esbuild-kit/cjs-loader/2.1.0: - resolution: {integrity: sha512-KyX25VcC2564K5FnEhNDdzonC87VeSZoLz3h6R8x3d1myhxqGdoQkTQba3VCcuAkgdkn69d3Zhvj3xtGWldbEQ==} + /@esbuild-kit/cjs-loader/2.2.0: + resolution: {integrity: sha512-MWRzs8ds9sujFL++H9Z4aGak61J1Gjlj9VyIjXx9AlgtCS8EEjdjrWKPMNBXP1hvJMmKbL7PE4zT+OzaBv1CaA==} dependencies: - '@esbuild-kit/core-utils': 1.3.1 - get-tsconfig: 4.0.2 + '@esbuild-kit/core-utils': 2.0.1 + get-tsconfig: 4.0.4 dev: true - /@esbuild-kit/core-utils/1.3.1: - resolution: {integrity: sha512-QXWJKf3mEIs+jgUCrY2YWJ2cr9e9asRYRwDhxit+wkCaQbSfV6fCCgs8KjRsrkIdMBcWsjbWnFKfwZ9kjILPrw==} + /@esbuild-kit/core-utils/2.0.1: + resolution: {integrity: sha512-gSpJ59VeFI4/eZjD8hxVGSOf1pQYT7AE6vP9CzH3Igk6EDm72PPj1u2mUawfdzmZLSBj9gDKIuxX/biT3yzAjg==} dependencies: - esbuild: 0.14.38 + esbuild: 0.14.47 source-map-support: 0.5.21 dev: true - /@esbuild-kit/esm-loader/2.2.0: - resolution: {integrity: sha512-DA9v3nkmvUIledvp4Uuf0bq8rWsGB611PwKx8FPTQkWRJe4GrqcoqemiSIXFzteQJIqaDveez9/jJQLZME/5rg==} + /@esbuild-kit/esm-loader/2.3.0: + resolution: {integrity: sha512-iaAHKgQlnXNBloPxhxR05d9nR7zF5T0z+p1umAeB/nejY9+cIN3ULMQ/O/QTW6RVtwDGxzdXdgOYCb3FjeI4PA==} dependencies: - '@esbuild-kit/core-utils': 1.3.1 - get-tsconfig: 4.0.2 + '@esbuild-kit/core-utils': 2.0.1 + get-tsconfig: 4.0.4 dev: true /@eslint/eslintrc/1.3.0: @@ -507,8 +507,8 @@ packages: dev: true optional: true - /@typescript-eslint/eslint-plugin/5.28.0_bwdgjzdjqqu6lnspjrilve2nye: - resolution: {integrity: sha512-DXVU6Cg29H2M6EybqSg2A+x8DgO9TCUBRp4QEXQHJceLS7ogVDP0g3Lkg/SZCqcvkAP/RruuQqK0gdlkgmhSUA==} + /@typescript-eslint/eslint-plugin/5.29.0_qqmbkyiaixvppdwswpytuf2hgm: + resolution: {integrity: sha512-kgTsISt9pM53yRFQmLZ4npj99yGl3x3Pl7z4eA66OuTzAGC4bQB5H5fuLwPnqTKU3yyrrg4MIhjF17UYnL4c0w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -518,12 +518,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.28.0_n4lrrl552kqf5nk4rgej5xdcha - '@typescript-eslint/scope-manager': 5.28.0 - '@typescript-eslint/type-utils': 5.28.0_n4lrrl552kqf5nk4rgej5xdcha - '@typescript-eslint/utils': 5.28.0_n4lrrl552kqf5nk4rgej5xdcha + '@typescript-eslint/parser': 5.29.0_b5e7v2qnwxfo6hmiq56u52mz3e + '@typescript-eslint/scope-manager': 5.29.0 + '@typescript-eslint/type-utils': 5.29.0_b5e7v2qnwxfo6hmiq56u52mz3e + '@typescript-eslint/utils': 5.29.0_b5e7v2qnwxfo6hmiq56u52mz3e debug: 4.3.4 - eslint: 8.17.0 + eslint: 8.18.0 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 @@ -534,8 +534,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.28.0_n4lrrl552kqf5nk4rgej5xdcha: - resolution: {integrity: sha512-ekqoNRNK1lAcKhZESN/PdpVsWbP9jtiNqzFWkp/yAUdZvJalw2heCYuqRmM5eUJSIYEkgq5sGOjq+ZqsLMjtRA==} + /@typescript-eslint/parser/5.29.0_b5e7v2qnwxfo6hmiq56u52mz3e: + resolution: {integrity: sha512-ruKWTv+x0OOxbzIw9nW5oWlUopvP/IQDjB5ZqmTglLIoDTctLlAJpAQFpNPJP/ZI7hTT9sARBosEfaKbcFuECw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -544,26 +544,26 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.28.0 - '@typescript-eslint/types': 5.28.0 - '@typescript-eslint/typescript-estree': 5.28.0_typescript@4.7.4 + '@typescript-eslint/scope-manager': 5.29.0 + '@typescript-eslint/types': 5.29.0 + '@typescript-eslint/typescript-estree': 5.29.0_typescript@4.7.4 debug: 4.3.4 - eslint: 8.17.0 + eslint: 8.18.0 typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager/5.28.0: - resolution: {integrity: sha512-LeBLTqF/he1Z+boRhSqnso6YrzcKMTQ8bO/YKEe+6+O/JGof9M0g3IJlIsqfrK/6K03MlFIlycbf1uQR1IjE+w==} + /@typescript-eslint/scope-manager/5.29.0: + resolution: {integrity: sha512-etbXUT0FygFi2ihcxDZjz21LtC+Eps9V2xVx09zFoN44RRHPrkMflidGMI+2dUs821zR1tDS6Oc9IXxIjOUZwA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.28.0 - '@typescript-eslint/visitor-keys': 5.28.0 + '@typescript-eslint/types': 5.29.0 + '@typescript-eslint/visitor-keys': 5.29.0 dev: true - /@typescript-eslint/type-utils/5.28.0_n4lrrl552kqf5nk4rgej5xdcha: - resolution: {integrity: sha512-SyKjKh4CXPglueyC6ceAFytjYWMoPHMswPQae236zqe1YbhvCVQyIawesYywGiu98L9DwrxsBN69vGIVxJ4mQQ==} + /@typescript-eslint/type-utils/5.29.0_b5e7v2qnwxfo6hmiq56u52mz3e: + resolution: {integrity: sha512-JK6bAaaiJozbox3K220VRfCzLa9n0ib/J+FHIwnaV3Enw/TO267qe0pM1b1QrrEuy6xun374XEAsRlA86JJnyg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -572,22 +572,22 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.28.0_n4lrrl552kqf5nk4rgej5xdcha + '@typescript-eslint/utils': 5.29.0_b5e7v2qnwxfo6hmiq56u52mz3e debug: 4.3.4 - eslint: 8.17.0 + eslint: 8.18.0 tsutils: 3.21.0_typescript@4.7.4 typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types/5.28.0: - resolution: {integrity: sha512-2OOm8ZTOQxqkPbf+DAo8oc16sDlVR5owgJfKheBkxBKg1vAfw2JsSofH9+16VPlN9PWtv8Wzhklkqw3k/zCVxA==} + /@typescript-eslint/types/5.29.0: + resolution: {integrity: sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.28.0_typescript@4.7.4: - resolution: {integrity: sha512-9GX+GfpV+F4hdTtYc6OV9ZkyYilGXPmQpm6AThInpBmKJEyRSIjORJd1G9+bknb7OTFYL+Vd4FBJAO6T78OVqA==} + /@typescript-eslint/typescript-estree/5.29.0_typescript@4.7.4: + resolution: {integrity: sha512-mQvSUJ/JjGBdvo+1LwC+GY2XmSYjK1nAaVw2emp/E61wEVYEyibRHCqm1I1vEKbXCpUKuW4G7u9ZCaZhJbLoNQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -595,8 +595,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.28.0 - '@typescript-eslint/visitor-keys': 5.28.0 + '@typescript-eslint/types': 5.29.0 + '@typescript-eslint/visitor-keys': 5.29.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -607,29 +607,29 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.28.0_n4lrrl552kqf5nk4rgej5xdcha: - resolution: {integrity: sha512-E60N5L0fjv7iPJV3UGc4EC+A3Lcj4jle9zzR0gW7vXhflO7/J29kwiTGITA2RlrmPokKiZbBy2DgaclCaEUs6g==} + /@typescript-eslint/utils/5.29.0_b5e7v2qnwxfo6hmiq56u52mz3e: + resolution: {integrity: sha512-3Eos6uP1nyLOBayc/VUdKZikV90HahXE5Dx9L5YlSd/7ylQPXhLk1BYb29SDgnBnTp+jmSZUU0QxUiyHgW4p7A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: '@types/json-schema': 7.0.11 - '@typescript-eslint/scope-manager': 5.28.0 - '@typescript-eslint/types': 5.28.0 - '@typescript-eslint/typescript-estree': 5.28.0_typescript@4.7.4 - eslint: 8.17.0 + '@typescript-eslint/scope-manager': 5.29.0 + '@typescript-eslint/types': 5.29.0 + '@typescript-eslint/typescript-estree': 5.29.0_typescript@4.7.4 + eslint: 8.18.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.17.0 + eslint-utils: 3.0.0_eslint@8.18.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys/5.28.0: - resolution: {integrity: sha512-BtfP1vCor8cWacovzzPFOoeW4kBQxzmhxGoOpt0v1SFvG+nJ0cWaVdJk7cky1ArTcFHHKNIxyo2LLr3oNkSuXA==} + /@typescript-eslint/visitor-keys/5.29.0: + resolution: {integrity: sha512-Hpb/mCWsjILvikMQoZIE3voc9wtQcS0A9FUw3h8bhr9UxBdtI/tw1ZDZUOXHXLOVMedKCH5NxyzATwnU78bWCQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.28.0 + '@typescript-eslint/types': 5.29.0 eslint-visitor-keys: 3.3.0 dev: true @@ -1400,8 +1400,8 @@ packages: resolution: {integrity: sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==} dev: true - /cypress/10.1.0: - resolution: {integrity: sha512-aQ4JVZVib4Xd9FZW8IRZfKelUvqF4y5A+oUbNvn8TlsBmEfIg3m5Xd6Mt6PVU/jHiVJ9Psl905B3ZPnrDcmyuQ==} + /cypress/10.2.0: + resolution: {integrity: sha512-+i9lY5ENlfi2mJwsggzR+XASOIgMd7S/Gd3/13NCpv596n3YSplMAueBTIxNLcxDpTcIksp+9pM3UaDrJDpFqA==} engines: {node: '>=12.0.0'} hasBin: true requiresBuild: true @@ -1701,8 +1701,8 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild-android-64/0.14.38: - resolution: {integrity: sha512-aRFxR3scRKkbmNuGAK+Gee3+yFxkTJO/cx83Dkyzo4CnQl/2zVSurtG6+G86EQIZ+w+VYngVyK7P3HyTBKu3nw==} + /esbuild-android-64/0.14.47: + resolution: {integrity: sha512-R13Bd9+tqLVFndncMHssZrPWe6/0Kpv2/dt4aA69soX4PRxlzsVpCvoJeFE8sOEoeVEiBkI0myjlkDodXlHa0g==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1710,26 +1710,8 @@ packages: dev: true optional: true - /esbuild-android-64/0.14.45: - resolution: {integrity: sha512-krVmwL2uXQN1A+Ci4u2MR+Y0IAvQK0u3no5TsgguHVhTy138szjuohScCGjkpvLCpGLk7P4kFP1LKuntvJ0d4A==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /esbuild-android-arm64/0.14.38: - resolution: {integrity: sha512-L2NgQRWuHFI89IIZIlpAcINy9FvBk6xFVZ7xGdOwIm8VyhX1vNCEqUJO3DPSSy945Gzdg98cxtNt8Grv1CsyhA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /esbuild-android-arm64/0.14.45: - resolution: {integrity: sha512-62POGdzAjM+XOXEM5MmFW6k9Pjdjg1hTrXKKBbPE700LFF36B+1Jv9QkskT5UadbTk4cdH9BQ7bGiRPYY0p/Dw==} + /esbuild-android-arm64/0.14.47: + resolution: {integrity: sha512-OkwOjj7ts4lBp/TL6hdd8HftIzOy/pdtbrNA4+0oVWgGG64HrdVzAF5gxtJufAPOsEjkyh1oIYvKAUinKKQRSQ==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1737,17 +1719,8 @@ packages: dev: true optional: true - /esbuild-darwin-64/0.14.38: - resolution: {integrity: sha512-5JJvgXkX87Pd1Og0u/NJuO7TSqAikAcQQ74gyJ87bqWRVeouky84ICoV4sN6VV53aTW+NE87qLdGY4QA2S7KNA==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /esbuild-darwin-64/0.14.45: - resolution: {integrity: sha512-dbkVUAnGx5IeZesWnIhnvxy7dSvgUQvfy0TVLzd9XVP3oI/VsKs8UNsfPrxI5HiN4SINv7oPAbxWceMpB7IqNA==} + /esbuild-darwin-64/0.14.47: + resolution: {integrity: sha512-R6oaW0y5/u6Eccti/TS6c/2c1xYTb1izwK3gajJwi4vIfNs1s8B1dQzI1UiC9T61YovOQVuePDcfqHLT3mUZJA==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -1755,17 +1728,8 @@ packages: dev: true optional: true - /esbuild-darwin-arm64/0.14.38: - resolution: {integrity: sha512-eqF+OejMI3mC5Dlo9Kdq/Ilbki9sQBw3QlHW3wjLmsLh+quNfHmGMp3Ly1eWm981iGBMdbtSS9+LRvR2T8B3eQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /esbuild-darwin-arm64/0.14.45: - resolution: {integrity: sha512-O6Bz7nnOae5rvbh2Ueo8ibSr7+/eLjsbPdgeMsAZri+LkOa7nsVPnhmocpO3Hy/LWfagTtHy1O9HRPIaArPmTg==} + /esbuild-darwin-arm64/0.14.47: + resolution: {integrity: sha512-seCmearlQyvdvM/noz1L9+qblC5vcBrhUaOoLEDDoLInF/VQ9IkobGiLlyTPYP5dW1YD4LXhtBgOyevoIHGGnw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -1773,8 +1737,8 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.14.38: - resolution: {integrity: sha512-epnPbhZUt93xV5cgeY36ZxPXDsQeO55DppzsIgWM8vgiG/Rz+qYDLmh5ts3e+Ln1wA9dQ+nZmVHw+RjaW3I5Ig==} + /esbuild-freebsd-64/0.14.47: + resolution: {integrity: sha512-ZH8K2Q8/Ux5kXXvQMDsJcxvkIwut69KVrYQhza/ptkW50DC089bCVrJZZ3sKzIoOx+YPTrmsZvqeZERjyYrlvQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -1782,26 +1746,8 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.14.45: - resolution: {integrity: sha512-y1X2nr3XSWnDC7MRcy21EVAT0TiCtdefOntJ+SQcZnPBTURzX77f99S8lDF2KswukChkiacpd2Wd4VZieo7w7Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-freebsd-arm64/0.14.38: - resolution: {integrity: sha512-/9icXUYJWherhk+y5fjPI5yNUdFPtXHQlwP7/K/zg8t8lQdHVj20SqU9/udQmeUo5pDFHMYzcEFfJqgOVeKNNQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-freebsd-arm64/0.14.45: - resolution: {integrity: sha512-r3ZNejkx1BKXQ6sYOP6C5rTwgiUajyAh03wygLWZtl+SLyygvAnu+OouqtveesufjBDgujp4wZXP/n8PVqXkqg==} + /esbuild-freebsd-arm64/0.14.47: + resolution: {integrity: sha512-ZJMQAJQsIOhn3XTm7MPQfCzEu5b9STNC+s90zMWe2afy9EwnHV7Ov7ohEMv2lyWlc2pjqLW8QJnz2r0KZmeAEQ==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -1809,17 +1755,8 @@ packages: dev: true optional: true - /esbuild-linux-32/0.14.38: - resolution: {integrity: sha512-QfgfeNHRFvr2XeHFzP8kOZVnal3QvST3A0cgq32ZrHjSMFTdgXhMhmWdKzRXP/PKcfv3e2OW9tT9PpcjNvaq6g==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-32/0.14.45: - resolution: {integrity: sha512-Qk9cCO3PJig/Y+SdslN/Th4pbAjgaH9oUjVH28eMsLTPf6QDUuK6EED91jepJdR3vxhcnVjyl6JqtOWmP+uxCg==} + /esbuild-linux-32/0.14.47: + resolution: {integrity: sha512-FxZOCKoEDPRYvq300lsWCTv1kcHgiiZfNrPtEhFAiqD7QZaXrad8LxyJ8fXGcWzIFzRiYZVtB3ttvITBvAFhKw==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -1827,17 +1764,8 @@ packages: dev: true optional: true - /esbuild-linux-64/0.14.38: - resolution: {integrity: sha512-uuZHNmqcs+Bj1qiW9k/HZU3FtIHmYiuxZ/6Aa+/KHb/pFKr7R3aVqvxlAudYI9Fw3St0VCPfv7QBpUITSmBR1Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-64/0.14.45: - resolution: {integrity: sha512-IybO2ugqvc/Zzn1Kih3x0FVjYAy3GTCwhtcp91dbdqk3wPqxYCzObYspa8ca0s+OovI0Cnb+rhXrUtq8gBqlqw==} + /esbuild-linux-64/0.14.47: + resolution: {integrity: sha512-nFNOk9vWVfvWYF9YNYksZptgQAdstnDCMtR6m42l5Wfugbzu11VpMCY9XrD4yFxvPo9zmzcoUL/88y0lfJZJJw==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -1845,17 +1773,8 @@ packages: dev: true optional: true - /esbuild-linux-arm/0.14.38: - resolution: {integrity: sha512-FiFvQe8J3VKTDXG01JbvoVRXQ0x6UZwyrU4IaLBZeq39Bsbatd94Fuc3F1RGqPF5RbIWW7RvkVQjn79ejzysnA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-arm/0.14.45: - resolution: {integrity: sha512-qKWJ4A4TAcxXV2TBLPw3Av5X2SYNfyNnBHNJTQJ5VuevK6Aq5i6XEMvUgdlcVuZ9MYPfS5aJZWglzDzJMf1Lpw==} + /esbuild-linux-arm/0.14.47: + resolution: {integrity: sha512-ZGE1Bqg/gPRXrBpgpvH81tQHpiaGxa8c9Rx/XOylkIl2ypLuOcawXEAo8ls+5DFCcRGt/o3sV+PzpAFZobOsmA==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -1863,8 +1782,8 @@ packages: dev: true optional: true - /esbuild-linux-arm64/0.14.38: - resolution: {integrity: sha512-HlMGZTEsBrXrivr64eZ/EO0NQM8H8DuSENRok9d+Jtvq8hOLzrxfsAT9U94K3KOGk2XgCmkaI2KD8hX7F97lvA==} + /esbuild-linux-arm64/0.14.47: + resolution: {integrity: sha512-ywfme6HVrhWcevzmsufjd4iT3PxTfCX9HOdxA7Hd+/ZM23Y9nXeb+vG6AyA6jgq/JovkcqRHcL9XwRNpWG6XRw==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -1872,26 +1791,8 @@ packages: dev: true optional: true - /esbuild-linux-arm64/0.14.45: - resolution: {integrity: sha512-UNEyuHTwztrkEU/+mWIxGzKrYBo2cEtjYAZQVZB1kliANKgRITktg2miaO/b/VtNe84ob1aXSvW8XOPEn5RTGQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-mips64le/0.14.38: - resolution: {integrity: sha512-qd1dLf2v7QBiI5wwfil9j0HG/5YMFBAmMVmdeokbNAMbcg49p25t6IlJFXAeLzogv1AvgaXRXvgFNhScYEUXGQ==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-mips64le/0.14.45: - resolution: {integrity: sha512-s/jcfw3Vpku5dIVSFVY7idJsGdIpIJ88IrkyprVgCG2yBeXatb67B7yIt0E1tL+OHrJJdNBw6GikCiMPAAu1VA==} + /esbuild-linux-mips64le/0.14.47: + resolution: {integrity: sha512-mg3D8YndZ1LvUiEdDYR3OsmeyAew4MA/dvaEJxvyygahWmpv1SlEEnhEZlhPokjsUMfRagzsEF/d/2XF+kTQGg==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -1899,17 +1800,8 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le/0.14.38: - resolution: {integrity: sha512-mnbEm7o69gTl60jSuK+nn+pRsRHGtDPfzhrqEUXyCl7CTOCLtWN2bhK8bgsdp6J/2NyS/wHBjs1x8aBWwP2X9Q==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-ppc64le/0.14.45: - resolution: {integrity: sha512-lJItl6ESZnhSx951U9R7MTBopgwIELHlQzC6SBR023V5JC1rPRFDZ/UEBsV+7BFcCAfqlyb+odGEAmcBSf4XCA==} + /esbuild-linux-ppc64le/0.14.47: + resolution: {integrity: sha512-WER+f3+szmnZiWoK6AsrTKGoJoErG2LlauSmk73LEZFQ/iWC+KhhDsOkn1xBUpzXWsxN9THmQFltLoaFEH8F8w==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -1917,17 +1809,8 @@ packages: dev: true optional: true - /esbuild-linux-riscv64/0.14.38: - resolution: {integrity: sha512-+p6YKYbuV72uikChRk14FSyNJZ4WfYkffj6Af0/Tw63/6TJX6TnIKE+6D3xtEc7DeDth1fjUOEqm+ApKFXbbVQ==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-riscv64/0.14.45: - resolution: {integrity: sha512-8anMu+QLl9MununVCGJN2I/JvUWPm1EVsBBLq/J+Nz4hr8t6QOCuEp0HRaeMohyl2XiMFBchVu0mwa05rF7GFQ==} + /esbuild-linux-riscv64/0.14.47: + resolution: {integrity: sha512-1fI6bP3A3rvI9BsaaXbMoaOjLE3lVkJtLxsgLHqlBhLlBVY7UqffWBvkrX/9zfPhhVMd9ZRFiaqXnB1T7BsL2g==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -1935,8 +1818,8 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.14.38: - resolution: {integrity: sha512-0zUsiDkGJiMHxBQ7JDU8jbaanUY975CdOW1YDrurjrM0vWHfjv9tLQsW9GSyEb/heSK1L5gaweRjzfUVBFoybQ==} + /esbuild-linux-s390x/0.14.47: + resolution: {integrity: sha512-eZrWzy0xFAhki1CWRGnhsHVz7IlSKX6yT2tj2Eg8lhAwlRE5E96Hsb0M1mPSE1dHGpt1QVwwVivXIAacF/G6mw==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -1944,26 +1827,8 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.14.45: - resolution: {integrity: sha512-1TPeNvNCoahMw745KNTA6POKaFfSqQrBb3fdOL82GXZqyKU/6rHNwGP0NgHe88bAUMp3QZfjGfCGKxfBHL77RQ==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-netbsd-64/0.14.38: - resolution: {integrity: sha512-cljBAApVwkpnJZfnRVThpRBGzCi+a+V9Ofb1fVkKhtrPLDYlHLrSYGtmnoTVWDQdU516qYI8+wOgcGZ4XIZh0Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-netbsd-64/0.14.45: - resolution: {integrity: sha512-55f2eZ8EQhhOZosqX0mApgRoI9PrVyXlHd9Uivk+B0B4WTKUgzkoHaVk4EkIUtNRQTpDWPciTlpb/C2tUYVejA==} + /esbuild-netbsd-64/0.14.47: + resolution: {integrity: sha512-Qjdjr+KQQVH5Q2Q1r6HBYswFTToPpss3gqCiSw2Fpq/ua8+eXSQyAMG+UvULPqXceOwpnPo4smyZyHdlkcPppQ==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -1971,17 +1836,8 @@ packages: dev: true optional: true - /esbuild-openbsd-64/0.14.38: - resolution: {integrity: sha512-CDswYr2PWPGEPpLDUO50mL3WO/07EMjnZDNKpmaxUPsrW+kVM3LoAqr/CE8UbzugpEiflYqJsGPLirThRB18IQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-openbsd-64/0.14.45: - resolution: {integrity: sha512-Z5sNcT3oN9eryMW3mGn5HAgg7XCxiUS4isqH1tZXpsdOdOESbgbTEP0mBEJU0WU7Vt2gIN5XMbAp7Oigm0k71g==} + /esbuild-openbsd-64/0.14.47: + resolution: {integrity: sha512-QpgN8ofL7B9z8g5zZqJE+eFvD1LehRlxr25PBkjyyasakm4599iroUpaj96rdqRlO2ShuyqwJdr+oNqWwTUmQw==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -1989,17 +1845,8 @@ packages: dev: true optional: true - /esbuild-sunos-64/0.14.38: - resolution: {integrity: sha512-2mfIoYW58gKcC3bck0j7lD3RZkqYA7MmujFYmSn9l6TiIcAMpuEvqksO+ntBgbLep/eyjpgdplF7b+4T9VJGOA==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - - /esbuild-sunos-64/0.14.45: - resolution: {integrity: sha512-WmWu4wAm8mIxxK9aWFCj5VHunY3BHQDT3dAPexMLLszPyMF7RDtUYf+Dash9tjyitvnoxPAvR7DpWpirDLQIlQ==} + /esbuild-sunos-64/0.14.47: + resolution: {integrity: sha512-uOeSgLUwukLioAJOiGYm3kNl+1wJjgJA8R671GYgcPgCx7QR73zfvYqXFFcIO93/nBdIbt5hd8RItqbbf3HtAQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -2007,17 +1854,8 @@ packages: dev: true optional: true - /esbuild-windows-32/0.14.38: - resolution: {integrity: sha512-L2BmEeFZATAvU+FJzJiRLFUP+d9RHN+QXpgaOrs2klshoAm1AE6Us4X6fS9k33Uy5SzScn2TpcgecbqJza1Hjw==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-32/0.14.45: - resolution: {integrity: sha512-DPPehKwPJFBoSG+jILc/vcJNN8pTwz1m6FWojxqtqPhgw8OabTgN4vL7gNMqL/FSeDxF+zyvZeeMrZFYF1d81Q==} + /esbuild-windows-32/0.14.47: + resolution: {integrity: sha512-H0fWsLTp2WBfKLBgwYT4OTfFly4Im/8B5f3ojDv1Kx//kiubVY0IQunP2Koc/fr/0wI7hj3IiBDbSrmKlrNgLQ==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -2025,8 +1863,8 @@ packages: dev: true optional: true - /esbuild-windows-64/0.14.38: - resolution: {integrity: sha512-Khy4wVmebnzue8aeSXLC+6clo/hRYeNIm0DyikoEqX+3w3rcvrhzpoix0S+MF9vzh6JFskkIGD7Zx47ODJNyCw==} + /esbuild-windows-64/0.14.47: + resolution: {integrity: sha512-/Pk5jIEH34T68r8PweKRi77W49KwanZ8X6lr3vDAtOlH5EumPE4pBHqkCUdELanvsT14yMXLQ/C/8XPi1pAtkQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -2034,26 +1872,8 @@ packages: dev: true optional: true - /esbuild-windows-64/0.14.45: - resolution: {integrity: sha512-t6bxFZcp9bLmSs+1pCNL/BW2bq3QEQHxU4HoiMEyWfF8QBU8iNXFI1iLGdyCzB1Ue2739h55tpOvojFrfyNPWA==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-arm64/0.14.38: - resolution: {integrity: sha512-k3FGCNmHBkqdJXuJszdWciAH77PukEyDsdIryEHn9cKLQFxzhT39dSumeTuggaQcXY57UlmLGIkklWZo2qzHpw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-arm64/0.14.45: - resolution: {integrity: sha512-DnhrvjECBJ2L0owoznPb4RqQKZ498SM8J+YHqmqzi0Gf/enkUwwTjB8vPCK6dDuFnNU/NE8f94FhKdkBHYruDQ==} + /esbuild-windows-arm64/0.14.47: + resolution: {integrity: sha512-HFSW2lnp62fl86/qPQlqw6asIwCnEsEoNIL1h2uVMgakddf+vUuMcCbtUY1i8sst7KkgHrVKCJQB33YhhOweCQ==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -2061,60 +1881,32 @@ packages: dev: true optional: true - /esbuild/0.14.38: - resolution: {integrity: sha512-12fzJ0fsm7gVZX1YQ1InkOE5f9Tl7cgf6JPYXRJtPIoE0zkWAbHdPHVPPaLi9tYAcEBqheGzqLn/3RdTOyBfcA==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - esbuild-android-64: 0.14.38 - esbuild-android-arm64: 0.14.38 - esbuild-darwin-64: 0.14.38 - esbuild-darwin-arm64: 0.14.38 - esbuild-freebsd-64: 0.14.38 - esbuild-freebsd-arm64: 0.14.38 - esbuild-linux-32: 0.14.38 - esbuild-linux-64: 0.14.38 - esbuild-linux-arm: 0.14.38 - esbuild-linux-arm64: 0.14.38 - esbuild-linux-mips64le: 0.14.38 - esbuild-linux-ppc64le: 0.14.38 - esbuild-linux-riscv64: 0.14.38 - esbuild-linux-s390x: 0.14.38 - esbuild-netbsd-64: 0.14.38 - esbuild-openbsd-64: 0.14.38 - esbuild-sunos-64: 0.14.38 - esbuild-windows-32: 0.14.38 - esbuild-windows-64: 0.14.38 - esbuild-windows-arm64: 0.14.38 - dev: true - - /esbuild/0.14.45: - resolution: {integrity: sha512-JOxGUD8jcs8xE8DjyGWC8by/vLMCXTJ/wuauWipL5kJRZx1dhpqIntb31QHjA45GZJWaXv7SjC/Zwu1bCkXWtQ==} + /esbuild/0.14.47: + resolution: {integrity: sha512-wI4ZiIfFxpkuxB8ju4MHrGwGLyp1+awEHAHVpx6w7a+1pmYIq8T9FGEVVwFo0iFierDoMj++Xq69GXWYn2EiwA==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - esbuild-android-64: 0.14.45 - esbuild-android-arm64: 0.14.45 - esbuild-darwin-64: 0.14.45 - esbuild-darwin-arm64: 0.14.45 - esbuild-freebsd-64: 0.14.45 - esbuild-freebsd-arm64: 0.14.45 - esbuild-linux-32: 0.14.45 - esbuild-linux-64: 0.14.45 - esbuild-linux-arm: 0.14.45 - esbuild-linux-arm64: 0.14.45 - esbuild-linux-mips64le: 0.14.45 - esbuild-linux-ppc64le: 0.14.45 - esbuild-linux-riscv64: 0.14.45 - esbuild-linux-s390x: 0.14.45 - esbuild-netbsd-64: 0.14.45 - esbuild-openbsd-64: 0.14.45 - esbuild-sunos-64: 0.14.45 - esbuild-windows-32: 0.14.45 - esbuild-windows-64: 0.14.45 - esbuild-windows-arm64: 0.14.45 + esbuild-android-64: 0.14.47 + esbuild-android-arm64: 0.14.47 + esbuild-darwin-64: 0.14.47 + esbuild-darwin-arm64: 0.14.47 + esbuild-freebsd-64: 0.14.47 + esbuild-freebsd-arm64: 0.14.47 + esbuild-linux-32: 0.14.47 + esbuild-linux-64: 0.14.47 + esbuild-linux-arm: 0.14.47 + esbuild-linux-arm64: 0.14.47 + esbuild-linux-mips64le: 0.14.47 + esbuild-linux-ppc64le: 0.14.47 + esbuild-linux-riscv64: 0.14.47 + esbuild-linux-s390x: 0.14.47 + esbuild-netbsd-64: 0.14.47 + esbuild-openbsd-64: 0.14.47 + esbuild-sunos-64: 0.14.47 + esbuild-windows-32: 0.14.47 + esbuild-windows-64: 0.14.47 + esbuild-windows-arm64: 0.14.47 dev: true /escalade/3.1.1: @@ -2132,13 +1924,13 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-prettier/8.5.0_eslint@8.17.0: + /eslint-config-prettier/8.5.0_eslint@8.18.0: resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.17.0 + eslint: 8.18.0 dev: true /eslint-define-config/1.5.1: @@ -2146,7 +1938,7 @@ packages: engines: {node: '>= 14.6.0', npm: '>= 6.0.0', pnpm: '>= 7.0.0'} dev: true - /eslint-gitignore/0.1.0_eslint@8.17.0: + /eslint-gitignore/0.1.0_eslint@8.18.0: resolution: {integrity: sha512-VFvY5Wyjuz5xXDC/NeONHzsh4YQNok2Gzg4SftAAuhkbrdHv5CChjfiFyLKhRlgOdCJr5kBquaLXHtuDBTW2/Q==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -2154,14 +1946,14 @@ packages: dependencies: array.prototype.flatmap: 1.3.0 debug: 4.3.4 - eslint: 8.17.0 + eslint: 8.18.0 fast-glob: 3.2.11 transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-jsdoc/39.3.2_eslint@8.17.0: - resolution: {integrity: sha512-RSGN94RYzIJS/WfW3l6cXzRLfJWxvJgNQZ4w0WCaxJWDJMigtwTsILEAfKqmmPkT2rwMH/s3C7G5ChDE6cwPJg==} + /eslint-plugin-jsdoc/39.3.3_eslint@8.18.0: + resolution: {integrity: sha512-K/DAjKRUNaUTf0KQhI9PvsF+Y3mGDx/j0pofXsJCQe/tmRsRweBIXR353c8nAro0lytZYEf7l0PluBpzKDiHxw==} engines: {node: ^14 || ^16 || ^17 || ^18} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -2170,7 +1962,7 @@ packages: comment-parser: 1.3.1 debug: 4.3.4 escape-string-regexp: 4.0.0 - eslint: 8.17.0 + eslint: 8.18.0 esquery: 1.4.0 semver: 7.3.7 spdx-expression-parse: 3.0.1 @@ -2178,7 +1970,7 @@ packages: - supports-color dev: true - /eslint-plugin-prettier/4.0.0_hsbo72uvra2cjko46y2c4fgzzm: + /eslint-plugin-prettier/4.0.0_xu6ewijrtliw5q5lksq5uixwby: resolution: {integrity: sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==} engines: {node: '>=6.0.0'} peerDependencies: @@ -2189,8 +1981,8 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.17.0 - eslint-config-prettier: 8.5.0_eslint@8.17.0 + eslint: 8.18.0 + eslint-config-prettier: 8.5.0_eslint@8.18.0 prettier: 2.7.1 prettier-linter-helpers: 1.0.0 dev: true @@ -2211,13 +2003,13 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils/3.0.0_eslint@8.17.0: + /eslint-utils/3.0.0_eslint@8.18.0: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 8.17.0 + eslint: 8.18.0 eslint-visitor-keys: 2.1.0 dev: true @@ -2231,8 +2023,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint/8.17.0: - resolution: {integrity: sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw==} + /eslint/8.18.0: + resolution: {integrity: sha512-As1EfFMVk7Xc6/CvhssHUjsAQSkpfXvUGMFC3ce8JDe6WvqCgRrLOBQbVpsBFr1X1V+RACOadnzVvcUS5ni2bA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: @@ -2245,7 +2037,7 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 - eslint-utils: 3.0.0_eslint@8.17.0 + eslint-utils: 3.0.0_eslint@8.18.0 eslint-visitor-keys: 3.3.0 espree: 9.3.2 esquery: 1.4.0 @@ -2596,8 +2388,8 @@ packages: get-intrinsic: 1.1.2 dev: true - /get-tsconfig/4.0.2: - resolution: {integrity: sha512-mId66O9RChjqWtUrq793OhYTJGUM1InYWw9wLQ4APAazEbN/BAAAcR+/X7dPBNy6om1vdGFTP5RGHste86ZOqQ==} + /get-tsconfig/4.0.4: + resolution: {integrity: sha512-HV3OGunzMsulS6nFzOYj4L/cjO8BoI8PlCUyR1g8On+hUmthxqaOmo/qyFRzOJ/IF/fLH0k+qz7NhMt9d3QnvQ==} dev: true /getos/3.2.1: @@ -2723,7 +2515,7 @@ packages: source-map: 0.6.1 wordwrap: 1.0.0 optionalDependencies: - uglify-js: 3.16.0 + uglify-js: 3.16.1 dev: true /hard-rejection/2.1.0: @@ -3497,7 +3289,7 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.0 + resolve: 1.22.1 semver: 5.7.1 validate-npm-package-license: 3.0.4 dev: true @@ -3842,7 +3634,7 @@ packages: dev: true /proxy-from-env/1.0.0: - resolution: {integrity: sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=} + resolution: {integrity: sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==} dev: true /psl/1.8.0: @@ -3992,8 +3784,8 @@ packages: engines: {node: '>=4'} dev: true - /resolve/1.22.0: - resolution: {integrity: sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==} + /resolve/1.22.1: + resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true dependencies: is-core-module: 2.9.0 @@ -4025,8 +3817,8 @@ packages: glob: 7.2.3 dev: true - /rollup/2.75.6: - resolution: {integrity: sha512-OEf0TgpC9vU6WGROJIk1JA3LR5vk/yvqlzxqdrE2CzzXnqKXNzbAwlWUXis8RS3ZPe7LAq+YUxsRa0l3r27MLA==} + /rollup/2.75.7: + resolution: {integrity: sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==} engines: {node: '>=10.0.0'} hasBin: true optionalDependencies: @@ -4526,13 +4318,13 @@ packages: typescript: 4.7.4 dev: true - /tsx/3.4.3: - resolution: {integrity: sha512-2joLNBKxg6Jn+qEMlzMrS2K6uxBG2faQNX7J/w8cO56ysCxJPbfeyWX5Qxbv0l8GeCkkc0Q0/wlH9eEI5LkZeQ==} + /tsx/3.5.0: + resolution: {integrity: sha512-hLqNvjXt4EjliUKCY2mJA+tTJ3WRdPpqYdU6Q76Maa4VJONj4hBa9dPtcyRJEPFJiNxoJ0gqMak9ki0zXioJDw==} hasBin: true dependencies: - '@esbuild-kit/cjs-loader': 2.1.0 - '@esbuild-kit/core-utils': 1.3.1 - '@esbuild-kit/esm-loader': 2.2.0 + '@esbuild-kit/cjs-loader': 2.2.0 + '@esbuild-kit/core-utils': 2.0.1 + '@esbuild-kit/esm-loader': 2.3.0 optionalDependencies: fsevents: 2.3.2 dev: true @@ -4617,8 +4409,8 @@ packages: hasBin: true dev: true - /uglify-js/3.16.0: - resolution: {integrity: sha512-FEikl6bR30n0T3amyBh3LoiBdqHRy/f4H80+My34HOesOKyHfOsxAPAxOoqC0JUnC1amnO0IwkYC3sko51caSw==} + /uglify-js/3.16.1: + resolution: {integrity: sha512-X5BGTIDH8U6IQ1TIRP62YC36k+ULAa1d59BxlWvPUJ1NkW5L3FwcGfEzuVvGmhJFBu0YJ5Ge25tmRISqCmLiRQ==} engines: {node: '>=0.8.0'} hasBin: true requiresBuild: true @@ -4691,7 +4483,7 @@ packages: dev: true /verror/1.10.0: - resolution: {integrity: sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=} + resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} engines: {'0': node >=0.6.0} dependencies: assert-plus: 1.0.0 @@ -4715,10 +4507,10 @@ packages: stylus: optional: true dependencies: - esbuild: 0.14.45 + esbuild: 0.14.47 postcss: 8.4.14 - resolve: 1.22.0 - rollup: 2.75.6 + resolve: 1.22.1 + rollup: 2.75.7 optionalDependencies: fsevents: 2.3.2 dev: true diff --git a/src/index.ts b/src/index.ts index 48b21a05fa8..8a6b7ecc6b6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -39,7 +39,7 @@ export type { } from './modules/color'; export { Gender } from './modules/name'; export type { GenderType } from './modules/name'; -export { ChemicalElement, Unit } from './modules/science'; +export type { ChemicalElement, Unit } from './modules/science'; export { Faker }; // since we are requiring the top level of faker, load all locales by default diff --git a/src/locales/en/hacker/abbreviation.ts b/src/locales/en/hacker/abbreviation.ts index 7757987e45b..8691d668b35 100644 --- a/src/locales/en/hacker/abbreviation.ts +++ b/src/locales/en/hacker/abbreviation.ts @@ -1,31 +1,44 @@ export default [ - 'TCP', - 'HTTP', - 'SDD', - 'RAM', - 'GB', - 'CSS', - 'SSL', + 'ADP', 'AGP', - 'SQL', - 'FTP', - 'PCI', 'AI', - 'ADP', - 'RSS', - 'XML', - 'EXE', + 'API', + 'ASCII', + 'CLI', 'COM', + 'CSS', + 'DNS', + 'DRAM', + 'EXE', + 'FTP', + 'GB', 'HDD', - 'THX', - 'SMTP', - 'SMS', - 'USB', + 'HEX', + 'HTTP', + 'IB', + 'IP', + 'JBOD', + 'JSON', + 'OCR', + 'PCI', 'PNG', + 'RAM', + 'RSS', 'SAS', - 'IB', 'SCSI', - 'JSON', + 'SDD', + 'SMS', + 'SMTP', + 'SQL', + 'SSD', + 'SSL', + 'TCP', + 'THX', + 'TLS', + 'UDP', + 'USB', + 'UTF8', + 'VGA', + 'XML', 'XSS', - 'JBOD', ]; diff --git a/src/locales/pl/address/building_number.ts b/src/locales/pl/address/building_number.ts index 50c31ccbe9e..801cb7df21f 100644 --- a/src/locales/pl/address/building_number.ts +++ b/src/locales/pl/address/building_number.ts @@ -1 +1 @@ -export default ['#####', '####', '###']; +export default ['###', '##', '##a', '##b', '##c', '#/#']; diff --git a/src/locales/pl/address/city_name.ts b/src/locales/pl/address/city_name.ts index 054f4f2dd7a..9ecc9455509 100644 --- a/src/locales/pl/address/city_name.ts +++ b/src/locales/pl/address/city_name.ts @@ -131,8 +131,7 @@ export default [ 'Dębno', 'Dobczyce', 'Dobiegniew', - 'Dobra (powiat łobeski)', - 'Dobra (powiat turecki)', + 'Dobra', 'Dobre Miasto', 'Dobrodzień', 'Dobrzany', @@ -239,8 +238,7 @@ export default [ 'Jeziorany', 'Jędrzejów', 'Jordanów', - 'Józefów (powiat biłgorajski)', - 'Józefów (powiat otwocki)', + 'Józefów', 'Jutrosin', 'Kalety', 'Kalisz', diff --git a/src/locales/pl/address/country.ts b/src/locales/pl/address/country.ts index 346088d4dbc..dd0eddc0b1a 100644 --- a/src/locales/pl/address/country.ts +++ b/src/locales/pl/address/country.ts @@ -22,7 +22,6 @@ export default [ 'Białoruś', 'Birma', 'Boliwia', - 'Sucre', 'Bośnia i Hercegowina', 'Botswana', 'Brazylia', @@ -46,6 +45,7 @@ export default [ 'Ekwador', 'Erytrea', 'Estonia', + 'Eswatini', 'Etiopia', 'Fidżi', 'Filipiny', @@ -65,7 +65,6 @@ export default [ 'Haiti', 'Hiszpania', 'Holandia', - 'Haga', 'Honduras', 'Indie', 'Indonezja', @@ -103,7 +102,7 @@ export default [ 'Litwa', 'Luksemburg', 'Łotwa', - 'Macedonia', + 'Macedonia Północna', 'Madagaskar', 'Malawi', 'Malediwy', @@ -136,7 +135,6 @@ export default [ 'Paragwaj', 'Peru', 'Polska', - '322 575', 'Portugalia', 'Republika Południowej Afryki', 'Republika Środkowoafrykańska', @@ -160,7 +158,6 @@ export default [ 'Somalia', 'Sri Lanka', 'Stany Zjednoczone', - 'Suazi', 'Sudan', 'Sudan Południowy', 'Surinam', @@ -178,7 +175,6 @@ export default [ 'Turcja', 'Turkmenistan', 'Tuvalu', - 'Funafuti', 'Uganda', 'Ukraina', 'Urugwaj', diff --git a/src/locales/pl/address/secondary_address.ts b/src/locales/pl/address/secondary_address.ts index 6f2a5cc8c9e..8adcf747042 100644 --- a/src/locales/pl/address/secondary_address.ts +++ b/src/locales/pl/address/secondary_address.ts @@ -1 +1 @@ -export default ['Apt. ###', 'Suite ###']; +export default ['m. ###']; diff --git a/src/locales/pl/address/state.ts b/src/locales/pl/address/state.ts index 356c0568a5b..0d7d3c6f653 100644 --- a/src/locales/pl/address/state.ts +++ b/src/locales/pl/address/state.ts @@ -1,18 +1,18 @@ export default [ - 'Dolnośląskie', - 'Kujawsko-pomorskie', - 'Lubelskie', - 'Lubuskie', - 'Łódzkie', - 'Małopolskie', - 'Mazowieckie', - 'Opolskie', - 'Podkarpackie', - 'Podlaskie', - 'Pomorskie', - 'Śląskie', - 'Świętokrzyskie', - 'Warmińsko-mazurskie', - 'Wielkopolskie', - 'Zachodniopomorskie', + 'dolnośląskie', + 'kujawsko-pomorskie', + 'lubelskie', + 'lubuskie', + 'łódzkie', + 'małopolskie', + 'mazowieckie', + 'opolskie', + 'podkarpackie', + 'podlaskie', + 'pomorskie', + 'śląskie', + 'świętokrzyskie', + 'warmińsko-mazurskie', + 'wielkopolskie', + 'zachodniopomorskie', ]; diff --git a/src/locales/pl/address/state_abbr.ts b/src/locales/pl/address/state_abbr.ts index f823f0040c9..3e4620508ec 100644 --- a/src/locales/pl/address/state_abbr.ts +++ b/src/locales/pl/address/state_abbr.ts @@ -1,18 +1,18 @@ export default [ - 'DŚ', + 'DS', 'KP', + 'LU', 'LB', - 'LS', - 'ŁD', - 'MP', + 'LD', + 'MA', 'MZ', 'OP', 'PK', - 'PL', + 'PD', 'PM', - 'ŚL', - 'ŚK', - 'WM', + 'SL', + 'SK', + 'WN', 'WP', 'ZP', ]; diff --git a/src/locales/pl/color/human.ts b/src/locales/pl/color/human.ts new file mode 100644 index 00000000000..164d25bb603 --- /dev/null +++ b/src/locales/pl/color/human.ts @@ -0,0 +1,13 @@ +export default [ + 'czerwony', + 'zielony', + 'niebieski', + 'żółty', + 'pomarańczowy', + 'granatowy', + 'szary', + 'biały', + 'czarny', + 'fioletowy', + 'różowy', +]; diff --git a/src/locales/pl/color/index.ts b/src/locales/pl/color/index.ts new file mode 100644 index 00000000000..79cc39f02f3 --- /dev/null +++ b/src/locales/pl/color/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { ColorDefinitions } from '../../..'; +import human from './human'; + +const color: ColorDefinitions = { + human, +}; + +export default color; diff --git a/src/locales/pl/company/adjetive.ts b/src/locales/pl/company/adjective.ts similarity index 100% rename from src/locales/pl/company/adjetive.ts rename to src/locales/pl/company/adjective.ts diff --git a/src/locales/pl/company/index.ts b/src/locales/pl/company/index.ts index 777ef05cbbc..abdbc9f5334 100644 --- a/src/locales/pl/company/index.ts +++ b/src/locales/pl/company/index.ts @@ -3,7 +3,7 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import adjetive from './adjetive'; +import adjective from './adjective'; import bs_adjective from './bs_adjective'; import bs_noun from './bs_noun'; import bs_verb from './bs_verb'; @@ -13,7 +13,7 @@ import noun from './noun'; import suffix from './suffix'; const company: CompanyDefinitions = { - adjetive, + adjective, bs_adjective, bs_noun, bs_verb, diff --git a/src/locales/pl/company/suffix.ts b/src/locales/pl/company/suffix.ts index bd6389eb253..a60bb130e95 100644 --- a/src/locales/pl/company/suffix.ts +++ b/src/locales/pl/company/suffix.ts @@ -1 +1 @@ -export default ['Inc', 'and Sons', 'LLC', 'Group']; +export default ['S.A.', 'z o.o', 'Sp. j.', 'Sp. p.', 'Sp. k.', 'SKA', 's.c.']; diff --git a/src/locales/pl/index.ts b/src/locales/pl/index.ts index c08a3ec8ab6..e3c080938fd 100644 --- a/src/locales/pl/index.ts +++ b/src/locales/pl/index.ts @@ -5,21 +5,29 @@ import type { LocaleDefinition } from '../..'; import address from './address'; import cell_phone from './cell_phone'; +import color from './color'; import company from './company'; import internet from './internet'; import lorem from './lorem'; +import music from './music'; import name_ from './name'; import phone_number from './phone_number'; +import science from './science'; +import team from './team'; const pl: LocaleDefinition = { title: 'Polish', address, cell_phone, + color, company, internet, lorem, + music, name: name_, phone_number, + science, + team, }; export default pl; diff --git a/src/locales/pl/music/genre.ts b/src/locales/pl/music/genre.ts new file mode 100644 index 00000000000..99a07dda7e5 --- /dev/null +++ b/src/locales/pl/music/genre.ts @@ -0,0 +1,20 @@ +export default [ + 'Alternatywna', + 'Blues', + 'Country', + 'Disco polo', + 'Elektroniczna', + 'Funk', + 'Hip Hop', + 'Indie Pop', + 'Jazz', + 'Klasyczna', + 'Latynoska', + 'Ludowa', + 'Metal', + 'Pop', + 'Rap', + 'Reggae', + 'Rock', + 'Soul', +]; diff --git a/src/locales/pl/music/index.ts b/src/locales/pl/music/index.ts new file mode 100644 index 00000000000..aefacf0e5a3 --- /dev/null +++ b/src/locales/pl/music/index.ts @@ -0,0 +1,14 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { MusicDefinitions } from '../../..'; +import genre from './genre'; +import song_name from './song_name'; + +const music: MusicDefinitions = { + genre, + song_name, +}; + +export default music; diff --git a/src/locales/pl/music/song_name.ts b/src/locales/pl/music/song_name.ts new file mode 100644 index 00000000000..886ccc4069b --- /dev/null +++ b/src/locales/pl/music/song_name.ts @@ -0,0 +1,356 @@ +export default [ + '12 Groszy', + '24.11.94', + '51', + 'A To Co Mam', + 'Adriatyk, Ocean Gorący', + 'Ale Jestem', + 'Aleja Gwiazd', + 'Arahja', + 'Autobiografia', + 'Autystyczny', + 'Babę Zesłał Bóg', + 'Ballada 07', + 'Baranek', + 'Beksa', + 'Bema Pamięci Żałobny - Rapsod', + 'Berlin Zachodni', + 'Biała Armia', + 'Biała Flaga', + 'Biały Krzyż', + 'Biegnij Dalej Sam', + 'Bieszczadzkie Anioły', + 'Bo Jesteś Ty', + 'Bo Jo Cie Kochom', + 'Bombonierka', + 'Boskie Buenos', + 'Bracka', + 'Buka', + 'Butelki Z Benzyną I Kamienie', + 'Byłam Różą', + 'Byłaś Serca Biciem', + 'Bóg', + "C'Est La Vie - Paryż Z Pocztówki", + 'Celina', + 'Chcemy Być Sobą', + 'Chciałbym Umrzeć Z Miłości', + 'Chciałem Być', + 'Chodź, Pomaluj Mój Świat', + 'Chłopcy', + 'Ciche Dni', + 'Cichosza', + 'Ciepły Wiatr', + 'Cień Wielkiej Góry', + 'Ciągnik', + 'Co Mi Panie Dasz', + 'Cud Niepamięci', + 'Cykady Na Cykladach', + 'Czarne Słońca', + 'Czarny Blues O Czwartej Nad Ranem', + 'Czas Nas Uczy Pogody', + 'Czas Ołowiu', + 'Czerwony Jak Cegła', + 'Cztery Pokoje', + 'Człowiek Z Liściem', + 'Deszcz', + 'Deszcz Na Betonie', + 'Deszcz W Cisnej', + 'Dla Ciebie', + 'Dmuchawce, Latawce, Wiatr', + 'Dni, Których Nie Znamy', + 'Do Ani', + 'Do Kołyski', + 'Do Prostego Człowieka', + 'Dom', + 'Dorosłe Dzieci', + 'Dwa Ognie', + 'Dwa Serca, Dwa Smutki', + 'Dzieci', + 'Dziewczyna Bez Zęba Na Przedzie', + 'Dzień Dobry, Kocham Cię', + 'Dziwny Jest Ten Świat', + 'Dziś Późno Pójdę Spać', + 'Długość Dźwięku Samotności', + 'Elektryczny', + 'Eli Lama Sabachtani', + 'Ezoteryczny Poznań', + 'Filandia', + 'Film', + 'Flota Zjednoczonych Sił', + 'Fotograf Brok', + 'Gdy Nie Ma Dzieci W Domu', + 'Gdybym', + 'Gołębi Puch', + 'Granda', + 'Grande Valse Brillante', + 'Grażka', + 'Groszki I Róże', + 'Harry', + 'Hej Wy', + 'Hej, Czy Nie Wiecie', + 'Hi-Fi', + 'Horses', + 'Hydropiekłowstąpienie', + 'I Ciebie Też, Bardzo', + 'I Nikomu Nie Wolno Się Z Tego Śmiać', + 'I Tak Warto Żyć', + 'I Wszystko Się Może Zdarzyć', + 'IV Liceum', + 'Ja Sowa', + 'Ja Wysiadam', + 'Jaka Róża, Taki Cierń', + 'Jaskółka Uwięziona', + 'Jednego Serca', + 'Jedwab', + 'Jedyne Co Mam', + 'Jej Portret', + 'Jenny', + 'Jest Taki Samotny Dom', + 'Jestem Bogiem', + 'Jestem W Niebie', + 'Jesteś Lekiem Na Całe Zło', + 'Jesteśmy Na Wczasach', + 'Jeszcze Będzie Przepięknie', + 'Jeszcze Się Tam Żagiel Bieli', + 'Jeszcze W Zielone Gramy', + 'Jezu Jak Się Cieszę', + 'Jeśli Wiesz Co Chcę Powiedzieć', + 'Jolka, Jolka, Pamiętasz', + 'Jutro Możemy Być Szczęśliwi', + 'Kapitan Polska', + 'Karuzela Z Madonnami', + 'Karwoski', + 'Kawałek Podłogi', + 'Kiedy Byłem Małym Chłopcem', + 'Kiedy Powiem Sobie Dość', + 'King', + 'King Bruce Lee Karate Mistrz', + 'Klub Wesołego Szampana', + 'Kobiety Jak Te Kwiaty', + 'Kocham Być Z Tobą', + 'Kocham Cię', + 'Kocham Cię Jak Irlandię', + 'Kocham Cię Kochanie Moje', + 'Kocham Wolność', + 'Kochana', + 'Kochać Inaczej', + 'Koncert Jesienny Na Dwa Świerszcze I Wiatr W Kominie', + 'Konstytucje', + 'Korowód', + 'Kosmiczne Energie', + 'Kołysanka Dla Nieznajomej', + 'Krakowski Spleen', + 'Kraków', + 'Krew Boga', + 'Kryzysowa Narzeczona', + 'Kwiaty We Włosach', + 'Lamparty', + 'Leszek Żukowski', + 'Lewe Lewe Loff', + 'Lipstick On The Glass', + 'List', + 'List Do M.', + 'Los, Cebula I Krokodyle Łzy', + 'Lubię Mówić Z Tobą', + 'Lubię Wracać Tam Gdzie Byłem', + 'Lucciola', + 'Lucy Phere', + 'Malcziki', + 'Marchewkowe Pole', + 'Maszynka Do Świerkania', + 'Małe Tęsknoty', + 'Małomiasteczkowy', + 'Meluzyna', + 'Mimo Wszystko', + 'Mississippi W Ogniu', + 'Między Ciszą A Ciszą', + 'Miłość, Miłość', + 'Mniej Niż Zero', + 'Modlitwa', + 'Modlitwa III - Pozwól Mi', + 'Modlitwa O Wschodzie Słońca', + 'Mogło Być Nic', + 'Moja I Twoja Nadzieja', + 'Moja Krew', + 'Moje Bieszczady', + 'Mury', + 'Mój Dom', + 'Mówię Ci Że', + 'Na Falochronie', + 'Na Szczycie', + 'Na Zakręcie', + 'Nadzieja', + 'Naprawdę Nie Dzieje Się Nic', + 'Następna Stacja', + 'Nasza Klasa', + 'Nic Nie Może Wiecznie Trwać', + 'Nie Ma, Nie Ma Ciebie', + 'Nie Mam Dla Ciebie Miłości', + 'Nie Przenoście Nam Stolicy Do Krakowa', + 'Nie Pytaj O Polskę', + 'Nie Płacz Ewka', + 'Nie Raj', + 'Nie Wierz Nigdy Kobiecie', + 'Niebo Było Różowe', + 'Niech Żyje Bal', + 'Niemiłość', + 'Niepokonani', + 'Niewiele Ci Mogę Dać', + 'Nieznajomy', + 'Niezwyciężony', + 'Nikt Tak Pięknie Nie Mówił, Że Się Boi Miłości', + 'Nim Stanie Się Tak, Jak Gdyby Nigdy Nic', + 'Nim Wstanie Dzień', + 'Noc Komety', + 'Nóż', + 'O! Ela', + 'Objazdowe Nieme Kino', + 'Obudź Się', + 'Obława', + 'Ocalić Od Zapomnienia', + 'Och Życie, Kocham Cię Nad Życie', + 'Oczy Tej Małej', + 'Odchodząc', + 'Odkryjemy Miłość Nieznaną', + 'Ok, Boomer!', + 'Oni Zaraz Przyjdą Tu', + 'Orkiestra', + 'Ostatni', + 'Pamiętajcie O Ogrodach', + 'Papierowy Księżyc', + 'Partyzant', + 'Paryż - Moskwa 17.15', + 'Paw', + 'Peggy Brown', + 'Piosenka Jest Dobra Na Wszystko', + 'Piosenka Księżycowa', + 'Piosenka Młodych Wioślarzy', + 'Piła Tango', + 'Piłem W Spale, Spałem W Pile', + 'Plamy Na Słońcu', + 'Plus I Minus', + 'Po Co Wolność', + 'Po Prostu Bądź', + 'Początek', + 'Pod Niebem', + 'Pod Papugami', + 'Pod Prąd', + 'Podaruj Mi Trochę Słońca', + 'Pola', + 'Polska', + 'Polski', + 'Polsko', + 'Przebudzenie', + 'Przeżyj To Sam', + 'Prócz Ciebie Nic', + 'Psalm Stojących W Kolejce', + 'Płoną Góry, Płoną Lasy', + 'Raz Na Milion Lat', + "Rosemary'S Baby", + 'Rower', + 'Rzuć To Wszystko Co Złe', + 'Róbmy Swoje', + 'Samba Przed Rozstaniem', + 'Scenariusz Dla Moich Sąsiadów', + 'Sen', + 'Sen O Dolinie', + 'Sen O Victorii', + 'Sen O Warszawie', + 'Serce To Jest Muzyk', + 'Sie Ściemnia', + 'Skazany Na Bluesa', + 'Skóra', + 'Skłamałam', + 'Sobie I Wam', + 'Son Of The Blue Sky', + 'Sorry Polsko', + 'Spadam', + 'Spalam Się', + 'Spytaj Milicjanta', + 'Stare Drzewa', + 'Statki Na Niebie', + 'Strzeż Się Tych Miejsc', + 'Syreny', + 'Szaroróżowe', + 'Szał Niebieskich Ciał', + 'Szklana Pogoda', + 'Sztuka Latania', + 'Słodkiego Miłego Życia', + 'Ta Noc Do Innych Jest Niepodobna', + 'Tak Mi Się Nie Chce', + 'Tak, Tak... To Ja', + 'Tam, Gdzie Nie Sięga Wzrok', + 'Taniec Eleny', + 'Te Smaki I Zapachy', + 'Teksański', + 'Telefony', + 'Temat Serialu "Polskie Drogi"', + 'The Depth Of Self-Delusion', + 'To Co Czujesz, To Co Wiesz', + 'To Ostatnia Niedziela', + 'To Tylko Tango', + 'To Wychowanie', + 'Tolerancja / Na Miły Bóg', + 'Transmission Into Your Heart', + 'Trudne Życzenia', + 'Trudno Nie Wierzyć W Nic', + 'Trudno Tak (Razem Być Nam Ze Sobą...)', + 'Trzy Zapałki', + 'Trójkąty I Kwadraty', + 'Tuż Przed Północą', + 'Twoja Lorelei', + 'Twój Ból Jest Lepszy Niż Mój', + 'Tyle Słońca W Całym Mieście', + 'Ucieczka Z Tropiku', + 'Uciekaj Moje Serce', + 'Varsovie', + 'W Deszczu Maleńkich Żółtych Kwiatów', + 'W Dobrą Stronę', + 'W Domach Z Betonu Nie Ma Wolnej Miłości', + 'W Moim Magicznym Domu', + 'W Moim Ogrodzie', + 'W Wielkim Mieście', + 'W Żółtych Płomieniach Liści', + 'Warszawa', + 'Wataha', + 'Wciąż Bardziej Obcy', + 'Wehikuł Czasu', + 'Whisky', + 'Wieża Radości, Wieża Samotności', + 'Windą Do Nieba', + 'Wiosna, Ach To Ty', + 'Wiśnia', + 'Wodymidaj', + 'Wojenka', + 'Wspomnienie', + 'Wszystko Czego Dziś Chcę', + 'Wyjątkowo Zimny Maj', + 'Wymyśliłem Ciebie', + 'Wyspa, Drzewo, Zamek', + 'Władza', + 'Z Imbirem', + 'Z Nim Będziesz Szczęśliwsza', + 'Z Tobą / Do Domu', + 'Z Tobą Chcę Oglądać Świat', + 'Za Ostatni Grosz', + 'Zacznij Od Bacha', + 'Zanim Pójdę', + 'Zanim Zrozumiesz', + 'Zaopiekuj Się Mną', + 'Zaprzepaszczone Siły Wielkiej Armii Świętych Znaków', + 'Zapytaj Mnie Czy Cię Kocham', + 'Zawsze Tam Gdzie Ty', + 'Zazdrość', + 'Załoga G', + 'Zegarmistrz Światła', + 'Znów Wędrujemy', + 'Zostań', + '[Sic!]', + 'Łza Dla Cieniów Minionych', + 'Ślady', + 'Śmierć W Bikini', + 'Śpiewać Każdy Może', + 'Śpij Kochanie, Śpij', + 'Świecie Nasz', + 'Żyję W Kraju', +]; diff --git a/src/locales/pl/science/chemicalElement.ts b/src/locales/pl/science/chemicalElement.ts new file mode 100644 index 00000000000..82a30a4600c --- /dev/null +++ b/src/locales/pl/science/chemicalElement.ts @@ -0,0 +1,592 @@ +export default Object.freeze([ + { + symbol: 'H', + name: 'Wodór', + atomicNumber: 1, + }, + { + symbol: 'He', + name: 'Hel', + atomicNumber: 2, + }, + { + symbol: 'Li', + name: 'Lit', + atomicNumber: 3, + }, + { + symbol: 'Be', + name: 'Beryl', + atomicNumber: 4, + }, + { + symbol: 'B', + name: 'Bor', + atomicNumber: 5, + }, + { + symbol: 'C', + name: 'Węgiel', + atomicNumber: 6, + }, + { + symbol: 'N', + name: 'Azot', + atomicNumber: 7, + }, + { + symbol: 'O', + name: 'Tlen', + atomicNumber: 8, + }, + { + symbol: 'F', + name: 'Fluor', + atomicNumber: 9, + }, + { + symbol: 'Ne', + name: 'Neon', + atomicNumber: 10, + }, + { + symbol: 'Na', + name: 'Sód', + atomicNumber: 11, + }, + { + symbol: 'Mg', + name: 'Magnez', + atomicNumber: 12, + }, + { + symbol: 'Al', + name: 'Glin', + atomicNumber: 13, + }, + { + symbol: 'Si', + name: 'Krzem', + atomicNumber: 14, + }, + { + symbol: 'P', + name: 'Fosfor', + atomicNumber: 15, + }, + { + symbol: 'S', + name: 'Siarka', + atomicNumber: 16, + }, + { + symbol: 'Cl', + name: 'Chlor', + atomicNumber: 17, + }, + { + symbol: 'Ar', + name: 'Argon', + atomicNumber: 18, + }, + { + symbol: 'K', + name: 'Potas', + atomicNumber: 19, + }, + { + symbol: 'Ca', + name: 'Wapń', + atomicNumber: 20, + }, + { + symbol: 'Sc', + name: 'Skand', + atomicNumber: 21, + }, + { + symbol: 'Ti', + name: 'Tytan', + atomicNumber: 22, + }, + { + symbol: 'V', + name: 'Wanad', + atomicNumber: 23, + }, + { + symbol: 'Cr', + name: 'Chrom', + atomicNumber: 24, + }, + { + symbol: 'Mn', + name: 'Mangan', + atomicNumber: 25, + }, + { + symbol: 'Fe', + name: 'Żelazo', + atomicNumber: 26, + }, + { + symbol: 'Co', + name: 'Kobalt', + atomicNumber: 27, + }, + { + symbol: 'Ni', + name: 'Nikiel', + atomicNumber: 28, + }, + { + symbol: 'Cu', + name: 'Miedź', + atomicNumber: 29, + }, + { + symbol: 'Zn', + name: 'Cynk', + atomicNumber: 30, + }, + { + symbol: 'Ga', + name: 'Gal', + atomicNumber: 31, + }, + { + symbol: 'Ge', + name: 'German', + atomicNumber: 32, + }, + { + symbol: 'As', + name: 'Arsen', + atomicNumber: 33, + }, + { + symbol: 'Se', + name: 'Selen', + atomicNumber: 34, + }, + { + symbol: 'Br', + name: 'Brom', + atomicNumber: 35, + }, + { + symbol: 'Kr', + name: 'Krypton', + atomicNumber: 36, + }, + { + symbol: 'Rb', + name: 'Rubid', + atomicNumber: 37, + }, + { + symbol: 'Sr', + name: 'Stront', + atomicNumber: 38, + }, + { + symbol: 'Y', + name: 'Itr', + atomicNumber: 39, + }, + { + symbol: 'Zr', + name: 'Cyrkon', + atomicNumber: 40, + }, + { + symbol: 'Nb', + name: 'Niob', + atomicNumber: 41, + }, + { + symbol: 'Mo', + name: 'Molibden', + atomicNumber: 42, + }, + { + symbol: 'Tc', + name: 'Technet', + atomicNumber: 43, + }, + { + symbol: 'Ru', + name: 'Ruten', + atomicNumber: 44, + }, + { + symbol: 'Rh', + name: 'Rod', + atomicNumber: 45, + }, + { + symbol: 'Pd', + name: 'Pallad', + atomicNumber: 46, + }, + { + symbol: 'Ag', + name: 'Srebro', + atomicNumber: 47, + }, + { + symbol: 'Cd', + name: 'Kadm', + atomicNumber: 48, + }, + { + symbol: 'In', + name: 'Ind', + atomicNumber: 49, + }, + { + symbol: 'Sn', + name: 'Cyna', + atomicNumber: 50, + }, + { + symbol: 'Sb', + name: 'Antymon', + atomicNumber: 51, + }, + { + symbol: 'Te', + name: 'Tellur', + atomicNumber: 52, + }, + { + symbol: 'I', + name: 'Jod', + atomicNumber: 53, + }, + { + symbol: 'Xe', + name: 'Ksenon', + atomicNumber: 54, + }, + { + symbol: 'Cs', + name: 'Cez', + atomicNumber: 55, + }, + { + symbol: 'Ba', + name: 'Bar', + atomicNumber: 56, + }, + { + symbol: 'La', + name: 'Lantan', + atomicNumber: 57, + }, + { + symbol: 'Ce', + name: 'Cer', + atomicNumber: 58, + }, + { + symbol: 'Pr', + name: 'Prazeodym', + atomicNumber: 59, + }, + { + symbol: 'Nd', + name: 'Neodym', + atomicNumber: 60, + }, + { + symbol: 'Pm', + name: 'Promet', + atomicNumber: 61, + }, + { + symbol: 'Sm', + name: 'Samar', + atomicNumber: 62, + }, + { + symbol: 'Eu', + name: 'Europ', + atomicNumber: 63, + }, + { + symbol: 'Gd', + name: 'Gadolin', + atomicNumber: 64, + }, + { + symbol: 'Tb', + name: 'Terb', + atomicNumber: 65, + }, + { + symbol: 'Dy', + name: 'Dysproz', + atomicNumber: 66, + }, + { + symbol: 'Ho', + name: 'Holm', + atomicNumber: 67, + }, + { + symbol: 'Er', + name: 'Erb', + atomicNumber: 68, + }, + { + symbol: 'Tm', + name: 'Tul', + atomicNumber: 69, + }, + { + symbol: 'Yb', + name: 'Iterb', + atomicNumber: 70, + }, + { + symbol: 'Lu', + name: 'Lutet', + atomicNumber: 71, + }, + { + symbol: 'Hf', + name: 'Hafn', + atomicNumber: 72, + }, + { + symbol: 'Ta', + name: 'Tantal', + atomicNumber: 73, + }, + { + symbol: 'W', + name: 'Wolfram', + atomicNumber: 74, + }, + { + symbol: 'Re', + name: 'Ren', + atomicNumber: 75, + }, + { + symbol: 'Os', + name: 'Osm', + atomicNumber: 76, + }, + { + symbol: 'Ir', + name: 'Iryd', + atomicNumber: 77, + }, + { + symbol: 'Pt', + name: 'Platyna', + atomicNumber: 78, + }, + { + symbol: 'Au', + name: 'Złoto', + atomicNumber: 79, + }, + { + symbol: 'Hg', + name: 'Rtęć', + atomicNumber: 80, + }, + { + symbol: 'Tl', + name: 'Tal', + atomicNumber: 81, + }, + { + symbol: 'Pb', + name: 'Ołów', + atomicNumber: 82, + }, + { + symbol: 'Bi', + name: 'Bizmut', + atomicNumber: 83, + }, + { + symbol: 'Po', + name: 'Polon', + atomicNumber: 84, + }, + { + symbol: 'At', + name: 'Astat', + atomicNumber: 85, + }, + { + symbol: 'Rn', + name: 'Radon', + atomicNumber: 86, + }, + { + symbol: 'Fr', + name: 'Frans', + atomicNumber: 87, + }, + { + symbol: 'Ra', + name: 'Rad', + atomicNumber: 88, + }, + { + symbol: 'Ac', + name: 'Aktyn', + atomicNumber: 89, + }, + { + symbol: 'Th', + name: 'Tor', + atomicNumber: 90, + }, + { + symbol: 'Pa', + name: 'Protaktyn', + atomicNumber: 91, + }, + { + symbol: 'U', + name: 'Uran', + atomicNumber: 92, + }, + { + symbol: 'Np', + name: 'Neptun', + atomicNumber: 93, + }, + { + symbol: 'Pu', + name: 'Pluton', + atomicNumber: 94, + }, + { + symbol: 'Am', + name: 'Ameryk', + atomicNumber: 95, + }, + { + symbol: 'Cm', + name: 'Kiur', + atomicNumber: 96, + }, + { + symbol: 'Bk', + name: 'Berkel', + atomicNumber: 97, + }, + { + symbol: 'Cf', + name: 'Kaliforn', + atomicNumber: 98, + }, + { + symbol: 'Es', + name: 'Einstein', + atomicNumber: 99, + }, + { + symbol: 'Fm', + name: 'Ferm', + atomicNumber: 100, + }, + { + symbol: 'Md', + name: 'Mendelew', + atomicNumber: 101, + }, + { + symbol: 'No', + name: 'Nobel', + atomicNumber: 102, + }, + { + symbol: 'Lr', + name: 'Lorens', + atomicNumber: 103, + }, + { + symbol: 'Rf', + name: 'Rutherford', + atomicNumber: 104, + }, + { + symbol: 'Db', + name: 'Dubn', + atomicNumber: 105, + }, + { + symbol: 'Sg', + name: 'Seaborg', + atomicNumber: 106, + }, + { + symbol: 'Bh', + name: 'Bohr', + atomicNumber: 107, + }, + { + symbol: 'Hs', + name: 'Has', + atomicNumber: 108, + }, + { + symbol: 'Mt', + name: 'Meitner', + atomicNumber: 109, + }, + { + symbol: 'Ds', + name: 'Darmsztadt', + atomicNumber: 110, + }, + { + symbol: 'Rg', + name: 'Roentgen', + atomicNumber: 111, + }, + { + symbol: 'Cn', + name: 'Kopernik', + atomicNumber: 112, + }, + { + symbol: 'Nh', + name: 'Nihon', + atomicNumber: 113, + }, + { + symbol: 'Fl', + name: 'Flerow', + atomicNumber: 114, + }, + { + symbol: 'Mc', + name: 'Moskow', + atomicNumber: 115, + }, + { + symbol: 'Lv', + name: 'Liwermor', + atomicNumber: 116, + }, + { + symbol: 'Ts', + name: 'Tenes', + atomicNumber: 117, + }, + { + symbol: 'Og', + name: 'Oganeson', + atomicNumber: 118, + }, +]); diff --git a/src/locales/pl/science/index.ts b/src/locales/pl/science/index.ts new file mode 100644 index 00000000000..a28238b1890 --- /dev/null +++ b/src/locales/pl/science/index.ts @@ -0,0 +1,14 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { ScienceDefinitions } from '../../..'; +import chemicalElement from './chemicalElement'; +import unit from './unit'; + +const science: ScienceDefinitions = { + chemicalElement, + unit, +}; + +export default science; diff --git a/src/locales/pl/science/unit.ts b/src/locales/pl/science/unit.ts new file mode 100644 index 00000000000..f81f4d3b105 --- /dev/null +++ b/src/locales/pl/science/unit.ts @@ -0,0 +1,90 @@ +export default Object.freeze([ + { + name: 'metr', + symbol: 'm', + }, + { + name: 'sekunda', + symbol: 's', + }, + { + name: 'mol', + symbol: 'mol', + }, + { + name: 'amper', + symbol: 'A', + }, + { + name: 'kelwin', + symbol: 'K', + }, + { + name: 'kandela', + symbol: 'cd', + }, + { + name: 'kilogram', + symbol: 'kg', + }, + { + name: 'radian', + symbol: 'rad', + }, + { + name: 'herc', + symbol: 'Hz', + }, + { + name: 'niuton', + symbol: 'N', + }, + { + name: 'paskal', + symbol: 'Pa', + }, + { + name: 'dżul', + symbol: 'J', + }, + { + name: 'wat', + symbol: 'W', + }, + { + name: 'kulomb', + symbol: 'C', + }, + { + name: 'wolt', + symbol: 'V', + }, + { + name: 'om', + symbol: 'Ω', + }, + { + name: 'tesla', + symbol: 'T', + }, + { + name: 'stopień Celsjusza', + symbol: '°C', + }, + { + name: 'lumen', + symbol: 'lm', + }, + { + name: 'bekerel', + symbol: 'Bq', + }, + { + name: 'grej', + symbol: 'Gy', + }, + { + name: 'siwert', + symbol: 'Sv', + }, +]); diff --git a/src/locales/pl/team/index.ts b/src/locales/pl/team/index.ts new file mode 100644 index 00000000000..c7cdae577bc --- /dev/null +++ b/src/locales/pl/team/index.ts @@ -0,0 +1,13 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import name_ from './name'; +import prefix from './prefix'; + +const team = { + name: name_, + prefix, +}; + +export default team; diff --git a/src/locales/pl/team/name.ts b/src/locales/pl/team/name.ts new file mode 100644 index 00000000000..3b22d3ab82b --- /dev/null +++ b/src/locales/pl/team/name.ts @@ -0,0 +1 @@ +export default ['{{team.prefix}} {{address.city}}']; diff --git a/src/locales/pl/team/prefix.ts b/src/locales/pl/team/prefix.ts new file mode 100644 index 00000000000..71ddadf7791 --- /dev/null +++ b/src/locales/pl/team/prefix.ts @@ -0,0 +1,13 @@ +export default [ + 'GKS', + 'Górnik', + 'KS', + 'LZS', + 'Piast', + 'Pogoń', + 'Polonia', + 'Ruch', + 'Stal', + 'Unia', + 'Zjednoczenie', +]; diff --git a/src/modules/name/index.ts b/src/modules/name/index.ts index f1d357e7277..009b35fc45f 100644 --- a/src/modules/name/index.ts +++ b/src/modules/name/index.ts @@ -148,33 +148,33 @@ export class Name { * faker.name.findName(undefined, undefined, 'male') // 'Fernando Schaefer' */ findName(firstName?: string, lastName?: string, gender?: GenderType): string { - const variant = this.faker.datatype.number(8); - let prefix = ''; - let suffix = ''; - const normalizedGender: GenderType = gender ?? this.faker.helpers.arrayElement(['female', 'male']); firstName = firstName || this.firstName(normalizedGender); lastName = lastName || this.lastName(normalizedGender); - switch (variant) { - // TODO @Shinigami92 2022-03-21: Add possibility to have a prefix together with a suffix - case 0: - prefix = this.prefix(gender); - if (prefix) { - return `${prefix} ${firstName} ${lastName}`; - } - // TODO @Shinigami92 2022-01-21: Not sure if this fallthrough is wanted - // eslint-disable-next-line no-fallthrough - case 1: - suffix = this.suffix(); - if (suffix) { - return `${firstName} ${lastName} ${suffix}`; - } + const nameParts: string[] = []; + const prefix = this.faker.helpers.maybe(() => this.prefix(gender), { + probability: 0.125, + }); + if (prefix) { + nameParts.push(prefix); } - return `${firstName} ${lastName}`; + nameParts.push(firstName); + nameParts.push(lastName); + + const suffix = this.faker.helpers.maybe(() => this.suffix(), { + probability: 0.125, + }); + if (suffix) { + nameParts.push(suffix); + } + + const fullName = nameParts.join(' '); + + return fullName; } /** diff --git a/src/modules/random/index.ts b/src/modules/random/index.ts index 727ec8fb723..3071e33e825 100644 --- a/src/modules/random/index.ts +++ b/src/modules/random/index.ts @@ -233,7 +233,6 @@ export class Random { * faker.random.alpha(10) // 'qccrabobaf' * faker.random.alpha({ count: 5, casing: 'upper', bannedChars: ['A'] }) // 'DTCIC' */ - // TODO @Shinigami92 2022-02-14: Tests covered `(count, options)`, but they were never typed like that alpha( options: | number diff --git a/test/__snapshots__/address.spec.ts.snap b/test/__snapshots__/address.spec.ts.snap new file mode 100644 index 00000000000..04956b4e2d9 --- /dev/null +++ b/test/__snapshots__/address.spec.ts.snap @@ -0,0 +1,166 @@ +// Vitest Snapshot v1 + +exports[`address > seed: 42 > cardinalDirection() > returns abbreviation when useAbbr is true 1`] = `"E"`; + +exports[`address > seed: 42 > cardinalDirection() > returns random cardinal direction 1`] = `"East"`; + +exports[`address > seed: 42 > city() 1`] = `"Port Valentine"`; + +exports[`address > seed: 42 > cityName() 1`] = `"Gulfport"`; + +exports[`address > seed: 42 > cityPrefix() 1`] = `"West"`; + +exports[`address > seed: 42 > citySuffix() 1`] = `"bury"`; + +exports[`address > seed: 42 > country() 1`] = `"Haiti"`; + +exports[`address > seed: 42 > countryCode() 1`] = `"GY"`; + +exports[`address > seed: 42 > county() 1`] = `"Berkshire"`; + +exports[`address > seed: 42 > direction() > returns abbreviation when useAbbr is true 1`] = `"S"`; + +exports[`address > seed: 42 > direction() > returns random direction 1`] = `"South"`; + +exports[`address > seed: 42 > direction() > should not return abbreviation when useAbbr is false 1`] = `"South"`; + +exports[`address > seed: 42 > nearbyGPSCoordinate() > returns expected coordinates 1`] = ` +[ + "0.0814", + "-0.0809", +] +`; + +exports[`address > seed: 42 > ordinalDirection() > returns abbreviation when useAbbr is true 1`] = `"NW"`; + +exports[`address > seed: 42 > ordinalDirection() > returns random ordinal direction 1`] = `"Northwest"`; + +exports[`address > seed: 42 > secondaryAddress() 1`] = `"Apt. 791"`; + +exports[`address > seed: 42 > state() 1`] = `"Maine"`; + +exports[`address > seed: 42 > stateAbbr() 1`] = `"ME"`; + +exports[`address > seed: 42 > streetAddress() > should return street name with a building number 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 > seed: 42 > streetName() 1`] = `"Peyton Village"`; + +exports[`address > seed: 42 > streetPrefix() 1`] = `"b"`; + +exports[`address > seed: 42 > streetSuffix() 1`] = `"Isle"`; + +exports[`address > seed: 42 > timeZone() 1`] = `"Europe/Amsterdam"`; + +exports[`address > seed: 42 > zipCode() 1`] = `"79177"`; + +exports[`address > seed: 1211 > cardinalDirection() > returns abbreviation when useAbbr is true 1`] = `"W"`; + +exports[`address > seed: 1211 > cardinalDirection() > returns random cardinal direction 1`] = `"West"`; + +exports[`address > seed: 1211 > city() 1`] = `"La Crosse"`; + +exports[`address > seed: 1211 > cityName() 1`] = `"Urbana"`; + +exports[`address > seed: 1211 > cityPrefix() 1`] = `"Fort"`; + +exports[`address > seed: 1211 > citySuffix() 1`] = `"shire"`; + +exports[`address > seed: 1211 > country() 1`] = `"Uganda"`; + +exports[`address > seed: 1211 > countryCode() 1`] = `"UM"`; + +exports[`address > seed: 1211 > county() 1`] = `"Cambridgeshire"`; + +exports[`address > seed: 1211 > direction() > returns abbreviation when useAbbr is true 1`] = `"SW"`; + +exports[`address > seed: 1211 > direction() > returns random direction 1`] = `"Southwest"`; + +exports[`address > seed: 1211 > direction() > should not return abbreviation when useAbbr is false 1`] = `"Southwest"`; + +exports[`address > seed: 1211 > nearbyGPSCoordinate() > returns expected coordinates 1`] = ` +[ + "-0.0287", + "0.0596", +] +`; + +exports[`address > seed: 1211 > ordinalDirection() > returns abbreviation when useAbbr is true 1`] = `"SW"`; + +exports[`address > seed: 1211 > ordinalDirection() > returns random ordinal direction 1`] = `"Southwest"`; + +exports[`address > seed: 1211 > secondaryAddress() 1`] = `"Suite 487"`; + +exports[`address > seed: 1211 > state() 1`] = `"Washington"`; + +exports[`address > seed: 1211 > stateAbbr() 1`] = `"WA"`; + +exports[`address > seed: 1211 > streetAddress() > should return street name with a building number 1`] = `"487 Breana Wells"`; + +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 > seed: 1211 > streetName() 1`] = `"Koch Turnpike"`; + +exports[`address > seed: 1211 > streetPrefix() 1`] = `"c"`; + +exports[`address > seed: 1211 > streetSuffix() 1`] = `"Via"`; + +exports[`address > seed: 1211 > timeZone() 1`] = `"Asia/Magadan"`; + +exports[`address > seed: 1211 > zipCode() 1`] = `"48721-9061"`; + +exports[`address > seed: 1337 > cardinalDirection() > returns abbreviation when useAbbr is true 1`] = `"E"`; + +exports[`address > seed: 1337 > cardinalDirection() > returns random cardinal direction 1`] = `"East"`; + +exports[`address > seed: 1337 > city() 1`] = `"New Carmelo"`; + +exports[`address > seed: 1337 > cityName() 1`] = `"Dubuque"`; + +exports[`address > seed: 1337 > cityPrefix() 1`] = `"West"`; + +exports[`address > seed: 1337 > citySuffix() 1`] = `"boro"`; + +exports[`address > seed: 1337 > country() 1`] = `"Equatorial Guinea"`; + +exports[`address > seed: 1337 > countryCode() 1`] = `"EH"`; + +exports[`address > seed: 1337 > county() 1`] = `"Bedfordshire"`; + +exports[`address > seed: 1337 > direction() > returns abbreviation when useAbbr is true 1`] = `"S"`; + +exports[`address > seed: 1337 > direction() > returns random direction 1`] = `"South"`; + +exports[`address > seed: 1337 > direction() > should not return abbreviation when useAbbr is false 1`] = `"South"`; + +exports[`address > seed: 1337 > nearbyGPSCoordinate() > returns expected coordinates 1`] = ` +[ + "0.0806", + "-0.0061", +] +`; + +exports[`address > seed: 1337 > ordinalDirection() > returns abbreviation when useAbbr is true 1`] = `"NW"`; + +exports[`address > seed: 1337 > ordinalDirection() > returns random ordinal direction 1`] = `"Northwest"`; + +exports[`address > seed: 1337 > secondaryAddress() 1`] = `"Apt. 512"`; + +exports[`address > seed: 1337 > state() 1`] = `"Indiana"`; + +exports[`address > seed: 1337 > stateAbbr() 1`] = `"IN"`; + +exports[`address > seed: 1337 > streetAddress() > should return street name with a building number 1`] = `"51225 Alexys Haven"`; + +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 > seed: 1337 > streetName() 1`] = `"Keith Dam"`; + +exports[`address > seed: 1337 > streetPrefix() 1`] = `"a"`; + +exports[`address > seed: 1337 > streetSuffix() 1`] = `"Forks"`; + +exports[`address > seed: 1337 > timeZone() 1`] = `"Africa/Casablanca"`; + +exports[`address > seed: 1337 > zipCode() 1`] = `"51225"`; diff --git a/test/__snapshots__/animal.spec.ts.snap b/test/__snapshots__/animal.spec.ts.snap new file mode 100644 index 00000000000..8d4b4f4dcc9 --- /dev/null +++ b/test/__snapshots__/animal.spec.ts.snap @@ -0,0 +1,85 @@ +// Vitest Snapshot v1 + +exports[`animal > seed: 42 > bear() 1`] = `"Sun bear"`; + +exports[`animal > seed: 42 > bird() 1`] = `"Iceland Gull"`; + +exports[`animal > seed: 42 > cat() 1`] = `"Himalayan"`; + +exports[`animal > seed: 42 > cetacean() 1`] = `"Pantropical Spotted Dolphin"`; + +exports[`animal > seed: 42 > cow() 1`] = `"Fleckvieh"`; + +exports[`animal > seed: 42 > crocodilia() 1`] = `"African Slender-snouted Crocodile"`; + +exports[`animal > seed: 42 > dog() 1`] = `"Garafian Shepherd"`; + +exports[`animal > seed: 42 > fish() 1`] = `"Northern snakehead"`; + +exports[`animal > seed: 42 > horse() 1`] = `"Furioso-North Star"`; + +exports[`animal > seed: 42 > insect() 1`] = `"Gouty oak gall"`; + +exports[`animal > seed: 42 > lion() 1`] = `"West African Lion"`; + +exports[`animal > seed: 42 > rabbit() 1`] = `"English Spot"`; + +exports[`animal > seed: 42 > snake() 1`] = `"Grey-banded kingsnake"`; + +exports[`animal > seed: 42 > type() 1`] = `"lion"`; + +exports[`animal > seed: 1211 > bear() 1`] = `"Polar bear"`; + +exports[`animal > seed: 1211 > bird() 1`] = `"Reed Bunting"`; + +exports[`animal > seed: 1211 > cat() 1`] = `"Tonkinese"`; + +exports[`animal > seed: 1211 > cetacean() 1`] = `"La Plata Dolphin"`; + +exports[`animal > seed: 1211 > cow() 1`] = `"Breed"`; + +exports[`animal > seed: 1211 > crocodilia() 1`] = `"Gharial"`; + +exports[`animal > seed: 1211 > dog() 1`] = `"Tibetan Spaniel"`; + +exports[`animal > seed: 1211 > fish() 1`] = `"Bigeye scad"`; + +exports[`animal > seed: 1211 > horse() 1`] = `"Ukrainian Riding Horse"`; + +exports[`animal > seed: 1211 > insect() 1`] = `"Western paper wasp"`; + +exports[`animal > seed: 1211 > lion() 1`] = `"Cape lion"`; + +exports[`animal > seed: 1211 > rabbit() 1`] = `"Silver Marten"`; + +exports[`animal > seed: 1211 > snake() 1`] = `"Tiger pit viper"`; + +exports[`animal > seed: 1211 > type() 1`] = `"horse"`; + +exports[`animal > seed: 1337 > bear() 1`] = `"Sun bear"`; + +exports[`animal > seed: 1337 > bird() 1`] = `"American Golden-Plover"`; + +exports[`animal > seed: 1337 > cat() 1`] = `"Devon Rex"`; + +exports[`animal > seed: 1337 > cetacean() 1`] = `"Costero"`; + +exports[`animal > seed: 1337 > cow() 1`] = `"Canchim"`; + +exports[`animal > seed: 1337 > crocodilia() 1`] = `"Cuvier’s Dwarf Caiman"`; + +exports[`animal > seed: 1337 > dog() 1`] = `"Chinese Crested Dog"`; + +exports[`animal > seed: 1337 > fish() 1`] = `"Jumbo flying squid"`; + +exports[`animal > seed: 1337 > horse() 1`] = `"Colorado Ranger"`; + +exports[`animal > seed: 1337 > insect() 1`] = `"Eulophid wasp"`; + +exports[`animal > seed: 1337 > lion() 1`] = `"Barbary Lion"`; + +exports[`animal > seed: 1337 > rabbit() 1`] = `"Cinnamon"`; + +exports[`animal > seed: 1337 > snake() 1`] = `"Fierce snake"`; + +exports[`animal > seed: 1337 > type() 1`] = `"bear"`; diff --git a/test/__snapshots__/color.spec.ts.snap b/test/__snapshots__/color.spec.ts.snap new file mode 100644 index 00000000000..5d74dd479c2 --- /dev/null +++ b/test/__snapshots__/color.spec.ts.snap @@ -0,0 +1,178 @@ +// Vitest Snapshot v1 + +exports[`color > seed: 42 > cmyk() 1`] = ` +[ + 0.37, + 0.8, + 0.96, + 0.18, +] +`; + +exports[`color > seed: 42 > colorByCSSColorSpace() 1`] = ` +[ + 0.3745, + 0.7966, + 0.9508, +] +`; + +exports[`color > seed: 42 > cssSupportedFunction() 1`] = `"hsla"`; + +exports[`color > seed: 42 > cssSupportedSpace() 1`] = `"rec2020"`; + +exports[`color > seed: 42 > hsl() 1`] = ` +[ + 135, + 0.8, + 0.96, +] +`; + +exports[`color > seed: 42 > human() 1`] = `"grey"`; + +exports[`color > seed: 42 > hwb() 1`] = ` +[ + 135, + 0.8, + 0.96, +] +`; + +exports[`color > seed: 42 > lab() 1`] = ` +[ + 0.37454, + 59.3086, + 90.1429, +] +`; + +exports[`color > seed: 42 > lch() 1`] = ` +[ + 0.37454, + 183.2, + 218.7, +] +`; + +exports[`color > seed: 42 > rgb() 1`] = `"#8be4ab"`; + +exports[`color > seed: 42 > space() 1`] = `"Rec. 709"`; + +exports[`color > seed: 1211 > cmyk() 1`] = ` +[ + 0.93, + 0.46, + 0.9, + 0.78, +] +`; + +exports[`color > seed: 1211 > colorByCSSColorSpace() 1`] = ` +[ + 0.9286, + 0.459, + 0.8935, +] +`; + +exports[`color > seed: 1211 > cssSupportedFunction() 1`] = `"color"`; + +exports[`color > seed: 1211 > cssSupportedSpace() 1`] = `"rec2020"`; + +exports[`color > seed: 1211 > hsl() 1`] = ` +[ + 335, + 0.46, + 0.9, +] +`; + +exports[`color > seed: 1211 > human() 1`] = `"azure"`; + +exports[`color > seed: 1211 > hwb() 1`] = ` +[ + 335, + 0.46, + 0.9, +] +`; + +exports[`color > seed: 1211 > lab() 1`] = ` +[ + 0.928521, + -8.197, + 78.6944, +] +`; + +exports[`color > seed: 1211 > lch() 1`] = ` +[ + 0.928521, + 105.6, + 205.5, +] +`; + +exports[`color > seed: 1211 > rgb() 1`] = `"#eadb42"`; + +exports[`color > seed: 1211 > space() 1`] = `"LMS"`; + +exports[`color > seed: 1337 > cmyk() 1`] = ` +[ + 0.26, + 0.56, + 0.16, + 0.21, +] +`; + +exports[`color > seed: 1337 > colorByCSSColorSpace() 1`] = ` +[ + 0.262, + 0.5605, + 0.1586, +] +`; + +exports[`color > seed: 1337 > cssSupportedFunction() 1`] = `"hsl"`; + +exports[`color > seed: 1337 > cssSupportedSpace() 1`] = `"display-p3"`; + +exports[`color > seed: 1337 > hsl() 1`] = ` +[ + 94, + 0.56, + 0.16, +] +`; + +exports[`color > seed: 1337 > human() 1`] = `"black"`; + +exports[`color > seed: 1337 > hwb() 1`] = ` +[ + 94, + 0.56, + 0.16, +] +`; + +exports[`color > seed: 1337 > lab() 1`] = ` +[ + 0.262024, + 12.106, + -68.2632, +] +`; + +exports[`color > seed: 1337 > lch() 1`] = ` +[ + 0.262024, + 128.9, + 36.5, +] +`; + +exports[`color > seed: 1337 > rgb() 1`] = `"#5c346b"`; + +exports[`color > seed: 1337 > space() 1`] = `"ProPhoto RGB Color Space"`; diff --git a/test/__snapshots__/commerce.spec.ts.snap b/test/__snapshots__/commerce.spec.ts.snap new file mode 100644 index 00000000000..eeb210fba7f --- /dev/null +++ b/test/__snapshots__/commerce.spec.ts.snap @@ -0,0 +1,49 @@ +// Vitest Snapshot v1 + +exports[`commerce > seed: 42 > color() 1`] = `"grey"`; + +exports[`commerce > seed: 42 > department() 1`] = `"Tools"`; + +exports[`commerce > seed: 42 > price() 1`] = `"375.00"`; + +exports[`commerce > seed: 42 > product() 1`] = `"Pants"`; + +exports[`commerce > seed: 42 > productAdjective() 1`] = `"Fantastic"`; + +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 > seed: 42 > productMaterial() 1`] = `"Plastic"`; + +exports[`commerce > seed: 42 > productName() 1`] = `"Fantastic Soft Sausages"`; + +exports[`commerce > seed: 1211 > color() 1`] = `"azure"`; + +exports[`commerce > seed: 1211 > department() 1`] = `"Automotive"`; + +exports[`commerce > seed: 1211 > price() 1`] = `"929.00"`; + +exports[`commerce > seed: 1211 > product() 1`] = `"Sausages"`; + +exports[`commerce > seed: 1211 > productAdjective() 1`] = `"Unbranded"`; + +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 > seed: 1211 > productMaterial() 1`] = `"Frozen"`; + +exports[`commerce > seed: 1211 > productName() 1`] = `"Unbranded Cotton Salad"`; + +exports[`commerce > seed: 1337 > color() 1`] = `"black"`; + +exports[`commerce > seed: 1337 > department() 1`] = `"Computers"`; + +exports[`commerce > seed: 1337 > price() 1`] = `"263.00"`; + +exports[`commerce > seed: 1337 > product() 1`] = `"Ball"`; + +exports[`commerce > seed: 1337 > productAdjective() 1`] = `"Incredible"`; + +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 > seed: 1337 > productMaterial() 1`] = `"Concrete"`; + +exports[`commerce > seed: 1337 > productName() 1`] = `"Incredible Granite Keyboard"`; diff --git a/test/__snapshots__/company.spec.ts.snap b/test/__snapshots__/company.spec.ts.snap new file mode 100644 index 00000000000..f4dfd000e64 --- /dev/null +++ b/test/__snapshots__/company.spec.ts.snap @@ -0,0 +1,88 @@ +// Vitest Snapshot v1 + +exports[`company > seed: 42 > bs() 1`] = `"seize impactful web services"`; + +exports[`company > seed: 42 > bsAdjective() 1`] = `"dynamic"`; + +exports[`company > seed: 42 > bsBuzz() 1`] = `"seize"`; + +exports[`company > seed: 42 > bsNoun() 1`] = `"portals"`; + +exports[`company > seed: 42 > catchPhrase() 1`] = `"Implemented responsive throughput"`; + +exports[`company > seed: 42 > catchPhraseAdjective() 1`] = `"Implemented"`; + +exports[`company > seed: 42 > catchPhraseDescriptor() 1`] = `"explicit"`; + +exports[`company > seed: 42 > catchPhraseNoun() 1`] = `"framework"`; + +exports[`company > seed: 42 > companyName() 1`] = `"Schinner - Wiegand"`; + +exports[`company > seed: 42 > companySuffix() 1`] = `"and Sons"`; + +exports[`company > seed: 42 > suffixes() 1`] = ` +[ + "Inc", + "and Sons", + "LLC", + "Group", +] +`; + +exports[`company > seed: 1211 > bs() 1`] = `"cultivate bleeding-edge functionalities"`; + +exports[`company > seed: 1211 > bsAdjective() 1`] = `"plug-and-play"`; + +exports[`company > seed: 1211 > bsBuzz() 1`] = `"cultivate"`; + +exports[`company > seed: 1211 > bsNoun() 1`] = `"experiences"`; + +exports[`company > seed: 1211 > catchPhrase() 1`] = `"Up-sized high-level success"`; + +exports[`company > seed: 1211 > catchPhraseAdjective() 1`] = `"Up-sized"`; + +exports[`company > seed: 1211 > catchPhraseDescriptor() 1`] = `"upward-trending"`; + +exports[`company > seed: 1211 > catchPhraseNoun() 1`] = `"system engine"`; + +exports[`company > seed: 1211 > companyName() 1`] = `"Koch, Trantow and Sanford"`; + +exports[`company > seed: 1211 > companySuffix() 1`] = `"Group"`; + +exports[`company > seed: 1211 > suffixes() 1`] = ` +[ + "Inc", + "and Sons", + "LLC", + "Group", +] +`; + +exports[`company > seed: 1337 > bs() 1`] = `"incentivize efficient initiatives"`; + +exports[`company > seed: 1337 > bsAdjective() 1`] = `"global"`; + +exports[`company > seed: 1337 > bsBuzz() 1`] = `"incentivize"`; + +exports[`company > seed: 1337 > bsNoun() 1`] = `"ROI"`; + +exports[`company > seed: 1337 > catchPhrase() 1`] = `"Expanded leading edge capacity"`; + +exports[`company > seed: 1337 > catchPhraseAdjective() 1`] = `"Expanded"`; + +exports[`company > seed: 1337 > catchPhraseDescriptor() 1`] = `"demand-driven"`; + +exports[`company > seed: 1337 > catchPhraseNoun() 1`] = `"data-warehouse"`; + +exports[`company > seed: 1337 > companyName() 1`] = `"Macejkovic Inc"`; + +exports[`company > seed: 1337 > companySuffix() 1`] = `"and Sons"`; + +exports[`company > seed: 1337 > suffixes() 1`] = ` +[ + "Inc", + "and Sons", + "LLC", + "Group", +] +`; diff --git a/test/__snapshots__/database.spec.ts.snap b/test/__snapshots__/database.spec.ts.snap new file mode 100644 index 00000000000..7542fca1bf7 --- /dev/null +++ b/test/__snapshots__/database.spec.ts.snap @@ -0,0 +1,31 @@ +// Vitest Snapshot v1 + +exports[`database > seed: 42 > collation() 1`] = `"utf8_bin"`; + +exports[`database > seed: 42 > column() 1`] = `"token"`; + +exports[`database > seed: 42 > engine() 1`] = `"MEMORY"`; + +exports[`database > seed: 42 > mongodbObjectId() 1`] = `"8be4abdd39321ad7d3fe01ff"`; + +exports[`database > seed: 42 > type() 1`] = `"smallint"`; + +exports[`database > seed: 1211 > collation() 1`] = `"cp1250_general_ci"`; + +exports[`database > seed: 1211 > column() 1`] = `"createdAt"`; + +exports[`database > seed: 1211 > engine() 1`] = `"ARCHIVE"`; + +exports[`database > seed: 1211 > mongodbObjectId() 1`] = `"eadb42f0e3f4a973fab0aeef"`; + +exports[`database > seed: 1211 > type() 1`] = `"geometry"`; + +exports[`database > seed: 1337 > collation() 1`] = `"utf8_general_ci"`; + +exports[`database > seed: 1337 > column() 1`] = `"email"`; + +exports[`database > seed: 1337 > engine() 1`] = `"MyISAM"`; + +exports[`database > seed: 1337 > mongodbObjectId() 1`] = `"5c346ba075bd57f5a62b82d7"`; + +exports[`database > seed: 1337 > type() 1`] = `"time"`; diff --git a/test/__snapshots__/datatype.spec.ts.snap b/test/__snapshots__/datatype.spec.ts.snap new file mode 100644 index 00000000000..c04dcf950c6 --- /dev/null +++ b/test/__snapshots__/datatype.spec.ts.snap @@ -0,0 +1,277 @@ +// Vitest Snapshot v1 + +exports[`datatype > seed: 42 > array > should return a deterministic array of given length 1`] = ` +[ + 79654, + "2eiXX/J/*&", + 86617, + 60111, +] +`; + +exports[`datatype > seed: 42 > array() 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 > seed: 42 > bigInt() 1`] = `379177551410048n`; + +exports[`datatype > seed: 42 > boolean() 1`] = `false`; + +exports[`datatype > seed: 42 > datetime > should return a deterministic date when given a max date 1`] = `1994-07-11T09:43:47.230Z`; + +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 > seed: 42 > datetime > should return a deterministic date when given a min date 1`] = `1801-04-11T15:13:06.330Z`; + +exports[`datatype > seed: 42 > datetime > should return a deterministic date when given a number 1`] = `1994-03-20T17:23:00.629Z`; + +exports[`datatype > seed: 42 > datetime() 1`] = `2031-03-14T21:33:22.114Z`; + +exports[`datatype > seed: 42 > float > should return a deterministic value for given max 1`] = `25.84`; + +exports[`datatype > seed: 42 > float > should return a deterministic value for given min 1`] = `37411.64`; + +exports[`datatype > seed: 42 > float > should return a deterministic value for given min and max 1`] = `-0.43`; + +exports[`datatype > seed: 42 > float > should return a deterministic value for given min, max and precision 1`] = `-0.4261`; + +exports[`datatype > seed: 42 > float > should return a deterministic value for given number 1`] = `37452`; + +exports[`datatype > seed: 42 > float > should return a deterministic value for given number 2`] = `79656`; + +exports[`datatype > seed: 42 > float > should return a deterministic value for given number 3`] = `95076`; + +exports[`datatype > seed: 42 > float > should return a deterministic value for given number 4`] = `18342`; + +exports[`datatype > seed: 42 > float > should return a deterministic value for given number 5`] = `73200`; + +exports[`datatype > seed: 42 > float() 1`] = `37453.64`; + +exports[`datatype > seed: 42 > hexadecimal > should return a deterministic hex of given length 1`] = `"0x8BE4ABdd39321aD7d3fe01FfCE404F4d6db0906bd8"`; + +exports[`datatype > seed: 42 > hexadecimal() 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 > seed: 42 > number > should return a deterministic value for given max 1`] = `26`; + +exports[`datatype > seed: 42 > number > should return a deterministic value for given min 1`] = `37412`; + +exports[`datatype > seed: 42 > number > should return a deterministic value for given min and max 1`] = `-1`; + +exports[`datatype > seed: 42 > number > should return a deterministic value for given min, max and precision 1`] = `-0.43`; + +exports[`datatype > seed: 42 > number > should return a deterministic value for given number 1`] = `2`; + +exports[`datatype > seed: 42 > number > should return a deterministic value for given number 2`] = `5`; + +exports[`datatype > seed: 42 > number > should return a deterministic value for given number 3`] = `6`; + +exports[`datatype > seed: 42 > number > should return a deterministic value for given number 4`] = `1`; + +exports[`datatype > seed: 42 > number > should return a deterministic value for given number 5`] = `5`; + +exports[`datatype > seed: 42 > number() 1`] = `37454`; + +exports[`datatype > seed: 42 > string > should return a deterministic string of given length 1`] = `"Cky2eiXX/J/*&Kq@X.b]\\"&{dnx4!1}2Z=YQ!I# seed: 42 > string() 1`] = `"Cky2eiXX/J"`; + +exports[`datatype > seed: 42 > uuid() 1`] = `"5cf2bc99-2721-407d-992b-a00fbdf302f2"`; + +exports[`datatype > seed: 1211 > array > should return a deterministic array of given length 1`] = ` +[ + "Kti5-}$_/\`", + 76408, + 35403, + 69406, +] +`; + +exports[`datatype > seed: 1211 > array() 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 > seed: 1211 > bigInt() 1`] = `948721906162743n`; + +exports[`datatype > seed: 1211 > boolean() 1`] = `true`; + +exports[`datatype > seed: 1211 > datetime > should return a deterministic date when given a max date 1`] = `2001-03-20T11:14:25.251Z`; + +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 > seed: 1211 > datetime > should return a deterministic date when given a min date 1`] = `2065-11-10T19:27:20.915Z`; + +exports[`datatype > seed: 1211 > datetime > should return a deterministic date when given a number 1`] = `2000-06-14T02:54:42.082Z`; + +exports[`datatype > seed: 1211 > datetime() 1`] = `2092-02-20T03:42:04.341Z`; + +exports[`datatype > seed: 1211 > float > should return a deterministic value for given max 1`] = `64.07`; + +exports[`datatype > seed: 1211 > float > should return a deterministic value for given min 1`] = `92809.09`; + +exports[`datatype > seed: 1211 > float > should return a deterministic value for given min and max 1`] = `61.07`; + +exports[`datatype > seed: 1211 > float > should return a deterministic value for given min, max and precision 1`] = `61.0658`; + +exports[`datatype > seed: 1211 > float > should return a deterministic value for given number 1`] = `92856`; + +exports[`datatype > seed: 1211 > float > should return a deterministic value for given number 2`] = `45900`; + +exports[`datatype > seed: 1211 > float > should return a deterministic value for given number 3`] = `89346`; + +exports[`datatype > seed: 1211 > float > should return a deterministic value for given number 4`] = `77826`; + +exports[`datatype > seed: 1211 > float > should return a deterministic value for given number 5`] = `22554`; + +exports[`datatype > seed: 1211 > float() 1`] = `92851.09`; + +exports[`datatype > seed: 1211 > hexadecimal > should return a deterministic hex of given length 1`] = `"0xEaDB42F0e3f4A973fAB0AeefCE96DFCF49cD438dF9"`; + +exports[`datatype > seed: 1211 > hexadecimal() 1`] = `"0xE"`; + +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 > seed: 1211 > number > should return a deterministic value for given max 1`] = `64`; + +exports[`datatype > seed: 1211 > number > should return a deterministic value for given min 1`] = `92810`; + +exports[`datatype > seed: 1211 > number > should return a deterministic value for given min and max 1`] = `61`; + +exports[`datatype > seed: 1211 > number > should return a deterministic value for given min, max and precision 1`] = `61.07`; + +exports[`datatype > seed: 1211 > number > should return a deterministic value for given number 1`] = `6`; + +exports[`datatype > seed: 1211 > number > should return a deterministic value for given number 2`] = `3`; + +exports[`datatype > seed: 1211 > number > should return a deterministic value for given number 3`] = `6`; + +exports[`datatype > seed: 1211 > number > should return a deterministic value for given number 4`] = `5`; + +exports[`datatype > seed: 1211 > number > should return a deterministic value for given number 5`] = `1`; + +exports[`datatype > seed: 1211 > number() 1`] = `92852`; + +exports[`datatype > seed: 1211 > string > should return a deterministic string of given length 1`] = `"wKti5-}$_/\`4hHA0afl\\"h^]dnwI seed: 1211 > string() 1`] = `"wKti5-}$_/"`; + +exports[`datatype > seed: 1211 > uuid() 1`] = `"e7ec32f0-a2a3-4c65-abbd-0caabde64dfd"`; + +exports[`datatype > seed: 1337 > array > should return a deterministic array of given length 1`] = ` +[ + 56052, + 21258, + 54308, + 3397, +] +`; + +exports[`datatype > seed: 1337 > array() 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 > seed: 1337 > bigInt() 1`] = `251225403255239n`; + +exports[`datatype > seed: 1337 > boolean() 1`] = `false`; + +exports[`datatype > seed: 1337 > datetime > should return a deterministic date when given a max date 1`] = `1993-03-02T00:10:04.335Z`; + +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 > seed: 1337 > datetime > should return a deterministic date when given a min date 1`] = `1747-07-16T01:19:54.159Z`; + +exports[`datatype > seed: 1337 > datetime > should return a deterministic date when given a number 1`] = `1992-12-13T04:13:59.232Z`; + +exports[`datatype > seed: 1337 > datetime() 1`] = `2018-10-28T08:46:11.896Z`; + +exports[`datatype > seed: 1337 > float > should return a deterministic value for given max 1`] = `18.08`; + +exports[`datatype > seed: 1337 > float > should return a deterministic value for given min 1`] = `26160.2`; + +exports[`datatype > seed: 1337 > float > should return a deterministic value for given min and max 1`] = `-12.92`; + +exports[`datatype > seed: 1337 > float > should return a deterministic value for given min, max and precision 1`] = `-12.9153`; + +exports[`datatype > seed: 1337 > float > should return a deterministic value for given number 1`] = `26202`; + +exports[`datatype > seed: 1337 > float > should return a deterministic value for given number 2`] = `56052`; + +exports[`datatype > seed: 1337 > float > should return a deterministic value for given number 3`] = `15864`; + +exports[`datatype > seed: 1337 > float > should return a deterministic value for given number 4`] = `21258`; + +exports[`datatype > seed: 1337 > float > should return a deterministic value for given number 5`] = `27810`; + +exports[`datatype > seed: 1337 > float() 1`] = `26202.2`; + +exports[`datatype > seed: 1337 > hexadecimal > should return a deterministic hex of given length 1`] = `"0x5c346ba075bd57F5A62B82d72AF39CBBB07a98cbA8"`; + +exports[`datatype > seed: 1337 > hexadecimal() 1`] = `"0x5"`; + +exports[`datatype > seed: 1337 > json() 1`] = `"{\\"foo\\":56052,\\"bar\\":21258,\\"bike\\":54308,\\"a\\":3397,\\"b\\":23538,\\"name\\":\\"X9@{:e=+kD\\",\\"prop\\":62850}"`; + +exports[`datatype > seed: 1337 > number > should return a deterministic value for given max 1`] = `18`; + +exports[`datatype > seed: 1337 > number > should return a deterministic value for given min 1`] = `26160`; + +exports[`datatype > seed: 1337 > number > should return a deterministic value for given min and max 1`] = `-13`; + +exports[`datatype > seed: 1337 > number > should return a deterministic value for given min, max and precision 1`] = `-12.92`; + +exports[`datatype > seed: 1337 > number > should return a deterministic value for given number 1`] = `1`; + +exports[`datatype > seed: 1337 > number > should return a deterministic value for given number 2`] = `3`; + +exports[`datatype > seed: 1337 > number > should return a deterministic value for given number 3`] = `1`; + +exports[`datatype > seed: 1337 > number > should return a deterministic value for given number 4`] = `1`; + +exports[`datatype > seed: 1337 > number > should return a deterministic value for given number 5`] = `1`; + +exports[`datatype > seed: 1337 > number() 1`] = `26202`; + +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 > seed: 1337 > string() 1`] = `"9U/4:SK$>6"`; + +exports[`datatype > seed: 1337 > uuid() 1`] = `"48234870-5389-445f-8b41-c61a52bf27dc"`; diff --git a/test/__snapshots__/date.spec.ts.snap b/test/__snapshots__/date.spec.ts.snap new file mode 100644 index 00000000000..426df869354 --- /dev/null +++ b/test/__snapshots__/date.spec.ts.snap @@ -0,0 +1,223 @@ +// 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 > seed: 42 > between() > should return deterministic value between given string dates 1`] = `2021-03-15T19:30:57.091Z`; + +exports[`date > seed: 42 > betweens() > should return deterministic value betweens given dates 1`] = ` +[ + 2021-03-15T19:30:57.091Z, + 2021-04-09T17:05:10.406Z, + 2021-04-18T19:23:52.973Z, +] +`; + +exports[`date > seed: 42 > betweens() > should return deterministic value betweens given 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 1`] = `1959-06-26T13:52:19.442Z`; + +exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by age mode 1`] = `1942-09-15T09:55:20.478Z`; + +exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by age range 1`] = `1941-12-15T14:59:26.122Z`; + +exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by default 1`] = `1943-08-06T10:03:17.283Z`; + +exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by year 1`] = `2000-05-16T22:59:36.513Z`; + +exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by year mode 1`] = `1943-08-06T10:03:17.283Z`; + +exports[`date > seed: 42 > birthdate() > should return deterministic value birthdate by year range 1`] = `1937-10-30T15:52:07.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 > seed: 42 > future() > should return deterministic future value on given refDate of type string 1`] = `2021-07-08T10:07:33.381Z`; + +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 > 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 > seed: 42 > month() > should return deterministic value month by default 1`] = `"May"`; + +exports[`date > seed: 42 > month() > should return deterministic value month with abbr and context true 1`] = `"May"`; + +exports[`date > seed: 42 > month() > should return deterministic value month with abbr true 1`] = `"May"`; + +exports[`date > seed: 42 > month() > should return deterministic value month with context true 1`] = `"May"`; + +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 > seed: 42 > past() > should return deterministic past value on given refDate of type string 1`] = `2020-10-08T00:10:58.041Z`; + +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 > 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 > seed: 42 > recent() > should return deterministic value recent to given refDate of type date 1`] = `2021-02-21T08:11:56.820Z`; + +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 > seed: 42 > soon() > should return deterministic value soon to given refDate of type date 1`] = `2021-03-13T23:15:38.042Z`; + +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 > seed: 42 > weekday() > should return deterministic value weekday by default 1`] = `"Tuesday"`; + +exports[`date > seed: 42 > weekday() > should return deterministic value weekday with abbr and context true 1`] = `"Tue"`; + +exports[`date > seed: 42 > weekday() > should return deterministic value weekday with abbr true 1`] = `"Tue"`; + +exports[`date > seed: 42 > weekday() > should return deterministic value weekday with context true 1`] = `"Tuesday"`; + +exports[`date > seed: 1211 > between() > should return deterministic value between given real dates 1`] = `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 > seed: 1211 > betweens() > should return deterministic value betweens given dates 1`] = ` +[ + 2021-03-20T19:08:07.621Z, + 2021-04-15T10:20:25.794Z, + 2021-04-17T11:58:13.327Z, +] +`; + +exports[`date > seed: 1211 > betweens() > should return deterministic value betweens given string dates 1`] = ` +[ + 2021-03-20T19:08:07.621Z, + 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 > seed: 1211 > birthdate() > should return deterministic value birthdate by age mode 1`] = `1977-08-10T01:09:17.468Z`; + +exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by age range 1`] = `1975-10-01T07:11:50.190Z`; + +exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by default 1`] = `1978-06-29T09:24:02.647Z`; + +exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by year 1`] = `2000-12-04T01:16:03.286Z`; + +exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by year mode 1`] = `1978-06-29T09:24:02.647Z`; + +exports[`date > seed: 1211 > birthdate() > should return deterministic value birthdate by year range 1`] = `1993-10-11T07:44:59.519Z`; + +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 > seed: 1211 > future() > should return deterministic future value on given refDate of type string 1`] = `2022-01-26T14:59:27.351Z`; + +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 > 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 > seed: 1211 > month() > should return deterministic value month by default 1`] = `"December"`; + +exports[`date > seed: 1211 > month() > should return deterministic value month with abbr and context true 1`] = `"Dec"`; + +exports[`date > seed: 1211 > month() > should return deterministic value month with abbr true 1`] = `"Dec"`; + +exports[`date > seed: 1211 > month() > should return deterministic value month with context true 1`] = `"December"`; + +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 > seed: 1211 > past() > should return deterministic past value on given refDate of type string 1`] = `2020-03-19T19:19:04.071Z`; + +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 > 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 > seed: 1211 > recent() > should return deterministic value recent to given refDate of type date 1`] = `2021-02-20T18:54:13.498Z`; + +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 > seed: 1211 > soon() > should return deterministic value soon to given refDate of type date 1`] = `2021-03-14T12:33:21.364Z`; + +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 > seed: 1211 > weekday() > should return deterministic value weekday by default 1`] = `"Saturday"`; + +exports[`date > seed: 1211 > weekday() > should return deterministic value weekday with abbr and context true 1`] = `"Sat"`; + +exports[`date > seed: 1211 > weekday() > should return deterministic value weekday with abbr true 1`] = `"Sat"`; + +exports[`date > seed: 1211 > weekday() > should return deterministic value weekday with context true 1`] = `"Saturday"`; + +exports[`date > seed: 1337 > between() > should return deterministic value between given real 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 > seed: 1337 > betweens() > should return deterministic value betweens given dates 1`] = ` +[ + 2021-03-03T01:51:22.512Z, + 2021-03-09T04:11:24.667Z, + 2021-03-26T18:53:00.564Z, +] +`; + +exports[`date > seed: 1337 > betweens() > should return deterministic value betweens given string dates 1`] = ` +[ + 2021-03-03T01:51:22.512Z, + 2021-03-09T04:11:24.667Z, + 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 > seed: 1337 > birthdate() > should return deterministic value birthdate by age mode 1`] = `1935-08-14T07:41:47.183Z`; + +exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by age range 1`] = `1935-02-03T18:44:07.874Z`; + +exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by default 1`] = `1936-07-04T15:55:47.989Z`; + +exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by year 1`] = `2000-04-06T02:45:32.324Z`; + +exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by year mode 1`] = `1936-07-04T15:55:47.989Z`; + +exports[`date > seed: 1337 > birthdate() > should return deterministic value birthdate by year range 1`] = `1926-06-20T07:18:05.539Z`; + +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 > seed: 1337 > future() > should return deterministic future value on given refDate of type string 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 > 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 > seed: 1337 > month() > should return deterministic value month by default 1`] = `"April"`; + +exports[`date > seed: 1337 > month() > should return deterministic value month with abbr and context true 1`] = `"Apr"`; + +exports[`date > seed: 1337 > month() > should return deterministic value month with abbr true 1`] = `"Apr"`; + +exports[`date > seed: 1337 > month() > should return deterministic value month with context true 1`] = `"April"`; + +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 > seed: 1337 > past() > should return deterministic past value on given refDate of type string 1`] = `2020-11-18T01:49:04.785Z`; + +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 > 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 > seed: 1337 > recent() > should return deterministic value recent to given refDate of type date 1`] = `2021-02-21T10:53:58.041Z`; + +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 > seed: 1337 > soon() > should return deterministic value soon to given refDate of type date 1`] = `2021-03-13T20:33:36.821Z`; + +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 > seed: 1337 > weekday() > should return deterministic value weekday by default 1`] = `"Monday"`; + +exports[`date > seed: 1337 > weekday() > should return deterministic value weekday with abbr and context true 1`] = `"Mon"`; + +exports[`date > seed: 1337 > weekday() > should return deterministic value weekday with abbr true 1`] = `"Mon"`; + +exports[`date > seed: 1337 > weekday() > should return deterministic value weekday with context true 1`] = `"Monday"`; diff --git a/test/__snapshots__/finance.spec.ts.snap b/test/__snapshots__/finance.spec.ts.snap new file mode 100644 index 00000000000..0acc368d3e3 --- /dev/null +++ b/test/__snapshots__/finance.spec.ts.snap @@ -0,0 +1,109 @@ +// Vitest Snapshot v1 + +exports[`finance > seed: 42 > account() 1`] = `"37917755"`; + +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 > bitcoinAddress() 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1b"`; + +exports[`finance > seed: 42 > creditCardCVV() 1`] = `"379"`; + +exports[`finance > seed: 42 > creditCardNumber() 1`] = `"3581-7755-1410-0484"`; + +exports[`finance > seed: 42 > currencyCode() 1`] = `"IQD"`; + +exports[`finance > seed: 42 > currencyName() 1`] = `"Iraqi Dinar"`; + +exports[`finance > seed: 42 > currencySymbol() 1`] = `"₱"`; + +exports[`finance > seed: 42 > ethereumAddress() 1`] = `"0x8be4abdd39321ad7d3fe01ffce404f4d6db0906b"`; + +exports[`finance > seed: 42 > iban() 1`] = `"GT30Y75110867098F1E3542612J4"`; + +exports[`finance > seed: 42 > litecoinAddress() 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1b"`; + +exports[`finance > seed: 42 > mask() 1`] = `"(...3791)"`; + +exports[`finance > seed: 42 > pin() 1`] = `"3791"`; + +exports[`finance > seed: 42 > routingNumber() 1`] = `"379177554"`; + +exports[`finance > seed: 42 > transactionDescription() 1`] = `"invoice transaction at Wiegand, Deckow and Renner using card ending with ***(...8361) for SDG 374.54 in account ***55141004"`; + +exports[`finance > seed: 42 > transactionType() 1`] = `"withdrawal"`; + +exports[`finance > seed: 1211 > account() 1`] = `"94872190"`; + +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 > bitcoinAddress() 1`] = `"1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsA"`; + +exports[`finance > seed: 1211 > creditCardCVV() 1`] = `"948"`; + +exports[`finance > seed: 1211 > creditCardNumber() 1`] = `"4872190616274"`; + +exports[`finance > seed: 1211 > currencyCode() 1`] = `"XDR"`; + +exports[`finance > seed: 1211 > currencyName() 1`] = `"SDR"`; + +exports[`finance > seed: 1211 > currencySymbol() 1`] = `"₭"`; + +exports[`finance > seed: 1211 > ethereumAddress() 1`] = `"0xeadb42f0e3f4a973fab0aeefce96dfcf49cd438d"`; + +exports[`finance > seed: 1211 > iban() 1`] = `"TN0382001124170679299069"`; + +exports[`finance > seed: 1211 > litecoinAddress() 1`] = `"MTMe8Z3EaFdLqmaGKP1LEEJQVriSZRZds"`; + +exports[`finance > seed: 1211 > mask() 1`] = `"(...9487)"`; + +exports[`finance > seed: 1211 > pin() 1`] = `"9487"`; + +exports[`finance > seed: 1211 > routingNumber() 1`] = `"948721904"`; + +exports[`finance > seed: 1211 > transactionDescription() 1`] = `"deposit transaction at Trantow - Sanford using card ending with ***(...4316) for STN 928.52 in account ***19061627"`; + +exports[`finance > seed: 1211 > transactionType() 1`] = `"invoice"`; + +exports[`finance > seed: 1337 > account() 1`] = `"25122540"`; + +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 > bitcoinAddress() 1`] = `"3adhxs2jewAgkYgJi7No6Cn8JZa"`; + +exports[`finance > seed: 1337 > creditCardCVV() 1`] = `"251"`; + +exports[`finance > seed: 1337 > creditCardNumber() 1`] = `"6011-6212-2540-3255-2398"`; + +exports[`finance > seed: 1337 > currencyCode() 1`] = `"FJD"`; + +exports[`finance > seed: 1337 > currencyName() 1`] = `"Fiji Dollar"`; + +exports[`finance > seed: 1337 > currencySymbol() 1`] = `"$"`; + +exports[`finance > seed: 1337 > ethereumAddress() 1`] = `"0x5c346ba075bd57f5a62b82d72af39cbbb07a98cb"`; + +exports[`finance > seed: 1337 > iban() 1`] = `"FO7710540350900318"`; + +exports[`finance > seed: 1337 > litecoinAddress() 1`] = `"Madhxs2jewAgkYgJi7No6Cn8JZar"`; + +exports[`finance > seed: 1337 > mask() 1`] = `"(...2512)"`; + +exports[`finance > seed: 1337 > pin() 1`] = `"2512"`; + +exports[`finance > seed: 1337 > routingNumber() 1`] = `"251225401"`; + +exports[`finance > seed: 1337 > transactionDescription() 1`] = `"withdrawal transaction at Cronin - Effertz using card ending with ***(...3927) for GTQ 262.02 in account ***54032552"`; + +exports[`finance > seed: 1337 > transactionType() 1`] = `"withdrawal"`; diff --git a/test/__snapshots__/git.spec.ts.snap b/test/__snapshots__/git.spec.ts.snap new file mode 100644 index 00000000000..11b82fbe686 --- /dev/null +++ b/test/__snapshots__/git.spec.ts.snap @@ -0,0 +1,25 @@ +// Vitest Snapshot v1 + +exports[`git > seed: 42 > branch() 1`] = `"array-transmit"`; + +exports[`git > seed: 42 > commitMessage() 1`] = `"navigate neural capacitor"`; + +exports[`git > seed: 42 > commitSha() 1`] = `"5cf2bc99272107d592ba00fbdf302f2949806048"`; + +exports[`git > seed: 42 > shortSha() 1`] = `"5cf2bc9"`; + +exports[`git > seed: 1211 > branch() 1`] = `"capacitor-connect"`; + +exports[`git > seed: 1211 > commitMessage() 1`] = `"reboot online circuit"`; + +exports[`git > seed: 1211 > commitSha() 1`] = `"e7ec32f0a2a3c652bbd0caabde64dfdf379e3259"`; + +exports[`git > seed: 1211 > shortSha() 1`] = `"e7ec32f"`; + +exports[`git > seed: 1337 > branch() 1`] = `"port-quantify"`; + +exports[`git > seed: 1337 > commitMessage() 1`] = `"compress multi-byte panel"`; + +exports[`git > seed: 1337 > commitSha() 1`] = `"48234870538945f4b41c61a52bf27dccc0576698"`; + +exports[`git > seed: 1337 > shortSha() 1`] = `"4823487"`; diff --git a/test/__snapshots__/hacker.spec.ts.snap b/test/__snapshots__/hacker.spec.ts.snap new file mode 100644 index 00000000000..29f6a9f2628 --- /dev/null +++ b/test/__snapshots__/hacker.spec.ts.snap @@ -0,0 +1,37 @@ +// Vitest Snapshot v1 + +exports[`name > seed: 42 > abbreviation() 1`] = `"HTTP"`; + +exports[`name > seed: 42 > adjective() 1`] = `"cross-platform"`; + +exports[`name > seed: 42 > ingverb() 1`] = `"copying"`; + +exports[`name > seed: 42 > noun() 1`] = `"array"`; + +exports[`name > seed: 42 > phrase() 1`] = `"Try to transmit the TCP microchip, maybe it will quantify the mobile monitor!"`; + +exports[`name > seed: 42 > verb() 1`] = `"navigate"`; + +exports[`name > seed: 1211 > abbreviation() 1`] = `"UTF8"`; + +exports[`name > seed: 1211 > adjective() 1`] = `"solid state"`; + +exports[`name > seed: 1211 > ingverb() 1`] = `"programming"`; + +exports[`name > seed: 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[`name > seed: 1211 > verb() 1`] = `"reboot"`; + +exports[`name > seed: 1337 > abbreviation() 1`] = `"FTP"`; + +exports[`name > seed: 1337 > adjective() 1`] = `"open-source"`; + +exports[`name > seed: 1337 > ingverb() 1`] = `"compressing"`; + +exports[`name > seed: 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[`name > seed: 1337 > verb() 1`] = `"compress"`; diff --git a/test/__snapshots__/helpers.spec.ts.snap b/test/__snapshots__/helpers.spec.ts.snap new file mode 100644 index 00000000000..3c5b3aeff4e --- /dev/null +++ b/test/__snapshots__/helpers.spec.ts.snap @@ -0,0 +1,55 @@ +// Vitest Snapshot v1 + +exports[`helpers > seed: 42 > mustache() 1`] = `""`; + +exports[`helpers > seed: 42 > regexpStyleStringParse() 1`] = `""`; + +exports[`helpers > seed: 42 > repeatString() 1`] = `""`; + +exports[`helpers > seed: 42 > replaceCreditCardSymbols() 1`] = `"6453-3791-7755-1410-0489"`; + +exports[`helpers > seed: 42 > replaceSymbolWithNumber() 1`] = `""`; + +exports[`helpers > seed: 42 > replaceSymbols() 1`] = `""`; + +exports[`helpers > seed: 42 > shuffle() 1`] = `[]`; + +exports[`helpers > seed: 42 > slugify() 1`] = `""`; + +exports[`helpers > seed: 42 > uniqueArray() 1`] = `[]`; + +exports[`helpers > seed: 1211 > mustache() 1`] = `""`; + +exports[`helpers > seed: 1211 > regexpStyleStringParse() 1`] = `""`; + +exports[`helpers > seed: 1211 > repeatString() 1`] = `""`; + +exports[`helpers > seed: 1211 > replaceCreditCardSymbols() 1`] = `"6453-9487-2190-6162-7434"`; + +exports[`helpers > seed: 1211 > replaceSymbolWithNumber() 1`] = `""`; + +exports[`helpers > seed: 1211 > replaceSymbols() 1`] = `""`; + +exports[`helpers > seed: 1211 > shuffle() 1`] = `[]`; + +exports[`helpers > seed: 1211 > slugify() 1`] = `""`; + +exports[`helpers > seed: 1211 > uniqueArray() 1`] = `[]`; + +exports[`helpers > seed: 1337 > mustache() 1`] = `""`; + +exports[`helpers > seed: 1337 > regexpStyleStringParse() 1`] = `""`; + +exports[`helpers > seed: 1337 > repeatString() 1`] = `""`; + +exports[`helpers > seed: 1337 > replaceCreditCardSymbols() 1`] = `"6453-2512-2540-3255-2399"`; + +exports[`helpers > seed: 1337 > replaceSymbolWithNumber() 1`] = `""`; + +exports[`helpers > seed: 1337 > replaceSymbols() 1`] = `""`; + +exports[`helpers > seed: 1337 > shuffle() 1`] = `[]`; + +exports[`helpers > seed: 1337 > slugify() 1`] = `""`; + +exports[`helpers > seed: 1337 > uniqueArray() 1`] = `[]`; diff --git a/test/__snapshots__/internet.spec.ts.snap b/test/__snapshots__/internet.spec.ts.snap new file mode 100644 index 00000000000..4ff73c9c151 --- /dev/null +++ b/test/__snapshots__/internet.spec.ts.snap @@ -0,0 +1,115 @@ +// Vitest Snapshot v1 + +exports[`internet > seed: 42 > avatar() 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/468.jpg"`; + +exports[`internet > seed: 42 > color() 1`] = `"#30667a"`; + +exports[`internet > seed: 42 > domainName() 1`] = `"harmonious-shift.org"`; + +exports[`internet > seed: 42 > domainSuffix() 1`] = `"info"`; + +exports[`internet > seed: 42 > domainWord() 1`] = `"harmonious-shift"`; + +exports[`internet > seed: 42 > email() 1`] = `"Peyton73@yahoo.com"`; + +exports[`internet > seed: 42 > emoji() 1`] = `"🕸️"`; + +exports[`internet > seed: 42 > exampleEmail() 1`] = `"Peyton73@example.com"`; + +exports[`internet > seed: 42 > httpMethod() 1`] = `"POST"`; + +exports[`internet > seed: 42 > httpStatusCode() 1`] = `207`; + +exports[`internet > seed: 42 > ip() 1`] = `"95.203.243.46"`; + +exports[`internet > seed: 42 > ipv6() 1`] = `"5cf2:bc99:2721:07d5:92ba:00fb:df30:2f29"`; + +exports[`internet > seed: 42 > mac() 1`] = `"5c:f2:bc:99:27:21"`; + +exports[`internet > seed: 42 > password() 1`] = `"Dl2fkYYKLsZdepz"`; + +exports[`internet > seed: 42 > port() 1`] = `24545`; + +exports[`internet > seed: 42 > protocol() 1`] = `"http"`; + +exports[`internet > seed: 42 > url() 1`] = `"http://stable-vehicle.biz"`; + +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 > seed: 42 > userName() 1`] = `"Garnett.Schinner73"`; + +exports[`internet > seed: 1211 > avatar() 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/1160.jpg"`; + +exports[`internet > seed: 1211 > color() 1`] = `"#773a72"`; + +exports[`internet > seed: 1211 > domainName() 1`] = `"verifiable-infection.org"`; + +exports[`internet > seed: 1211 > domainSuffix() 1`] = `"org"`; + +exports[`internet > seed: 1211 > domainWord() 1`] = `"verifiable-infection"`; + +exports[`internet > seed: 1211 > email() 1`] = `"Jadon.Trantow12@hotmail.com"`; + +exports[`internet > seed: 1211 > emoji() 1`] = `"🇮🇸"`; + +exports[`internet > seed: 1211 > exampleEmail() 1`] = `"Jadon.Trantow12@example.net"`; + +exports[`internet > seed: 1211 > httpMethod() 1`] = `"PATCH"`; + +exports[`internet > seed: 1211 > httpStatusCode() 1`] = `505`; + +exports[`internet > seed: 1211 > ip() 1`] = `"237.117.228.199"`; + +exports[`internet > seed: 1211 > ipv6() 1`] = `"e7ec:32f0:a2a3:c652:bbd0:caab:de64:dfdf"`; + +exports[`internet > seed: 1211 > mac() 1`] = `"e7:ec:32:f0:a2:a3"`; + +exports[`internet > seed: 1211 > password() 1`] = `"yLuj60b5iHB0bhn"`; + +exports[`internet > seed: 1211 > port() 1`] = `60851`; + +exports[`internet > seed: 1211 > protocol() 1`] = `"https"`; + +exports[`internet > seed: 1211 > url() 1`] = `"https://joyous-temperature.net"`; + +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 > seed: 1211 > userName() 1`] = `"Tito_Koch22"`; + +exports[`internet > seed: 1337 > avatar() 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/327.jpg"`; + +exports[`internet > seed: 1337 > color() 1`] = `"#214814"`; + +exports[`internet > seed: 1337 > domainName() 1`] = `"fabulous-might.com"`; + +exports[`internet > seed: 1337 > domainSuffix() 1`] = `"biz"`; + +exports[`internet > seed: 1337 > domainWord() 1`] = `"fabulous-might"`; + +exports[`internet > seed: 1337 > email() 1`] = `"Keith27@gmail.com"`; + +exports[`internet > seed: 1337 > emoji() 1`] = `"💇🏼‍♀️"`; + +exports[`internet > seed: 1337 > exampleEmail() 1`] = `"Keith27@example.org"`; + +exports[`internet > seed: 1337 > httpMethod() 1`] = `"POST"`; + +exports[`internet > seed: 1337 > httpStatusCode() 1`] = `205`; + +exports[`internet > seed: 1337 > ip() 1`] = `"67.143.40.54"`; + +exports[`internet > seed: 1337 > ipv6() 1`] = `"4823:4870:5389:45f4:b41c:61a5:2bf2:7dcc"`; + +exports[`internet > seed: 1337 > mac() 1`] = `"48:23:48:70:53:89"`; + +exports[`internet > seed: 1337 > password() 1`] = `"9V05TL7RY9fmECg"`; + +exports[`internet > seed: 1337 > port() 1`] = `17172`; + +exports[`internet > seed: 1337 > protocol() 1`] = `"http"`; + +exports[`internet > seed: 1337 > url() 1`] = `"http://neat-chopsticks.biz"`; + +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 > seed: 1337 > userName() 1`] = `"Devyn21"`; diff --git a/test/__snapshots__/lorem.spec.ts.snap b/test/__snapshots__/lorem.spec.ts.snap new file mode 100644 index 00000000000..e9ecfc5ab69 --- /dev/null +++ b/test/__snapshots__/lorem.spec.ts.snap @@ -0,0 +1,83 @@ +// Vitest Snapshot v1 + +exports[`lorem > seed: 42 > lines() 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 > seed: 42 > paragraphs() 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 > seed: 42 > sentences() 1`] = `"Hic sit minus dolor animi mollitia sequi ducimus sequi. Inventore praesentium et. Animi qui impedit et voluptatem."`; + +exports[`lorem > seed: 42 > slug() 1`] = `"autem-quibusdam-hic"`; + +exports[`lorem > seed: 42 > text() 1`] = `"Hic sit minus dolor animi mollitia sequi ducimus sequi."`; + +exports[`lorem > seed: 42 > word() 1`] = `"autem"`; + +exports[`lorem > seed: 42 > words() 1`] = `"autem quibusdam hic"`; + +exports[`lorem > seed: 1211 > lines() 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." +`; + +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 > seed: 1211 > paragraphs() 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 > 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 > seed: 1211 > slug() 1`] = `"non-praesentium-saepe"`; + +exports[`lorem > seed: 1211 > text() 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 > seed: 1211 > words() 1`] = `"non praesentium saepe"`; + +exports[`lorem > seed: 1337 > lines() 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 > seed: 1337 > paragraphs() 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 > 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 > seed: 1337 > slug() 1`] = `"voluptatem-natus-nesciunt"`; + +exports[`lorem > seed: 1337 > text() 1`] = `"natus nesciunt non"`; + +exports[`lorem > seed: 1337 > word() 1`] = `"voluptatem"`; + +exports[`lorem > seed: 1337 > words() 1`] = `"voluptatem natus nesciunt"`; diff --git a/test/__snapshots__/mersenne.spec.ts.snap b/test/__snapshots__/mersenne.spec.ts.snap new file mode 100644 index 00000000000..1c221b19624 --- /dev/null +++ b/test/__snapshots__/mersenne.spec.ts.snap @@ -0,0 +1,49 @@ +// Vitest Snapshot v1 + +exports[`mersenne twister > seed: [42,1,2] > rand() 1`] = `28056`; + +exports[`mersenne twister > seed: [42,1,2] > should return deterministic values for rand(100, 0) 1`] = `85`; + +exports[`mersenne twister > seed: [42,1,2] > should return deterministic values for rand(100, undefined) 1`] = `85`; + +exports[`mersenne twister > seed: [42,1,2] > should return deterministic values for rand(undefined, 0) 1`] = `28056`; + +exports[`mersenne twister > seed: [1211,1,2] > rand() 1`] = `29217`; + +exports[`mersenne twister > seed: [1211,1,2] > should return deterministic values for rand(100, 0) 1`] = `89`; + +exports[`mersenne twister > seed: [1211,1,2] > should return deterministic values for rand(100, undefined) 1`] = `89`; + +exports[`mersenne twister > seed: [1211,1,2] > should return deterministic values for rand(undefined, 0) 1`] = `29217`; + +exports[`mersenne twister > seed: [1337,1,2] > rand() 1`] = `5895`; + +exports[`mersenne twister > seed: [1337,1,2] > should return deterministic values for rand(100, 0) 1`] = `17`; + +exports[`mersenne twister > seed: [1337,1,2] > should return deterministic values for rand(100, undefined) 1`] = `17`; + +exports[`mersenne twister > seed: [1337,1,2] > should return deterministic values for rand(undefined, 0) 1`] = `5895`; + +exports[`mersenne twister > seed: 42 > rand() 1`] = `12272`; + +exports[`mersenne twister > seed: 42 > should return deterministic values for rand(100, 0) 1`] = `37`; + +exports[`mersenne twister > seed: 42 > should return deterministic values for rand(100, undefined) 1`] = `37`; + +exports[`mersenne twister > seed: 42 > should return deterministic values for rand(undefined, 0) 1`] = `12272`; + +exports[`mersenne twister > seed: 1211 > rand() 1`] = `30425`; + +exports[`mersenne twister > seed: 1211 > should return deterministic values for rand(100, 0) 1`] = `92`; + +exports[`mersenne twister > seed: 1211 > should return deterministic values for rand(100, undefined) 1`] = `92`; + +exports[`mersenne twister > seed: 1211 > should return deterministic values for rand(undefined, 0) 1`] = `30425`; + +exports[`mersenne twister > seed: 1337 > rand() 1`] = `8586`; + +exports[`mersenne twister > seed: 1337 > should return deterministic values for rand(100, 0) 1`] = `26`; + +exports[`mersenne twister > seed: 1337 > should return deterministic values for rand(100, undefined) 1`] = `26`; + +exports[`mersenne twister > seed: 1337 > should return deterministic values for rand(undefined, 0) 1`] = `8586`; diff --git a/test/__snapshots__/music.spec.ts.snap b/test/__snapshots__/music.spec.ts.snap new file mode 100644 index 00000000000..7ae987ec79c --- /dev/null +++ b/test/__snapshots__/music.spec.ts.snap @@ -0,0 +1,13 @@ +// Vitest Snapshot v1 + +exports[`music > seed: 42 > genre() 1`] = `"Country"`; + +exports[`music > seed: 42 > songName() 1`] = `"Only The Lonely (Know The Way I Feel)"`; + +exports[`music > seed: 1211 > genre() 1`] = `"Non Music"`; + +exports[`music > seed: 1211 > songName() 1`] = `"The End of the World"`; + +exports[`music > seed: 1337 > genre() 1`] = `"Folk"`; + +exports[`music > seed: 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 new file mode 100644 index 00000000000..577535f1e3b --- /dev/null +++ b/test/__snapshots__/name.spec.ts.snap @@ -0,0 +1,67 @@ +// Vitest Snapshot v1 + +exports[`name > seed: 42 > findName() 1`] = `"Sadie Wiegand"`; + +exports[`name > seed: 42 > firstName() 1`] = `"Garnett"`; + +exports[`name > seed: 42 > gender() 1`] = `"Cis"`; + +exports[`name > seed: 42 > jobArea() 1`] = `"Identity"`; + +exports[`name > seed: 42 > jobDescriptor() 1`] = `"Regional"`; + +exports[`name > seed: 42 > jobTitle() 1`] = `"Regional Data Representative"`; + +exports[`name > seed: 42 > jobType() 1`] = `"Coordinator"`; + +exports[`name > seed: 42 > lastName() 1`] = `"Hintz"`; + +exports[`name > seed: 42 > middleName() 1`] = `"Greer"`; + +exports[`name > seed: 42 > prefix() 1`] = `"Mrs."`; + +exports[`name > seed: 42 > suffix() 1`] = `"III"`; + +exports[`name > seed: 1211 > findName() 1`] = `"Claude Trantow"`; + +exports[`name > seed: 1211 > firstName() 1`] = `"Tito"`; + +exports[`name > seed: 1211 > gender() 1`] = `"Transexual Person"`; + +exports[`name > seed: 1211 > jobArea() 1`] = `"Factors"`; + +exports[`name > seed: 1211 > jobDescriptor() 1`] = `"Chief"`; + +exports[`name > seed: 1211 > jobTitle() 1`] = `"Chief Division Agent"`; + +exports[`name > seed: 1211 > jobType() 1`] = `"Representative"`; + +exports[`name > seed: 1211 > lastName() 1`] = `"Ward"`; + +exports[`name > seed: 1211 > middleName() 1`] = `"Sawyer"`; + +exports[`name > seed: 1211 > prefix() 1`] = `"Dr."`; + +exports[`name > seed: 1211 > suffix() 1`] = `"DVM"`; + +exports[`name > seed: 1337 > findName() 1`] = `"Leona Cronin"`; + +exports[`name > seed: 1337 > firstName() 1`] = `"Devyn"`; + +exports[`name > seed: 1337 > gender() 1`] = `"Two* person"`; + +exports[`name > seed: 1337 > jobArea() 1`] = `"Functionality"`; + +exports[`name > seed: 1337 > jobDescriptor() 1`] = `"Future"`; + +exports[`name > seed: 1337 > jobTitle() 1`] = `"Future Infrastructure Liaison"`; + +exports[`name > seed: 1337 > jobType() 1`] = `"Engineer"`; + +exports[`name > seed: 1337 > lastName() 1`] = `"Gibson"`; + +exports[`name > seed: 1337 > middleName() 1`] = `"Dakota"`; + +exports[`name > seed: 1337 > prefix() 1`] = `"Mrs."`; + +exports[`name > seed: 1337 > suffix() 1`] = `"I"`; diff --git a/test/__snapshots__/phone.spec.ts.snap b/test/__snapshots__/phone.spec.ts.snap new file mode 100644 index 00000000000..5c66e04156a --- /dev/null +++ b/test/__snapshots__/phone.spec.ts.snap @@ -0,0 +1,55 @@ +// Vitest Snapshot v1 + +exports[`phone > seed: 42 > imei() 1`] = `"37-917755-141004-5"`; + +exports[`phone > seed: 42 > number() 1`] = `"891.775.5141"`; + +exports[`phone > seed: 42 > phoneFormats() 1`] = `"!##.!##.####"`; + +exports[`phone > seed: 42 > phoneNumber() 1`] = `"891.775.5141"`; + +exports[`phone > seed: 42 > phoneNumberFormat > should return deterministic values for 1 1`] = `"(479) 377-5514"`; + +exports[`phone > seed: 42 > phoneNumberFormat > should return deterministic values for 2 1`] = `"1-479-377-5514"`; + +exports[`phone > seed: 42 > phoneNumberFormat > should return deterministic values for 3 1`] = `"479.377.5514"`; + +exports[`phone > seed: 42 > phoneNumberFormat > should return deterministic values for 4 1`] = `"479-377-5514"`; + +exports[`phone > seed: 42 > phoneNumberFormat() 1`] = `"479-377-5514"`; + +exports[`phone > seed: 1211 > imei() 1`] = `"94-872190-616274-4"`; + +exports[`phone > seed: 1211 > number() 1`] = `"1-587-319-0616 x27431"`; + +exports[`phone > seed: 1211 > phoneFormats() 1`] = `"1-!##-!##-#### x#####"`; + +exports[`phone > seed: 1211 > phoneNumber() 1`] = `"1-587-319-0616 x27431"`; + +exports[`phone > seed: 1211 > phoneNumberFormat > should return deterministic values for 1 1`] = `"(948) 821-9061"`; + +exports[`phone > seed: 1211 > phoneNumberFormat > should return deterministic values for 2 1`] = `"1-948-821-9061"`; + +exports[`phone > seed: 1211 > phoneNumberFormat > should return deterministic values for 3 1`] = `"948.821.9061"`; + +exports[`phone > seed: 1211 > phoneNumberFormat > should return deterministic values for 4 1`] = `"948-821-9061"`; + +exports[`phone > seed: 1211 > phoneNumberFormat() 1`] = `"948-821-9061"`; + +exports[`phone > seed: 1337 > imei() 1`] = `"25-122540-325523-4"`; + +exports[`phone > seed: 1337 > number() 1`] = `"(612) 454-0325"`; + +exports[`phone > seed: 1337 > phoneFormats() 1`] = `"(!##) !##-####"`; + +exports[`phone > seed: 1337 > phoneNumber() 1`] = `"(612) 454-0325"`; + +exports[`phone > seed: 1337 > phoneNumberFormat > should return deterministic values for 1 1`] = `"(451) 325-4032"`; + +exports[`phone > seed: 1337 > phoneNumberFormat > should return deterministic values for 2 1`] = `"1-451-325-4032"`; + +exports[`phone > seed: 1337 > phoneNumberFormat > should return deterministic values for 3 1`] = `"451.325.4032"`; + +exports[`phone > seed: 1337 > phoneNumberFormat > should return deterministic values for 4 1`] = `"451-325-4032"`; + +exports[`phone > seed: 1337 > phoneNumberFormat() 1`] = `"451-325-4032"`; diff --git a/test/__snapshots__/random.spec.ts.snap b/test/__snapshots__/random.spec.ts.snap new file mode 100644 index 00000000000..7102da68baa --- /dev/null +++ b/test/__snapshots__/random.spec.ts.snap @@ -0,0 +1,37 @@ +// Vitest Snapshot v1 + +exports[`random > seed: 42 > alpha() 1`] = `"j"`; + +exports[`random > seed: 42 > alphaNumeric() 1`] = `"d"`; + +exports[`random > seed: 42 > locale() 1`] = `"es_MX"`; + +exports[`random > seed: 42 > numeric() 1`] = `"4"`; + +exports[`random > seed: 42 > word() 1`] = `"extend"`; + +exports[`random > seed: 42 > words() 1`] = `"mobile Fish"`; + +exports[`random > seed: 1211 > alpha() 1`] = `"y"`; + +exports[`random > seed: 1211 > alphaNumeric() 1`] = `"x"`; + +exports[`random > seed: 1211 > locale() 1`] = `"ur"`; + +exports[`random > seed: 1211 > numeric() 1`] = `"9"`; + +exports[`random > seed: 1211 > word() 1`] = `"Division"`; + +exports[`random > seed: 1211 > words() 1`] = `"Turnpike Frozen Handcrafted"`; + +exports[`random > seed: 1337 > alpha() 1`] = `"g"`; + +exports[`random > seed: 1337 > alphaNumeric() 1`] = `"9"`; + +exports[`random > seed: 1337 > locale() 1`] = `"en_GH"`; + +exports[`random > seed: 1337 > numeric() 1`] = `"3"`; + +exports[`random > seed: 1337 > word() 1`] = `"leading"`; + +exports[`random > seed: 1337 > words() 1`] = `"Delaware"`; diff --git a/test/__snapshots__/science.spec.ts.snap b/test/__snapshots__/science.spec.ts.snap new file mode 100644 index 00000000000..bc7b0586044 --- /dev/null +++ b/test/__snapshots__/science.spec.ts.snap @@ -0,0 +1,46 @@ +// Vitest Snapshot v1 + +exports[`science > seed: 42 > chemicalElement() 1`] = ` +{ + "atomicNumber": 45, + "name": "Rhodium", + "symbol": "Rh", +} +`; + +exports[`science > seed: 42 > unit() 1`] = ` +{ + "name": "hertz", + "symbol": "Hz", +} +`; + +exports[`science > seed: 1211 > chemicalElement() 1`] = ` +{ + "atomicNumber": 110, + "name": "Darmstadtium", + "symbol": "Ds", +} +`; + +exports[`science > seed: 1211 > unit() 1`] = ` +{ + "name": "gray", + "symbol": "Gy", +} +`; + +exports[`science > seed: 1337 > chemicalElement() 1`] = ` +{ + "atomicNumber": 31, + "name": "Gallium", + "symbol": "Ga", +} +`; + +exports[`science > seed: 1337 > unit() 1`] = ` +{ + "name": "candela", + "symbol": "cd", +} +`; diff --git a/test/__snapshots__/system.spec.ts.snap b/test/__snapshots__/system.spec.ts.snap new file mode 100644 index 00000000000..3ed44caaa1a --- /dev/null +++ b/test/__snapshots__/system.spec.ts.snap @@ -0,0 +1,61 @@ +// Vitest Snapshot v1 + +exports[`system > seed: 42 > commonFileExt() 1`] = `"png"`; + +exports[`system > seed: 42 > commonFileName() 1`] = `"mobile_fish.mpe"`; + +exports[`system > seed: 42 > commonFileType() 1`] = `"audio"`; + +exports[`system > seed: 42 > directoryPath() 1`] = `"/opt/bin"`; + +exports[`system > seed: 42 > fileExt() 1`] = `"lrm"`; + +exports[`system > seed: 42 > fileName() 1`] = `"mobile_fish.jxsc"`; + +exports[`system > seed: 42 > filePath() 1`] = `"/opt/bin/directives_application_home.ptid"`; + +exports[`system > seed: 42 > fileType() 1`] = `"image"`; + +exports[`system > seed: 42 > mimeType() 1`] = `"application/vnd.ibm.rights-management"`; + +exports[`system > seed: 42 > semver() 1`] = `"3.7.9"`; + +exports[`system > seed: 1211 > commonFileExt() 1`] = `"htm"`; + +exports[`system > seed: 1211 > commonFileName() 1`] = `"turnpike_frozen_handcrafted.mp4v"`; + +exports[`system > seed: 1211 > commonFileType() 1`] = `"application"`; + +exports[`system > seed: 1211 > directoryPath() 1`] = `"/var/log"`; + +exports[`system > seed: 1211 > fileExt() 1`] = `"dic"`; + +exports[`system > seed: 1211 > fileName() 1`] = `"turnpike_frozen_handcrafted.heifs"`; + +exports[`system > seed: 1211 > filePath() 1`] = `"/var/log/forward_supervisor.z2"`; + +exports[`system > seed: 1211 > fileType() 1`] = `"x-shader"`; + +exports[`system > seed: 1211 > mimeType() 1`] = `"text/vnd.dmclientscript"`; + +exports[`system > seed: 1211 > semver() 1`] = `"9.4.8"`; + +exports[`system > seed: 1337 > commonFileExt() 1`] = `"wav"`; + +exports[`system > seed: 1337 > commonFileName() 1`] = `"delaware.mp2"`; + +exports[`system > seed: 1337 > commonFileType() 1`] = `"audio"`; + +exports[`system > seed: 1337 > directoryPath() 1`] = `"/Library"`; + +exports[`system > seed: 1337 > fileExt() 1`] = `"oa3"`; + +exports[`system > seed: 1337 > fileName() 1`] = `"delaware.cmc"`; + +exports[`system > seed: 1337 > filePath() 1`] = `"/Library/bike_interactive.link66"`; + +exports[`system > seed: 1337 > fileType() 1`] = `"font"`; + +exports[`system > seed: 1337 > mimeType() 1`] = `"application/vnd.chipnuts.karaoke-mmd"`; + +exports[`system > seed: 1337 > semver() 1`] = `"2.5.1"`; diff --git a/test/__snapshots__/unique.spec.ts.snap b/test/__snapshots__/unique.spec.ts.snap new file mode 100644 index 00000000000..d6ce5e55060 --- /dev/null +++ b/test/__snapshots__/unique.spec.ts.snap @@ -0,0 +1,25 @@ +// Vitest Snapshot v1 + +exports[`unique > seed: 42 > unique(() => number) 1`] = `37454`; + +exports[`unique > seed: 42 > unique(() => number), args) 1`] = `19`; + +exports[`unique > seed: 42 > unique(customMethod) 1`] = `"Test-188"`; + +exports[`unique > seed: 42 > unique(customMethod, args) 1`] = `"prefix-1-Test-188"`; + +exports[`unique > seed: 1211 > unique(() => number) 1`] = `92852`; + +exports[`unique > seed: 1211 > unique(() => number), args) 1`] = `47`; + +exports[`unique > seed: 1211 > unique(customMethod) 1`] = `"Test-465"`; + +exports[`unique > seed: 1211 > unique(customMethod, args) 1`] = `"prefix-1-Test-465"`; + +exports[`unique > seed: 1337 > unique(() => number) 1`] = `26202`; + +exports[`unique > seed: 1337 > unique(() => number), args) 1`] = `13`; + +exports[`unique > seed: 1337 > unique(customMethod) 1`] = `"Test-132"`; + +exports[`unique > seed: 1337 > unique(customMethod, args) 1`] = `"prefix-1-Test-132"`; diff --git a/test/__snapshots__/vehicle.spec.ts.snap b/test/__snapshots__/vehicle.spec.ts.snap new file mode 100644 index 00000000000..eaf9a4a083d --- /dev/null +++ b/test/__snapshots__/vehicle.spec.ts.snap @@ -0,0 +1,55 @@ +// Vitest Snapshot v1 + +exports[`vehicle > seed: 42 > bicycle() 1`] = `"Fitness Bicycle"`; + +exports[`vehicle > seed: 42 > color() 1`] = `"grey"`; + +exports[`vehicle > seed: 42 > fuel() 1`] = `"Electric"`; + +exports[`vehicle > seed: 42 > manufacturer() 1`] = `"Ford"`; + +exports[`vehicle > seed: 42 > model() 1`] = `"Escalade"`; + +exports[`vehicle > seed: 42 > type() 1`] = `"Extended Cab Pickup"`; + +exports[`vehicle > seed: 42 > vehicle() 1`] = `"Ford Golf"`; + +exports[`vehicle > seed: 42 > vin() 1`] = `"CTY6RSKK5ED315227"`; + +exports[`vehicle > seed: 42 > vrm() 1`] = `"JU91TUP"`; + +exports[`vehicle > seed: 1211 > bicycle() 1`] = `"Triathlon/Time Trial Bicycle"`; + +exports[`vehicle > seed: 1211 > color() 1`] = `"azure"`; + +exports[`vehicle > seed: 1211 > fuel() 1`] = `"Hybrid"`; + +exports[`vehicle > seed: 1211 > manufacturer() 1`] = `"Toyota"`; + +exports[`vehicle > seed: 1211 > model() 1`] = `"2"`; + +exports[`vehicle > seed: 1211 > type() 1`] = `"Wagon"`; + +exports[`vehicle > seed: 1211 > vehicle() 1`] = `"Toyota Challenger"`; + +exports[`vehicle > seed: 1211 > vin() 1`] = `"XFWS74Z1N5S678767"`; + +exports[`vehicle > seed: 1211 > vrm() 1`] = `"YL87FDZ"`; + +exports[`vehicle > seed: 1337 > bicycle() 1`] = `"Cyclocross Bicycle"`; + +exports[`vehicle > seed: 1337 > color() 1`] = `"black"`; + +exports[`vehicle > seed: 1337 > fuel() 1`] = `"Electric"`; + +exports[`vehicle > seed: 1337 > manufacturer() 1`] = `"Dodge"`; + +exports[`vehicle > seed: 1337 > model() 1`] = `"Colorado"`; + +exports[`vehicle > seed: 1337 > type() 1`] = `"Coupe"`; + +exports[`vehicle > seed: 1337 > vehicle() 1`] = `"Dodge Model S"`; + +exports[`vehicle > seed: 1337 > vin() 1`] = `"8J579HF1A7MK33574"`; + +exports[`vehicle > seed: 1337 > vrm() 1`] = `"GO12HOL"`; diff --git a/test/__snapshots__/word.spec.ts.snap b/test/__snapshots__/word.spec.ts.snap new file mode 100644 index 00000000000..0b200ad5d14 --- /dev/null +++ b/test/__snapshots__/word.spec.ts.snap @@ -0,0 +1,127 @@ +// Vitest Snapshot v1 + +exports[`word > seed: 42 > adjective() 1`] = `"harmonious"`; + +exports[`word > seed: 42 > adjective(10) 1`] = `"gregarious"`; + +exports[`word > seed: 42 > adjective(20) 1`] = `"harmonious"`; + +exports[`word > seed: 42 > adverb() 1`] = `"jealously"`; + +exports[`word > seed: 42 > adverb(10) 1`] = `"generously"`; + +exports[`word > seed: 42 > adverb(20) 1`] = `"jealously"`; + +exports[`word > seed: 42 > conjunction() 1`] = `"however"`; + +exports[`word > seed: 42 > conjunction(10) 1`] = `"as much as"`; + +exports[`word > seed: 42 > conjunction(20) 1`] = `"however"`; + +exports[`word > seed: 42 > interjection() 1`] = `"yahoo"`; + +exports[`word > seed: 42 > interjection(10) 1`] = `"yahoo"`; + +exports[`word > seed: 42 > interjection(20) 1`] = `"yahoo"`; + +exports[`word > seed: 42 > noun() 1`] = `"gale"`; + +exports[`word > seed: 42 > noun(10) 1`] = `"exposition"`; + +exports[`word > seed: 42 > noun(20) 1`] = `"gale"`; + +exports[`word > seed: 42 > preposition() 1`] = `"concerning"`; + +exports[`word > seed: 42 > preposition(10) 1`] = `"throughout"`; + +exports[`word > seed: 42 > preposition(20) 1`] = `"concerning"`; + +exports[`word > seed: 42 > verb() 1`] = `"function"`; + +exports[`word > seed: 42 > verb(10) 1`] = `"exasperate"`; + +exports[`word > seed: 42 > verb(20) 1`] = `"function"`; + +exports[`word > seed: 1211 > adjective() 1`] = `"verifiable"`; + +exports[`word > seed: 1211 > adjective(10) 1`] = `"unfinished"`; + +exports[`word > seed: 1211 > adjective(20) 1`] = `"verifiable"`; + +exports[`word > seed: 1211 > adverb() 1`] = `"viciously"`; + +exports[`word > seed: 1211 > adverb(10) 1`] = `"unbearably"`; + +exports[`word > seed: 1211 > adverb(20) 1`] = `"viciously"`; + +exports[`word > seed: 1211 > conjunction() 1`] = `"whereas"`; + +exports[`word > seed: 1211 > conjunction(10) 1`] = `"as soon as"`; + +exports[`word > seed: 1211 > conjunction(20) 1`] = `"whereas"`; + +exports[`word > seed: 1211 > interjection() 1`] = `"er"`; + +exports[`word > seed: 1211 > interjection(10) 1`] = `"er"`; + +exports[`word > seed: 1211 > interjection(20) 1`] = `"er"`; + +exports[`word > seed: 1211 > noun() 1`] = `"trick"`; + +exports[`word > seed: 1211 > noun(10) 1`] = `"trafficker"`; + +exports[`word > seed: 1211 > noun(20) 1`] = `"trick"`; + +exports[`word > seed: 1211 > preposition() 1`] = `"upon"`; + +exports[`word > seed: 1211 > preposition(10) 1`] = `"underneath"`; + +exports[`word > seed: 1211 > preposition(20) 1`] = `"upon"`; + +exports[`word > seed: 1211 > verb() 1`] = `"trick"`; + +exports[`word > seed: 1211 > verb(10) 1`] = `"trampoline"`; + +exports[`word > seed: 1211 > verb(20) 1`] = `"trick"`; + +exports[`word > seed: 1337 > adjective() 1`] = `"fabulous"`; + +exports[`word > seed: 1337 > adjective(10) 1`] = `"enchanting"`; + +exports[`word > seed: 1337 > adjective(20) 1`] = `"fabulous"`; + +exports[`word > seed: 1337 > adverb() 1`] = `"frankly"`; + +exports[`word > seed: 1337 > adverb(10) 1`] = `"enormously"`; + +exports[`word > seed: 1337 > adverb(20) 1`] = `"frankly"`; + +exports[`word > seed: 1337 > conjunction() 1`] = `"even if"`; + +exports[`word > seed: 1337 > conjunction(10) 1`] = `"as long as"`; + +exports[`word > seed: 1337 > conjunction(20) 1`] = `"even if"`; + +exports[`word > seed: 1337 > interjection() 1`] = `"ew"`; + +exports[`word > seed: 1337 > interjection(10) 1`] = `"ew"`; + +exports[`word > seed: 1337 > interjection(20) 1`] = `"ew"`; + +exports[`word > seed: 1337 > noun() 1`] = `"digit"`; + +exports[`word > seed: 1337 > noun(10) 1`] = `"depressive"`; + +exports[`word > seed: 1337 > noun(20) 1`] = `"digit"`; + +exports[`word > seed: 1337 > preposition() 1`] = `"barring"`; + +exports[`word > seed: 1337 > preposition(10) 1`] = `"concerning"`; + +exports[`word > seed: 1337 > preposition(20) 1`] = `"barring"`; + +exports[`word > seed: 1337 > verb() 1`] = `"dispense"`; + +exports[`word > seed: 1337 > verb(10) 1`] = `"demoralize"`; + +exports[`word > seed: 1337 > verb(20) 1`] = `"dispense"`; diff --git a/test/address.spec.ts b/test/address.spec.ts index 749a2f9fa46..76206b93f4d 100644 --- a/test/address.spec.ts +++ b/test/address.spec.ts @@ -1,5 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; +import { seededRuns } from './support/seededRuns'; import { times } from './support/times'; function degreesToRadians(degrees: number) { @@ -34,99 +35,6 @@ function haversine( return isMetric ? distance : kilometersToMiles(distance); } -const seededRuns = [ - { - seed: 42, - expectations: { - city: 'Port Valentine', - cityPrefix: 'West', - citySuffix: 'bury', - cityName: 'Gulfport', - streetName: 'Peyton Village', - streetPrefix: 'b', - streetSuffix: 'Isle', - streetAddress: '7917 Metz Pine', - fullStreetAddress: '7917 Metz Pine Apt. 410', - secondaryAddress: 'Apt. 791', - county: 'Berkshire', - country: 'Haiti', - countryCode: 'GY', - state: 'Maine', - stateAbbr: 'ME', - zipCode: '79177', - direction: 'South', - directionNonAbbr: 'South', - directionAbbr: 'S', - ordinalDirection: 'Northwest', - ordinalDirectionAbbr: 'NW', - cardinalDirection: 'East', - cardinalDirectionAbbr: 'E', - timeZone: 'Europe/Amsterdam', - nearbyGpsCoordinates: ['0.0814', '-0.0809'], - }, - }, - { - seed: 1337, - expectations: { - city: 'New Carmelo', - cityPrefix: 'West', - citySuffix: 'boro', - cityName: 'Dubuque', - streetName: 'Keith Dam', - streetPrefix: 'a', - streetSuffix: 'Forks', - streetAddress: '51225 Alexys Haven', - fullStreetAddress: '51225 Alexys Haven Apt. 552', - secondaryAddress: 'Apt. 512', - county: 'Bedfordshire', - country: 'Equatorial Guinea', - countryCode: 'EH', - state: 'Indiana', - stateAbbr: 'IN', - zipCode: '51225', - direction: 'South', - directionNonAbbr: 'South', - directionAbbr: 'S', - ordinalDirection: 'Northwest', - ordinalDirectionAbbr: 'NW', - cardinalDirection: 'East', - cardinalDirectionAbbr: 'E', - timeZone: 'Africa/Casablanca', - nearbyGpsCoordinates: ['0.0806', '-0.0061'], - }, - }, - { - seed: 1211, - expectations: { - city: 'La Crosse', - cityPrefix: 'Fort', - citySuffix: 'shire', - cityName: 'Urbana', - streetName: 'Koch Turnpike', - streetPrefix: 'c', - streetSuffix: 'Via', - streetAddress: '487 Breana Wells', - fullStreetAddress: '487 Breana Wells Apt. 616', - secondaryAddress: 'Suite 487', - county: 'Cambridgeshire', - country: 'Uganda', - countryCode: 'UM', - state: 'Washington', - stateAbbr: 'WA', - zipCode: '48721-9061', - direction: 'Southwest', - directionNonAbbr: 'Southwest', - directionAbbr: 'SW', - ordinalDirection: 'Southwest', - ordinalDirectionAbbr: 'SW', - cardinalDirection: 'West', - cardinalDirectionAbbr: 'W', - timeZone: 'Asia/Magadan', - nearbyGpsCoordinates: ['-0.0287', '0.0596'], - }, - }, -]; - const NON_SEEDED_BASED_RUN = 5; const functionNames = [ @@ -152,14 +60,14 @@ describe('address', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + 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).toBe(expectations[functionName]); + expect(actual).toMatchSnapshot(); }); } @@ -169,14 +77,15 @@ describe('address', () => { const address = faker.address.streetAddress(); - expect(address).toStrictEqual(expectations.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).toEqual(expectations.fullStreetAddress); + + expect(address).toMatchSnapshot(); }); }); @@ -185,36 +94,24 @@ describe('address', () => { faker.seed(seed); const direction = faker.address.direction(); - const expected = expectations.direction; - expect( - direction, - `The random direction should be equal to ${expected}` - ).toBe(expected); + expect(direction).toMatchSnapshot(); }); it('should not return abbreviation when useAbbr is false', () => { faker.seed(seed); const direction = faker.address.direction(false); - const expected = expectations.directionNonAbbr; - expect( - direction, - `The abbreviation of direction when useAbbr is false should be equal ${expected}. Current is ${direction}` - ).toBe(expected); + expect(direction).toMatchSnapshot(); }); it('returns abbreviation when useAbbr is true', () => { faker.seed(seed); const direction = faker.address.direction(true); - const expected = expectations.directionAbbr; - expect( - direction, - `The abbreviation of direction when useAbbr is true should be equal ${expected}. Current is ${direction}` - ).toBe(expected); + expect(direction).toMatchSnapshot(); }); }); @@ -223,24 +120,16 @@ describe('address', () => { faker.seed(seed); const ordinalDirection = faker.address.ordinalDirection(); - const expected = expectations.ordinalDirection; - expect( - ordinalDirection, - `The ransom ordinal direction should be equal ${expected}. Current is ${ordinalDirection}` - ).toBe(expected); + expect(ordinalDirection).toMatchSnapshot(); }); it('returns abbreviation when useAbbr is true', () => { faker.seed(seed); const ordinalDirection = faker.address.ordinalDirection(true); - const expected = expectations.ordinalDirectionAbbr; - expect( - ordinalDirection, - `The ordinal direction when useAbbr is true should be equal ${expected}. Current is ${ordinalDirection}` - ).toBe(expected); + expect(ordinalDirection).toMatchSnapshot(); }); }); @@ -249,24 +138,16 @@ describe('address', () => { faker.seed(seed); const cardinalDirection = faker.address.cardinalDirection(); - const expected = expectations.cardinalDirection; - expect( - cardinalDirection, - `The random cardinal direction should be equal ${expected}. Current is ${cardinalDirection}` - ).toBe(expected); + expect(cardinalDirection).toMatchSnapshot(); }); it('returns abbreviation when useAbbr is true', () => { faker.seed(seed); const cardinalDirection = faker.address.cardinalDirection(true); - const expected = expectations.cardinalDirectionAbbr; - expect( - cardinalDirection, - `The cardinal direction when useAbbr is true should be equal ${expected}. Current is ${cardinalDirection}` - ).toBe(expected); + expect(cardinalDirection).toMatchSnapshot(); }); }); @@ -277,7 +158,8 @@ describe('address', () => { // this input is required for all expected results for this function const coordsInput: [number, number] = [0, 0]; const coords = faker.address.nearbyGPSCoordinate(coordsInput); - expect(coords).toEqual(expectations.nearbyGpsCoordinates); + + expect(coords).toMatchSnapshot(); }); }); }); diff --git a/test/animal.spec.ts b/test/animal.spec.ts index a3ad1af6d42..4f3d2370ddb 100644 --- a/test/animal.spec.ts +++ b/test/animal.spec.ts @@ -1,65 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - bear: 'Sun bear', - bird: 'Iceland Gull', - cat: 'Himalayan', - cetacean: 'Pantropical Spotted Dolphin', - cow: 'Fleckvieh', - crocodilia: 'African Slender-snouted Crocodile', - dog: 'Garafian Shepherd', - fish: 'Northern snakehead', - horse: 'Furioso-North Star', - insect: 'Gouty oak gall', - lion: 'West African Lion', - rabbit: 'English Spot', - snake: 'Grey-banded kingsnake', - type: 'lion', - }, - }, - { - seed: 1337, - expectations: { - bear: 'Sun bear', - bird: 'American Golden-Plover', - cat: 'Devon Rex', - cetacean: 'Costero', - cow: 'Canchim', - crocodilia: 'Cuvier’s Dwarf Caiman', - dog: 'Chinese Crested Dog', - fish: 'Jumbo flying squid', - horse: 'Colorado Ranger', - insect: 'Eulophid wasp', - lion: 'Barbary Lion', - rabbit: 'Cinnamon', - snake: 'Fierce snake', - type: 'bear', - }, - }, - { - seed: 1211, - expectations: { - bear: 'Polar bear', - bird: 'Reed Bunting', - cat: 'Tonkinese', - cetacean: 'La Plata Dolphin', - cow: 'Breed', - crocodilia: 'Gharial', - dog: 'Tibetan Spaniel', - fish: 'Bigeye scad', - horse: 'Ukrainian Riding Horse', - insect: 'Western paper wasp', - lion: 'Cape lion', - rabbit: 'Silver Marten', - snake: 'Tiger pit viper', - type: 'horse', - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -85,14 +26,15 @@ describe('animal', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + 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).toEqual(expectations[functionName]); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/color.spec.ts b/test/color.spec.ts index 9d438291783..a1b5dd9d905 100644 --- a/test/color.spec.ts +++ b/test/color.spec.ts @@ -1,57 +1,7 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; import { CSS_FUNCTIONS, CSS_SPACES } from '../src/modules/color'; - -const seededRuns = [ - { - seed: 42, - expectations: { - human: 'grey', - space: 'Rec. 709', - cssSupportedFunction: 'hsla', - cssSupportedSpace: 'rec2020', - rgb: '#8be4ab', - hsl: [135, 0.8, 0.96], - hwb: [135, 0.8, 0.96], - cmyk: [0.37, 0.8, 0.96, 0.18], - lab: [0.37454, 59.3086, 90.1429], - lch: [0.37454, 183.2, 218.7], - colorByCSSColorSpace: [0.3745, 0.7966, 0.9508], - }, - }, - { - seed: 1337, - expectations: { - human: 'black', - space: 'ProPhoto RGB Color Space', - cssSupportedFunction: 'hsl', - cssSupportedSpace: 'display-p3', - rgb: '#5c346b', - hsl: [94, 0.56, 0.16], - hwb: [94, 0.56, 0.16], - cmyk: [0.26, 0.56, 0.16, 0.21], - lab: [0.262024, 12.106, -68.2632], - lch: [0.262024, 128.9, 36.5], - colorByCSSColorSpace: [0.262, 0.5605, 0.1586], - }, - }, - { - seed: 1211, - expectations: { - human: 'azure', - space: 'LMS', - cssSupportedFunction: 'color', - cssSupportedSpace: 'rec2020', - rgb: '#eadb42', - hsl: [335, 0.46, 0.9], - hwb: [335, 0.46, 0.9], - cmyk: [0.93, 0.46, 0.9, 0.78], - lab: [0.928521, -8.197, 78.6944], - lch: [0.928521, 105.6, 205.5], - colorByCSSColorSpace: [0.9286, 0.459, 0.8935], - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -74,14 +24,15 @@ describe('color', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + 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).toEqual(expectations[functionName]); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/commerce.spec.ts b/test/commerce.spec.ts index 383b0a41c31..bbd33ff0152 100644 --- a/test/commerce.spec.ts +++ b/test/commerce.spec.ts @@ -1,50 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - color: 'grey', - department: 'Tools', - productName: 'Fantastic Soft Sausages', - price: '375.00', - productAdjective: 'Fantastic', - productMaterial: 'Plastic', - product: 'Pants', - productDescription: - 'The Apollotech B340 is an affordable wireless mouse with reliable connectivity, 12 months battery life and modern design', - }, - }, - { - seed: 1337, - expectations: { - color: 'black', - department: 'Computers', - productName: 'Incredible Granite Keyboard', - price: '263.00', - productAdjective: 'Incredible', - productMaterial: 'Concrete', - product: 'Ball', - productDescription: - 'The slim & simple Maple Gaming Keyboard from Dev Byte comes with a sleek body and 7- Color RGB LED Back-lighting for smart functionality', - }, - }, - { - seed: 1211, - expectations: { - color: 'azure', - department: 'Automotive', - productName: 'Unbranded Cotton Salad', - price: '929.00', - productAdjective: 'Unbranded', - productMaterial: 'Frozen', - product: 'Sausages', - productDescription: - 'Andy shoes are designed to keeping in mind durability as well as trends, the most stylish range of shoes & sandals', - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -64,14 +20,15 @@ describe('commerce', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + 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).toEqual(expectations[functionName]); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/company.spec.ts b/test/company.spec.ts index 6ef8b551aab..b0f207923ee 100644 --- a/test/company.spec.ts +++ b/test/company.spec.ts @@ -1,56 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - suffixes: ['Inc', 'and Sons', 'LLC', 'Group'], - companyName: 'Schinner - Wiegand', - companySuffix: 'and Sons', - catchPhrase: 'Implemented responsive throughput', - bs: 'seize impactful web services', - catchPhraseAdjective: 'Implemented', - catchPhraseDescriptor: 'explicit', - catchPhraseNoun: 'framework', - bsAdjective: 'dynamic', - bsBuzz: 'seize', - bsNoun: 'portals', - }, - }, - { - seed: 1337, - expectations: { - suffixes: ['Inc', 'and Sons', 'LLC', 'Group'], - companyName: 'Macejkovic Inc', - companySuffix: 'and Sons', - catchPhrase: 'Expanded leading edge capacity', - bs: 'incentivize efficient initiatives', - catchPhraseAdjective: 'Expanded', - catchPhraseDescriptor: 'demand-driven', - catchPhraseNoun: 'data-warehouse', - bsAdjective: 'global', - bsBuzz: 'incentivize', - bsNoun: 'ROI', - }, - }, - { - seed: 1211, - expectations: { - suffixes: ['Inc', 'and Sons', 'LLC', 'Group'], - companyName: 'Koch, Trantow and Sanford', - companySuffix: 'Group', - catchPhrase: 'Up-sized high-level success', - bs: 'cultivate bleeding-edge functionalities', - catchPhraseAdjective: 'Up-sized', - catchPhraseDescriptor: 'upward-trending', - catchPhraseNoun: 'system engine', - bsAdjective: 'plug-and-play', - bsBuzz: 'cultivate', - bsNoun: 'experiences', - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -73,14 +23,15 @@ describe('company', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + 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).toEqual(expectations[functionName]); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/database.spec.ts b/test/database.spec.ts index 75fe6ac36ba..d9f538caab2 100644 --- a/test/database.spec.ts +++ b/test/database.spec.ts @@ -1,38 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - column: 'token', - type: 'smallint', - collation: 'utf8_bin', - engine: 'MEMORY', - mongodbObjectId: '8be4abdd39321ad7d3fe01ff', - }, - }, - { - seed: 1337, - expectations: { - column: 'email', - type: 'time', - collation: 'utf8_general_ci', - engine: 'MyISAM', - mongodbObjectId: '5c346ba075bd57f5a62b82d7', - }, - }, - { - seed: 1211, - expectations: { - column: 'createdAt', - type: 'geometry', - collation: 'cp1250_general_ci', - engine: 'ARCHIVE', - mongodbObjectId: 'eadb42f0e3f4a973fab0aeef', - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -49,14 +17,15 @@ describe('database', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + 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).toEqual(expectations[functionName]); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/datatype.spec.ts b/test/datatype.spec.ts index 9b6a74b3711..04da02d2826 100644 --- a/test/datatype.spec.ts +++ b/test/datatype.spec.ts @@ -1,224 +1,6 @@ import { describe, expect, it } from 'vitest'; import { faker, FakerError } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - number: { - noArgs: 37454, - numbers: [2, 5, 6, 1, 5], - withMin: 37412, - withMinAndMax: -1, - withMax: 26, - withMinAndMaxAndPrecision: -0.43, - }, - float: { - noArgs: 37453.64, - numbers: [37452, 79656, 95076, 18342, 73200], - withMin: 37411.64, - withMinAndMax: -0.43, - withMax: 25.84, - withMinAndMaxAndPrecision: -0.4261, - }, - datetime: { - noArgs: new Date('2031-03-14T21:33:22.114Z'), - number: new Date('1994-03-20T17:23:00.629Z'), - withMin: new Date('1801-04-11T15:13:06.330Z'), - withMax: new Date('1994-07-11T09:43:47.230Z'), - withMinMax: new Date('1689-09-09T08:39:09.444Z'), - }, - string: { - noArgs: 'Cky2eiXX/J', - length: 'Cky2eiXX/J/*&Kq@X.b]"&{dnx4!1}2Z=YQ!I#6', - length: '9U/4:SK$>6QX9@{:e=+kD)[B,e|/Jqjjj!BLGDWQgC', - }, - uuid: { - noArgs: '48234870-5389-445f-8b41-c61a52bf27dc', - }, - boolean: { - noArgs: false, - }, - hexadecimal: { - noArgs: '0x5', - length: '0x5c346ba075bd57F5A62B82d72AF39CBBB07a98cbA8', - }, - json: { - noArgs: JSON.stringify({ - foo: 56052, - bar: 21258, - bike: 54308, - a: 3397, - b: 23538, - name: 'X9@{:e=+kD', - prop: 62850, - }), - }, - array: { - noArgs: [ - 56052, - 21258, - 54308, - 3397, - 23538, - 'X9@{:e=+kD', - 62850, - 12505, - '|/Jqjjj!BL', - 38106, - ], - length: [56052, 21258, 54308, 3397], - }, - bigInt: { - noArgs: 251225403255239n, - value: 25n, - }, - }, - }, - { - seed: 1211, - expectations: { - number: { - noArgs: 92852, - numbers: [6, 3, 6, 5, 1], - withMin: 92810, - withMinAndMax: 61, - withMax: 64, - withMinAndMaxAndPrecision: 61.07, - }, - float: { - noArgs: 92851.09, - numbers: [92856, 45900, 89346, 77826, 22554], - withMin: 92809.09, - withMinAndMax: 61.07, - withMax: 64.07, - withMinAndMaxAndPrecision: 61.0658, - }, - datetime: { - noArgs: new Date('2092-02-20T03:42:04.341Z'), - number: new Date('2000-06-14T02:54:42.082Z'), - withMin: new Date('2065-11-10T19:27:20.915Z'), - withMax: new Date('2001-03-20T11:14:25.251Z'), - withMinMax: new Date('1789-03-26T15:44:45.219Z'), - }, - string: { - noArgs: 'wKti5-}$_/', - length: 'wKti5-}$_/`4hHA0afl"h^]dnwI { - for (const { seed, expectations } of seededRuns) { + 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).toEqual(expectations[functionName].noArgs); + expect(actual).toMatchSnapshot(); }); } @@ -251,9 +33,9 @@ describe('datatype', () => { it('should return a deterministic value for given number', () => { faker.seed(seed); - for (const num of expectations.number.numbers) { + for (let i = 0; i < 5; i++) { const actual = faker.datatype.number(6); - expect(actual).toEqual(num); + expect(actual).toMatchSnapshot(); } }); @@ -261,21 +43,21 @@ describe('datatype', () => { faker.seed(seed); const actual = faker.datatype.number({ min: -42 }); - expect(actual).toEqual(expectations.number.withMin); + 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).toEqual(expectations.number.withMinAndMax); + expect(actual).toMatchSnapshot(); }); it('should return a deterministic value for given max', () => { faker.seed(seed); const actual = faker.datatype.number({ max: 69 }); - expect(actual).toEqual(expectations.number.withMax); + expect(actual).toMatchSnapshot(); }); it('should return a deterministic value for given min, max and precision', () => { @@ -286,7 +68,7 @@ describe('datatype', () => { max: 69, precision: 0.01, }); - expect(actual).toEqual(expectations.number.withMinAndMaxAndPrecision); + expect(actual).toMatchSnapshot(); }); it('should throw when min > max', () => { @@ -305,9 +87,9 @@ describe('datatype', () => { it('should return a deterministic value for given number', () => { faker.seed(seed); - for (const num of expectations.float.numbers) { + for (let i = 0; i < 5; i++) { const actual = faker.datatype.float(6); - expect(actual).toEqual(num); + expect(actual).toMatchSnapshot(); } }); @@ -315,21 +97,21 @@ describe('datatype', () => { faker.seed(seed); const actual = faker.datatype.float({ min: -42 }); - expect(actual).toEqual(expectations.float.withMin); + 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).toEqual(expectations.float.withMinAndMax); + expect(actual).toMatchSnapshot(); }); it('should return a deterministic value for given max', () => { faker.seed(seed); const actual = faker.datatype.float({ max: 69 }); - expect(actual).toEqual(expectations.float.withMax); + expect(actual).toMatchSnapshot(); }); it('should return a deterministic value for given min, max and precision', () => { @@ -340,7 +122,7 @@ describe('datatype', () => { max: 69, precision: 0.0001, }); - expect(actual).toEqual(expectations.float.withMinAndMaxAndPrecision); + expect(actual).toMatchSnapshot(); }); }); @@ -351,7 +133,7 @@ describe('datatype', () => { const actual = faker.datatype.datetime( Date.parse('2001-04-03T23:21:10.773Z') ); - expect(actual).toEqual(expectations.datetime.number); + expect(actual).toMatchSnapshot(); }); it('should return a deterministic date when given a min date', () => { @@ -360,7 +142,7 @@ describe('datatype', () => { const actual = faker.datatype.datetime({ min: Date.parse('1622-05-23T13:45:08.843Z'), }); - expect(actual).toEqual(expectations.datetime.withMin); + expect(actual).toMatchSnapshot(); }); it('should return a deterministic date when given a max date', () => { @@ -369,7 +151,7 @@ describe('datatype', () => { const actual = faker.datatype.datetime({ max: Date.parse('2002-01-29T19:47:52.605Z'), }); - expect(actual).toEqual(expectations.datetime.withMax); + expect(actual).toMatchSnapshot(); }); it('should return a deterministic date when given a min and max date', () => { @@ -379,7 +161,7 @@ describe('datatype', () => { min: Date.parse('1622-05-23T13:45:08.843Z'), max: Date.parse('1802-01-29T19:47:52.605Z'), }); - expect(actual).toEqual(expectations.datetime.withMinMax); + expect(actual).toMatchSnapshot(); }); }); @@ -388,7 +170,7 @@ describe('datatype', () => { faker.seed(seed); const actual = faker.datatype.string(42); - expect(actual).toEqual(expectations.string.length); + expect(actual).toMatchSnapshot(); }); }); @@ -397,7 +179,7 @@ describe('datatype', () => { faker.seed(seed); const actual = faker.datatype.hexadecimal(42); - expect(actual).toEqual(expectations.hexadecimal.length); + expect(actual).toMatchSnapshot(); }); }); @@ -406,7 +188,7 @@ describe('datatype', () => { faker.seed(seed); const actual = faker.datatype.array(4); - expect(actual).toEqual(expectations.array.length); + expect(actual).toMatchSnapshot(); }); }); @@ -415,7 +197,7 @@ describe('datatype', () => { faker.seed(seed); const actual = faker.datatype.bigInt(42); - expect(actual).toEqual(expectations.bigInt.value); + expect(actual).toMatchSnapshot(); }); it('should throw when min > max', () => { diff --git a/test/date.spec.ts b/test/date.spec.ts index 228c7a06365..f6f64dbe839 100644 --- a/test/date.spec.ts +++ b/test/date.spec.ts @@ -1,134 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - past: { - noArgs: new Date('2020-10-08T00:10:58.041Z'), - ten: new Date('2017-05-26T15:26:24.637Z'), - }, - future: { - noArgs: new Date('2021-07-08T10:07:33.381Z'), - ten: new Date('2024-11-19T18:52:06.785Z'), - }, - between: new Date('2021-03-15T19:30:57.091Z'), - betweens: [ - new Date('2021-03-15T19:30:57.091Z'), - new Date('2021-04-09T17:05:10.406Z'), - new Date('2021-04-18T19:23:52.973Z'), - ], - recent: new Date('2021-02-21T08:11:56.820Z'), - soon: new Date('2021-03-13T23:15:38.042Z'), - month: { - noArgs: 'May', - abbr: 'May', - context: 'May', - abbr_context: 'May', - }, - weekday: { - noArgs: 'Tuesday', - abbr: 'Tue', - context: 'Tuesday', - abbr_context: 'Tue', - }, - birthdate: { - noArgs: new Date('1943-08-06T10:03:17.283Z'), - ageMode: new Date('1942-09-15T09:55:20.478Z'), - ageRange: new Date('1941-12-15T14:59:26.122Z'), - age: new Date('1959-06-26T13:52:19.442Z'), - yearMode: new Date('1943-08-06T10:03:17.283Z'), - yearRange: new Date('1937-10-30T15:52:07.381Z'), - year: new Date('2000-05-16T22:59:36.513Z'), - }, - }, - }, - { - seed: 1337, - expectations: { - past: { - noArgs: new Date('2020-11-18T01:49:04.785Z'), - ten: new Date('2018-07-11T07:47:33.089Z'), - }, - future: { - noArgs: new Date('2021-05-28T08:29:26.637Z'), - ten: new Date('2023-10-06T02:30:58.333Z'), - }, - between: new Date('2021-03-09T04:11:24.667Z'), - betweens: [ - new Date('2021-03-03T01:51:22.512Z'), - new Date('2021-03-09T04:11:24.667Z'), - new Date('2021-03-26T18:53:00.564Z'), - ], - recent: new Date('2021-02-21T10:53:58.041Z'), - soon: new Date('2021-03-13T20:33:36.821Z'), - month: { - noArgs: 'April', - abbr: 'Apr', - context: 'April', - abbr_context: 'Apr', - }, - weekday: { - noArgs: 'Monday', - abbr: 'Mon', - context: 'Monday', - abbr_context: 'Mon', - }, - birthdate: { - noArgs: new Date('1936-07-04T15:55:47.989Z'), - ageMode: new Date('1935-08-14T07:41:47.183Z'), - ageRange: new Date('1935-02-03T18:44:07.874Z'), - age: new Date('1959-05-16T12:14:12.585Z'), - yearMode: new Date('1936-07-04T15:55:47.989Z'), - yearRange: new Date('1926-06-20T07:18:05.539Z'), - year: new Date('2000-04-06T02:45:32.324Z'), - }, - }, - }, - { - seed: 1211, - expectations: { - past: { - noArgs: new Date('2020-03-19T19:19:04.071Z'), - ten: new Date('2011-11-12T14:47:19.955Z'), - }, - future: { - noArgs: new Date('2022-01-26T14:59:27.351Z'), - ten: new Date('2030-06-03T19:31:11.467Z'), - }, - between: new Date('2021-04-17T11:58:13.327Z'), - betweens: [ - new Date('2021-03-20T19:08:07.621Z'), // done - new Date('2021-04-15T10:20:25.794Z'), - new Date('2021-04-17T11:58:13.327Z'), - ], - recent: new Date('2021-02-20T18:54:13.498Z'), - soon: new Date('2021-03-14T12:33:21.364Z'), - month: { - noArgs: 'December', - abbr: 'Dec', - context: 'December', - abbr_context: 'Dec', - }, - weekday: { - noArgs: 'Saturday', - abbr: 'Sat', - context: 'Saturday', - abbr_context: 'Sat', - }, - birthdate: { - noArgs: new Date('1978-06-29T09:24:02.647Z'), - ageMode: new Date('1977-08-10T01:09:17.468Z'), - ageRange: new Date('1975-10-01T07:11:50.190Z'), - age: new Date('1960-01-14T18:44:13.966Z'), - yearMode: new Date('1978-06-29T09:24:02.647Z'), - yearRange: new Date('1993-10-11T07:44:59.519Z'), - year: new Date('2000-12-04T01:16:03.286Z'), - }, - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const converterMap = [ (d: Date) => d, @@ -143,7 +15,7 @@ describe('date', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { describe('past()', () => { it('should return deterministic past value on given refDate of type string', () => { @@ -151,7 +23,7 @@ describe('date', () => { const actual = faker.date.past(undefined, '2021-02-21T17:09:15.711Z'); - expect(actual).toEqual(expectations.past.noArgs); + expect(actual).toMatchSnapshot(); }); it('should return deterministic past value on given refDate of type date', () => { @@ -162,7 +34,7 @@ describe('date', () => { new Date('2021-02-21T17:09:15.711Z') ); - expect(actual).toEqual(expectations.past.noArgs); + expect(actual).toMatchSnapshot(); }); it('should return deterministic past value on given years 10 and refDate of type string', () => { @@ -170,7 +42,7 @@ describe('date', () => { const actual = faker.date.past(10, '2021-02-21T17:09:15.711Z'); - expect(actual).toEqual(expectations.past.ten); + expect(actual).toMatchSnapshot(); }); it('should return deterministic past value on given years 10 and refDate of type date', () => { @@ -181,7 +53,7 @@ describe('date', () => { new Date('2021-02-21T17:09:15.711Z') ); - expect(actual).toEqual(expectations.past.ten); + expect(actual).toMatchSnapshot(); }); }); @@ -194,7 +66,7 @@ describe('date', () => { '2021-02-21T17:09:15.711Z' ); - expect(actual).toEqual(expectations.future.noArgs); + expect(actual).toMatchSnapshot(); }); it('should return deterministic future value on given refDate of type date', () => { @@ -205,7 +77,7 @@ describe('date', () => { new Date('2021-02-21T17:09:15.711Z') ); - expect(actual).toEqual(expectations.future.noArgs); + expect(actual).toMatchSnapshot(); }); it('should return deterministic future value on given years 10 and refDate of type string', () => { @@ -213,7 +85,7 @@ describe('date', () => { const actual = faker.date.future(10, '2021-02-21T17:09:15.711Z'); - expect(actual).toEqual(expectations.future.ten); + expect(actual).toMatchSnapshot(); }); it('should return deterministic future value on given years 10 and refDate of type date', () => { @@ -224,7 +96,7 @@ describe('date', () => { new Date('2021-02-21T17:09:15.711Z') ); - expect(actual).toEqual(expectations.future.ten); + expect(actual).toMatchSnapshot(); }); }); @@ -237,7 +109,7 @@ describe('date', () => { '2021-04-21T17:11:17.711Z' ); - expect(actual).toEqual(expectations.between); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value between given real dates', () => { @@ -248,7 +120,7 @@ describe('date', () => { new Date('2021-04-21T17:11:17.711Z') ); - expect(actual).toEqual(expectations.between); + expect(actual).toMatchSnapshot(); }); }); @@ -261,7 +133,7 @@ describe('date', () => { '2021-04-21T17:11:17.711Z' ); - expect(actual).toEqual(expectations.betweens); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value betweens given dates', () => { @@ -272,7 +144,7 @@ describe('date', () => { new Date('2021-04-21T17:11:17.711Z') ); - expect(actual).toEqual(expectations.betweens); + expect(actual).toMatchSnapshot(); }); }); @@ -285,7 +157,7 @@ describe('date', () => { '2021-02-21T17:11:17.711Z' ); - expect(actual).toEqual(expectations.recent); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value recent to given refDate of type date', () => { @@ -296,7 +168,7 @@ describe('date', () => { new Date('2021-02-21T17:11:17.711Z') ); - expect(actual).toEqual(expectations.recent); + expect(actual).toMatchSnapshot(); }); }); @@ -306,7 +178,7 @@ describe('date', () => { const actual = faker.date.soon(undefined, '2021-03-13T14:16:17.151Z'); - expect(actual).toEqual(expectations.soon); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value soon to given refDate of type date', () => { @@ -317,7 +189,7 @@ describe('date', () => { new Date('2021-03-13T14:16:17.151Z') ); - expect(actual).toEqual(expectations.soon); + expect(actual).toMatchSnapshot(); }); }); @@ -327,7 +199,7 @@ describe('date', () => { const actual = faker.date.month(); - expect(actual).toEqual(expectations.month.noArgs); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value month with abbr true', () => { @@ -335,7 +207,7 @@ describe('date', () => { const actual = faker.date.month({ abbr: true }); - expect(actual).toEqual(expectations.month.abbr); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value month with context true', () => { @@ -343,7 +215,7 @@ describe('date', () => { const actual = faker.date.month({ context: true }); - expect(actual).toEqual(expectations.month.context); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value month with abbr and context true', () => { @@ -351,7 +223,7 @@ describe('date', () => { const actual = faker.date.month({ abbr: true, context: true }); - expect(actual).toEqual(expectations.month.abbr_context); + expect(actual).toMatchSnapshot(); }); }); @@ -361,7 +233,7 @@ describe('date', () => { const actual = faker.date.weekday(); - expect(actual).toEqual(expectations.weekday.noArgs); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value weekday with abbr true', () => { @@ -369,7 +241,7 @@ describe('date', () => { const actual = faker.date.weekday({ abbr: true }); - expect(actual).toEqual(expectations.weekday.abbr); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value weekday with context true', () => { @@ -377,7 +249,7 @@ describe('date', () => { const actual = faker.date.weekday({ context: true }); - expect(actual).toEqual(expectations.weekday.context); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value weekday with abbr and context true', () => { @@ -385,7 +257,7 @@ describe('date', () => { const actual = faker.date.weekday({ abbr: true, context: true }); - expect(actual).toEqual(expectations.weekday.abbr_context); + expect(actual).toMatchSnapshot(); }); }); @@ -397,7 +269,7 @@ describe('date', () => { refDate: '2000-02-09T20:54:02.397Z', }); - expect(actual).toEqual(expectations.birthdate.noArgs); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value birthdate by age mode ', () => { @@ -408,7 +280,7 @@ describe('date', () => { refDate: '2000-02-09T20:54:02.397Z', }); - expect(actual).toEqual(expectations.birthdate.ageMode); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value birthdate by age range', () => { @@ -421,7 +293,7 @@ describe('date', () => { refDate: '2000-02-09T20:54:02.397Z', }); - expect(actual).toEqual(expectations.birthdate.ageRange); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value birthdate by age', () => { @@ -434,7 +306,7 @@ describe('date', () => { refDate: '2000-02-09T20:54:02.397Z', }); - expect(actual).toEqual(expectations.birthdate.age); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value birthdate by year mode', () => { @@ -445,7 +317,7 @@ describe('date', () => { refDate: '2000-02-09T20:54:02.397Z', }); - expect(actual).toEqual(expectations.birthdate.yearMode); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value birthdate by year range', () => { @@ -458,7 +330,7 @@ describe('date', () => { refDate: '2000-02-09T20:54:02.397Z', }); - expect(actual).toEqual(expectations.birthdate.yearRange); + expect(actual).toMatchSnapshot(); }); it('should return deterministic value birthdate by year', () => { @@ -471,7 +343,7 @@ describe('date', () => { refDate: '2000-02-09T20:54:02.397Z', }); - expect(actual).toEqual(expectations.birthdate.year); + expect(actual).toMatchSnapshot(); }); }); }); diff --git a/test/finance.spec.ts b/test/finance.spec.ts index ef3fb045d72..83f997815c1 100644 --- a/test/finance.spec.ts +++ b/test/finance.spec.ts @@ -3,81 +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'; - -const seedRuns = [ - { - seed: 42, - expectations: { - account: '37917755', - accountName: 'Money Market Account', - routingNumber: '379177554', - mask: '(...3791)', - amount: '374.54', - transactionType: 'withdrawal', - currencyCode: 'IQD', - currencyName: 'Iraqi Dinar', - currencySymbol: '₱', - bitcoinAddress: '3XbJMAAara64sSkA9HD24YHQWd1b', - litecoinAddress: '3XbJMAAara64sSkA9HD24YHQWd1b', - creditCardNumber: '3581-7755-1410-0484', - creditCardCVV: '379', - pin: '3791', - ethereumAddress: '0x8be4abdd39321ad7d3fe01ffce404f4d6db0906b', - iban: 'GT30Y75110867098F1E3542612J4', - bic: 'UYEOSCP1514', - transactionDescription: - 'invoice transaction at Wiegand, Deckow and Renner using card ending with ***(...8361) for SDG 374.54 in account ***55141004', - }, - }, - { - seed: 1337, - expectations: { - account: '25122540', - accountName: 'Money Market Account', - routingNumber: '251225401', - mask: '(...2512)', - amount: '262.02', - transactionType: 'withdrawal', - currencyCode: 'FJD', - currencyName: 'Fiji Dollar', - currencySymbol: '$', - bitcoinAddress: '3adhxs2jewAgkYgJi7No6Cn8JZa', - litecoinAddress: 'Madhxs2jewAgkYgJi7No6Cn8JZar', - creditCardNumber: '6011-6212-2540-3255-2398', - creditCardCVV: '251', - pin: '2512', - ethereumAddress: '0x5c346ba075bd57f5a62b82d72af39cbbb07a98cb', - iban: 'FO7710540350900318', - bic: 'OEFELYL1032', - transactionDescription: - 'withdrawal transaction at Cronin - Effertz using card ending with ***(...3927) for GTQ 262.02 in account ***54032552', - }, - }, - { - seed: 1211, - expectations: { - account: '94872190', - accountName: 'Personal Loan Account', - routingNumber: '948721904', - mask: '(...9487)', - amount: '928.52', - transactionType: 'invoice', - currencyCode: 'XDR', - currencyName: 'SDR', - currencySymbol: '₭', - bitcoinAddress: '1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsA', - litecoinAddress: 'MTMe8Z3EaFdLqmaGKP1LEEJQVriSZRZds', - creditCardNumber: '4872190616274', - creditCardCVV: '948', - pin: '9487', - ethereumAddress: '0xeadb42f0e3f4a973fab0aeefce96dfcf49cd438d', - iban: 'TN0382001124170679299069', - bic: 'LXUEBTZ1', - transactionDescription: - 'deposit transaction at Trantow - Sanford using card ending with ***(...4316) for STN 928.52 in account ***19061627', - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const functionNames = [ 'account', @@ -107,7 +33,7 @@ describe('finance', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seedRuns) { + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { for (const functionName of functionNames) { it(`${functionName}()`, () => { @@ -115,7 +41,7 @@ describe('finance', () => { const actual = faker.finance[functionName](); - expect(actual).toEqual(expectations[functionName]); + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/git.spec.ts b/test/git.spec.ts index 30c00e8d98b..19c9c4ee249 100644 --- a/test/git.spec.ts +++ b/test/git.spec.ts @@ -1,69 +1,7 @@ import validator from 'validator'; import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - branch: { - noArgs: 'array-transmit', - }, - commitEntry: { - noArgs: '', - }, - commitMessage: { - noArgs: 'navigate neural capacitor', - }, - commitSha: { - noArgs: '5cf2bc99272107d592ba00fbdf302f2949806048', - }, - shortSha: { - noArgs: '5cf2bc9', - }, - }, - }, - { - seed: 1337, - expectations: { - branch: { - noArgs: 'port-quantify', - }, - commitEntry: { - noArgs: '', - }, - commitMessage: { - noArgs: 'compress multi-byte panel', - }, - commitSha: { - noArgs: '48234870538945f4b41c61a52bf27dccc0576698', - }, - shortSha: { - noArgs: '4823487', - }, - }, - }, - { - seed: 1211, - expectations: { - branch: { - noArgs: 'capacitor-connect', - }, - commitEntry: { - noArgs: '', - }, - commitMessage: { - noArgs: 'reboot online circuit', - }, - commitSha: { - noArgs: 'e7ec32f0a2a3c652bbd0caabde64dfdf379e3259', - }, - shortSha: { - noArgs: 'e7ec32f', - }, - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -80,10 +18,11 @@ describe('git', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + 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; } @@ -92,7 +31,8 @@ describe('git', () => { faker.seed(seed); const actual = faker.git[functionName](); - expect(actual).toEqual(expectations[functionName].noArgs); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/hacker.spec.ts b/test/hacker.spec.ts index d0311f724a3..ca0e686ff53 100644 --- a/test/hacker.spec.ts +++ b/test/hacker.spec.ts @@ -1,80 +1,6 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - abbreviation: { - noArgs: 'PCI', - }, - adjective: { - noArgs: 'cross-platform', - }, - noun: { - noArgs: 'array', - }, - verb: { - noArgs: 'navigate', - }, - ingverb: { - noArgs: 'copying', - }, - phrase: { - noArgs: - 'Try to transmit the SAS microchip, maybe it will quantify the mobile monitor!', - }, - }, - }, - { - seed: 1337, - expectations: { - abbreviation: { - noArgs: 'AGP', - }, - adjective: { - noArgs: 'open-source', - }, - noun: { - noArgs: 'port', - }, - verb: { - noArgs: 'compress', - }, - ingverb: { - noArgs: 'compressing', - }, - phrase: { - noArgs: - 'Try to generate the COM program, maybe it will connect the back-end port!', - }, - }, - }, - { - seed: 1211, - expectations: { - abbreviation: { - noArgs: 'JSON', - }, - adjective: { - noArgs: 'solid state', - }, - noun: { - noArgs: 'capacitor', - }, - verb: { - noArgs: 'reboot', - }, - ingverb: { - noArgs: 'programming', - }, - phrase: { - noArgs: - "I'll back up the neural RSS program, that should panel the SCSI matrix!", - }, - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -92,14 +18,15 @@ describe('name', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + 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).toEqual(expectations[functionName].noArgs); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/helpers.spec.ts b/test/helpers.spec.ts index f5f4e96f8ff..497fb85b669 100644 --- a/test/helpers.spec.ts +++ b/test/helpers.spec.ts @@ -1,51 +1,7 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; import { luhnCheck } from '../src/modules/helpers/luhn-check'; - -const seededRuns = [ - { - seed: 42, - expectations: { - slugify: '', - replaceSymbolWithNumber: '', - replaceSymbols: '', - replaceCreditCardSymbols: '6453-3791-7755-1410-0489', - repeatString: '', - regexpStyleStringParse: '', - shuffle: [], - uniqueArray: [], - mustache: '', - }, - }, - { - seed: 1337, - expectations: { - slugify: '', - replaceSymbolWithNumber: '', - replaceSymbols: '', - replaceCreditCardSymbols: '6453-2512-2540-3255-2399', - repeatString: '', - regexpStyleStringParse: '', - shuffle: [], - uniqueArray: [], - mustache: '', - }, - }, - { - seed: 1211, - expectations: { - slugify: '', - replaceSymbolWithNumber: '', - replaceSymbols: '', - replaceCreditCardSymbols: '6453-9487-2190-6162-7434', - repeatString: '', - regexpStyleStringParse: '', - shuffle: [], - uniqueArray: [], - mustache: '', - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -66,14 +22,15 @@ describe('helpers', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { for (const functionName of functionNames) { it(`${functionName}()`, () => { faker.seed(seed); const actual = faker.helpers[functionName](); - expect(actual).toEqual(expectations[functionName]); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/internet.spec.ts b/test/internet.spec.ts index 1160538dc38..04393b90146 100644 --- a/test/internet.spec.ts +++ b/test/internet.spec.ts @@ -1,89 +1,9 @@ import validator from 'validator'; import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; +import { seededRuns } from './support/seededRuns'; import { times } from './support/times'; -const seededRuns = [ - { - seed: 42, - expectations: { - avatar: - 'https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/468.jpg', - email: 'Peyton73@yahoo.com', - exampleEmail: 'Peyton73@example.com', - userName: 'Garnett.Schinner73', - protocol: 'http', - httpMethod: 'POST', - httpStatusCode: 207, - url: 'http://stable-vehicle.biz', - domainName: 'harmonious-shift.org', - domainSuffix: 'info', - domainWord: 'harmonious-shift', - ip: '95.203.243.46', - ipv6: '5cf2:bc99:2721:07d5:92ba:00fb:df30:2f29', - port: 24545, - userAgent: - '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', - color: '#30667a', - mac: '5c:f2:bc:99:27:21', - password: 'Dl2fkYYKLsZdepz', - emoji: '🕸️', - }, - }, - { - seed: 1337, - expectations: { - avatar: - 'https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/327.jpg', - email: 'Keith27@gmail.com', - exampleEmail: 'Keith27@example.org', - userName: 'Devyn21', - protocol: 'http', - httpMethod: 'POST', - httpStatusCode: 205, - url: 'http://neat-chopsticks.biz', - domainName: 'fabulous-might.com', - domainSuffix: 'biz', - domainWord: 'fabulous-might', - ip: '67.143.40.54', - ipv6: '4823:4870:5389:45f4:b41c:61a5:2bf2:7dcc', - port: 17172, - userAgent: - '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', - color: '#214814', - mac: '48:23:48:70:53:89', - password: '9V05TL7RY9fmECg', - emoji: '💇🏼‍♀️', - }, - }, - { - seed: 1211, - expectations: { - avatar: - 'https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/1160.jpg', - email: 'Jadon.Trantow12@hotmail.com', - exampleEmail: 'Jadon.Trantow12@example.net', - userName: 'Tito_Koch22', - protocol: 'https', - httpMethod: 'PATCH', - httpStatusCode: 505, - url: 'https://joyous-temperature.net', - domainName: 'verifiable-infection.org', - domainSuffix: 'org', - domainWord: 'verifiable-infection', - ip: '237.117.228.199', - ipv6: 'e7ec:32f0:a2a3:c652:bbd0:caab:de64:dfdf', - port: 60851, - userAgent: - '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', - color: '#773a72', - mac: 'e7:ec:32:f0:a2:a3', - password: 'yLuj60b5iHB0bhn', - emoji: '🇮🇸', - }, - }, -]; - const NON_SEEDED_BASED_RUN = 5; const functionNames = [ @@ -113,15 +33,15 @@ describe('internet', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { for (const functionName of functionNames) { it(`${functionName}()`, () => { faker.seed(seed); const actual = faker.internet[functionName](); - expect(actual).toBeTruthy(); - expect(actual).toEqual(expectations[functionName]); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/lorem.spec.ts b/test/lorem.spec.ts index 1338e366502..17721b92ba0 100644 --- a/test/lorem.spec.ts +++ b/test/lorem.spec.ts @@ -1,88 +1,9 @@ import validator from 'validator'; import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; +import { seededRuns } from './support/seededRuns'; import { times } from './support/times'; -const seededRuns = [ - { - seed: 42, - expectations: { - word: 'autem', - words: 'autem quibusdam hic', - sentence: 'Quibusdam hic sit minus dolor.', - slug: 'autem-quibusdam-hic', - sentences: - 'Hic sit minus dolor animi mollitia sequi ducimus sequi. Inventore praesentium et. Animi qui impedit et voluptatem.', - paragraph: - 'Hic sit minus dolor animi mollitia sequi ducimus sequi. Inventore praesentium et. Animi qui impedit et voluptatem. Ut quisquam fugiat.', - paragraphs: [ - '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.', - ].join('\n'), - text: 'Hic sit minus dolor animi mollitia sequi ducimus sequi.', - lines: [ - 'Hic sit minus dolor animi mollitia sequi ducimus sequi.', - 'Inventore praesentium et.', - ].join('\n'), - }, - }, - { - seed: 1337, - expectations: { - word: 'voluptatem', - words: 'voluptatem natus nesciunt', - sentence: 'Natus nesciunt non minima perspiciatis.', - slug: 'voluptatem-natus-nesciunt', - sentences: - 'Nesciunt non minima perspiciatis praesentium aperiam voluptatem. Occaecati deserunt voluptatem suscipit. Enim minus nemo fugit et iure explicabo et commodi consequuntur.', - paragraph: - '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.', - paragraphs: [ - '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.', - ].join('\n'), - text: 'natus nesciunt non', - lines: [ - 'Nesciunt non minima perspiciatis praesentium aperiam voluptatem.', - 'Occaecati deserunt voluptatem suscipit.', - ].join('\n'), - }, - }, - { - seed: 1211, - expectations: { - word: 'non', - words: 'non praesentium saepe', - sentence: - 'Praesentium saepe omnis tempora magni repellat eaque tempore nesciunt nobis.', - slug: 'non-praesentium-saepe', - sentences: - '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.', - paragraph: - '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.', - paragraphs: [ - '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.', - ].join('\n'), - text: [ - '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.', - ].join('\n'), - lines: [ - '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.', - ].join('\n'), - }, - }, -]; - const NON_SEEDED_BASED_RUN = 5; const functionNames = [ @@ -102,7 +23,7 @@ describe('lorem', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { for (const functionName of functionNames) { it(`${functionName}()`, () => { @@ -110,9 +31,8 @@ describe('lorem', () => { const actual = faker.lorem[functionName](); - expect(actual).toBeTruthy(); expect(actual).toBeTypeOf('string'); - expect(actual).toEqual(expectations[functionName]); + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/mersenne.spec.ts b/test/mersenne.spec.ts index 4097b1e0abf..4ed803af823 100644 --- a/test/mersenne.spec.ts +++ b/test/mersenne.spec.ts @@ -1,97 +1,12 @@ import { beforeAll, beforeEach, describe, expect, it } from 'vitest'; import { FakerError } from '../src/errors/faker-error'; import { Mersenne } from '../src/modules/mersenne'; +import { seededRuns } from './support/seededRuns'; -type SeededRun = { - seed: number | number[]; - expectations: SeededRunExpectations; -}; -type SeededRunExpectations = { - rand: { - noArgs: number; - minMax: { max?: number; min?: number; expected?: number }[]; - }; -}; - -const seededRuns: SeededRun[] = [ - { - seed: 42, - expectations: { - rand: { - noArgs: 12272, - minMax: [ - { max: 100, min: 0, expected: 37 }, - { max: undefined, min: 0, expected: 12272 }, - { max: 100, min: undefined, expected: 37 }, - ], - }, - }, - }, - { - seed: 1337, - expectations: { - rand: { - noArgs: 8586, - minMax: [ - { max: 100, min: 0, expected: 26 }, - { max: undefined, min: 0, expected: 8586 }, - { max: 100, min: undefined, expected: 26 }, - ], - }, - }, - }, - { - seed: 1211, - expectations: { - rand: { - noArgs: 30425, - minMax: [ - { max: 100, min: 0, expected: 92 }, - { max: undefined, min: 0, expected: 30425 }, - { max: 100, min: undefined, expected: 92 }, - ], - }, - }, - }, - { - seed: [42, 1, 2], - expectations: { - rand: { - noArgs: 28056, - minMax: [ - { max: 100, min: 0, expected: 85 }, - { max: undefined, min: 0, expected: 28056 }, - { max: 100, min: undefined, expected: 85 }, - ], - }, - }, - }, - { - seed: [1337, 1, 2], - expectations: { - rand: { - noArgs: 5895, - minMax: [ - { max: 100, min: 0, expected: 17 }, - { max: undefined, min: 0, expected: 5895 }, - { max: 100, min: undefined, expected: 17 }, - ], - }, - }, - }, - { - seed: [1211, 1, 2], - expectations: { - rand: { - noArgs: 29217, - minMax: [ - { max: 100, min: 0, expected: 89 }, - { max: undefined, min: 0, expected: 29217 }, - { max: 100, min: undefined, expected: 89 }, - ], - }, - }, - }, +const minMaxTestCases = [ + { max: 100, min: 0 }, + { max: undefined, min: 0 }, + { max: 100, min: undefined }, ]; const functionNames = ['rand']; @@ -105,7 +20,7 @@ describe('mersenne twister', () => { mersenne = new Mersenne(); }); - for (const { seed, expectations } of seededRuns) { + for (const seed of [...seededRuns, [42, 1, 2], [1337, 1, 2], [1211, 1, 2]]) { describe(`seed: ${JSON.stringify(seed)}`, () => { beforeEach(() => { if (Array.isArray(seed)) { @@ -119,15 +34,15 @@ describe('mersenne twister', () => { it(`${functionName}()`, () => { const actual = mersenne[functionName](); - expect(actual).toEqual(expectations[functionName].noArgs); + expect(actual).toMatchSnapshot(); }); } - for (const { min, max, expected } of expectations.rand.minMax) { - it(`should return ${expected} for rand(${max}, ${min})`, () => { + for (const { min, max } of minMaxTestCases) { + it(`should return deterministic values for rand(${max}, ${min})`, () => { const actual = mersenne.rand(max, min); - expect(actual).toEqual(expected); + expect(actual).toMatchSnapshot(); }); } diff --git a/test/music.spec.ts b/test/music.spec.ts index 561ddf02f5a..40b24854dbf 100644 --- a/test/music.spec.ts +++ b/test/music.spec.ts @@ -1,41 +1,6 @@ import { beforeEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - genre: { - noArgs: 'Country', - }, - songName: { - noArgs: 'Only The Lonely (Know The Way I Feel)', - }, - }, - }, - { - seed: 1337, - expectations: { - genre: { - noArgs: 'Folk', - }, - songName: { - noArgs: 'Turn! Turn! Turn! (To Everything There is a Season)', - }, - }, - }, - { - seed: 1211, - expectations: { - genre: { - noArgs: 'Non Music', - }, - songName: { - noArgs: 'The End of the World', - }, - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const functionNames = ['genre', 'songName']; @@ -46,7 +11,7 @@ describe('music', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { for (const functionName of functionNames) { it(`${functionName}()`, () => { @@ -54,7 +19,7 @@ describe('music', () => { const actual = faker.music[functionName](); - expect(actual).toEqual(expectations[functionName].noArgs); + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/name.spec.ts b/test/name.spec.ts index b0f1dae3fa3..1d9f44219b2 100644 --- a/test/name.spec.ts +++ b/test/name.spec.ts @@ -1,122 +1,6 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - firstName: { - noArgs: 'Garnett', - }, - lastName: { - noArgs: 'Hintz', - }, - middleName: { - noArgs: 'Greer', - }, - findName: { - noArgs: 'Darnell Deckow', - }, - jobTitle: { - noArgs: 'Regional Data Representative', - }, - gender: { - noArgs: 'Cis', - }, - prefix: { - noArgs: 'Mrs.', - }, - suffix: { - noArgs: 'III', - }, - jobDescriptor: { - noArgs: 'Regional', - }, - jobArea: { - noArgs: 'Identity', - }, - jobType: { - noArgs: 'Coordinator', - }, - }, - }, - { - seed: 1337, - expectations: { - firstName: { - noArgs: 'Devyn', - }, - lastName: { - noArgs: 'Gibson', - }, - middleName: { - noArgs: 'Dakota', - }, - findName: { - noArgs: 'Eugene Effertz', - }, - jobTitle: { - noArgs: 'Future Infrastructure Liaison', - }, - gender: { - noArgs: 'Two* person', - }, - prefix: { - noArgs: 'Mrs.', - }, - suffix: { - noArgs: 'I', - }, - jobDescriptor: { - noArgs: 'Future', - }, - jobArea: { - noArgs: 'Functionality', - }, - jobType: { - noArgs: 'Engineer', - }, - }, - }, - { - seed: 1211, - expectations: { - firstName: { - noArgs: 'Tito', - }, - lastName: { - noArgs: 'Ward', - }, - middleName: { - noArgs: 'Sawyer', - }, - findName: { - noArgs: 'Henrietta Sanford', - }, - jobTitle: { - noArgs: 'Chief Division Agent', - }, - gender: { - noArgs: 'Transexual Person', - }, - prefix: { - noArgs: 'Dr.', - }, - suffix: { - noArgs: 'DVM', - }, - jobDescriptor: { - noArgs: 'Chief', - }, - jobArea: { - noArgs: 'Factors', - }, - jobType: { - noArgs: 'Representative', - }, - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -140,14 +24,15 @@ describe('name', () => { faker.localeFallback = 'en'; }); - for (const { seed, expectations } of seededRuns) { + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { for (const functionName of functionNames) { it(`${functionName}()`, () => { faker.seed(seed); const actual = faker.name[functionName](); - expect(actual).toEqual(expectations[functionName].noArgs); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/phone.spec.ts b/test/phone.spec.ts index daccd63b687..2cea76c2d50 100644 --- a/test/phone.spec.ts +++ b/test/phone.spec.ts @@ -1,72 +1,7 @@ import { beforeEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; import { luhnCheck } from '../src/modules/helpers/luhn-check'; - -const seededRuns = [ - { - seed: 42, - expectations: { - phoneNumber: { - noArgs: '891.775.5141', - }, - number: { - noArgs: '891.775.5141', - }, - phoneNumberFormat: { - noArgs: '479-377-5514', - phoneFormatsArrayIndex: { arrayIndex: 1, expected: '(479) 377-5514' }, - }, - phoneFormats: { - noArgs: '!##.!##.####', - }, - imei: { - noArgs: '37-917755-141004-5', - }, - }, - }, - { - seed: 1337, - expectations: { - phoneNumber: { - noArgs: '(612) 454-0325', - }, - number: { - noArgs: '(612) 454-0325', - }, - phoneNumberFormat: { - noArgs: '451-325-4032', - phoneFormatsArrayIndex: { arrayIndex: 1, expected: '(451) 325-4032' }, - }, - phoneFormats: { - noArgs: '(!##) !##-####', - }, - imei: { - noArgs: '25-122540-325523-4', - }, - }, - }, - { - seed: 1211, - expectations: { - phoneNumber: { - noArgs: '1-587-319-0616 x27431', - }, - number: { - noArgs: '1-587-319-0616 x27431', - }, - phoneNumberFormat: { - noArgs: '948-821-9061', - phoneFormatsArrayIndex: { arrayIndex: 1, expected: '(948) 821-9061' }, - }, - phoneFormats: { - noArgs: '1-!##-!##-#### x#####', - }, - imei: { - noArgs: '94-872190-616274-4', - }, - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const functionNames = [ 'phoneNumber', @@ -83,7 +18,7 @@ describe('phone', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { for (const functionName of functionNames) { it(`${functionName}()`, () => { @@ -91,20 +26,21 @@ describe('phone', () => { const actual = faker.phone[functionName](); - expect(actual).toEqual(expectations[functionName].noArgs); + expect(actual).toMatchSnapshot(); }); } describe('phoneNumberFormat', () => { - const { arrayIndex, expected } = - expectations.phoneNumberFormat.phoneFormatsArrayIndex; - it(`should return ${expected} for ${arrayIndex}`, () => { - faker.seed(seed); + it.each([1, 2, 3, 4])( + `should return deterministic values for %s`, + (index) => { + faker.seed(seed); - const actual = faker.phone.phoneNumberFormat(arrayIndex); + const actual = faker.phone.phoneNumberFormat(index); - expect(actual).toEqual(expected); - }); + expect(actual).toMatchSnapshot(); + } + ); }); }); } diff --git a/test/random.spec.ts b/test/random.spec.ts index fc57ca435b0..4eedf6aec50 100644 --- a/test/random.spec.ts +++ b/test/random.spec.ts @@ -1,43 +1,8 @@ import { beforeEach, describe, expect, it } from 'vitest'; import { faker, FakerError } from '../src'; +import { seededRuns } from './support/seededRuns'; import { times } from './support/times'; -const seededRuns = [ - { - seed: 42, - expectations: { - alpha: 'j', - alphaNumeric: 'd', - locale: 'es_MX', - numeric: '4', - word: 'extend', - words: 'mobile Fish', - }, - }, - { - seed: 1337, - expectations: { - alpha: 'g', - alphaNumeric: '9', - locale: 'en_GH', - numeric: '3', - word: 'leading', - words: 'Delaware', - }, - }, - { - seed: 1211, - expectations: { - alpha: 'y', - alphaNumeric: 'x', - locale: 'ur', - numeric: '9', - word: 'Division', - words: 'Turnpike Frozen Handcrafted', - }, - }, -]; - const NON_SEEDED_BASED_RUN = 5; const functionNames = [ @@ -50,14 +15,15 @@ const functionNames = [ ]; describe('random', () => { - for (const { seed, expectations } of seededRuns) { + 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).toEqual(expectations[functionName]); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/science.spec.ts b/test/science.spec.ts index 614f269cf2d..f7f51d6b84b 100644 --- a/test/science.spec.ts +++ b/test/science.spec.ts @@ -1,50 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - chemicalElement: { - symbol: 'Rh', - name: 'Rhodium', - atomicNumber: 45, - }, - unit: { - name: 'hertz', - symbol: 'Hz', - }, - }, - }, - { - seed: 1337, - expectations: { - chemicalElement: { - symbol: 'Ga', - name: 'Gallium', - atomicNumber: 31, - }, - unit: { - name: 'candela', - symbol: 'cd', - }, - }, - }, - { - seed: 1211, - expectations: { - chemicalElement: { - symbol: 'Ds', - name: 'Darmstadtium', - atomicNumber: 110, - }, - unit: { - name: 'gray', - symbol: 'Gy', - }, - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -55,14 +11,15 @@ describe('science', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + 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).toEqual(expectations[functionName]); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/support/seededRuns.ts b/test/support/seededRuns.ts new file mode 100644 index 00000000000..6e6539b78a2 --- /dev/null +++ b/test/support/seededRuns.ts @@ -0,0 +1 @@ +export const seededRuns = [42, 1337, 1211]; diff --git a/test/system.spec.ts b/test/system.spec.ts index dc584ee6fde..559d7bed7c2 100644 --- a/test/system.spec.ts +++ b/test/system.spec.ts @@ -1,54 +1,7 @@ import validator from 'validator'; import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - fileName: 'mobile_fish.jxsc', - commonFileName: 'mobile_fish.mpe', - mimeType: 'application/vnd.ibm.rights-management', - commonFileType: 'audio', - commonFileExt: 'png', - fileType: 'image', - fileExt: 'lrm', - directoryPath: '/opt/bin', - filePath: '/opt/bin/directives_application_home.ptid', - semver: '3.7.9', - }, - }, - { - seed: 1337, - expectations: { - fileName: 'delaware.cmc', - commonFileName: 'delaware.mp2', - mimeType: 'application/vnd.chipnuts.karaoke-mmd', - commonFileType: 'audio', - commonFileExt: 'wav', - fileType: 'font', - fileExt: 'oa3', - directoryPath: '/Library', - filePath: '/Library/bike_interactive.link66', - semver: '2.5.1', - }, - }, - { - seed: 1211, - expectations: { - fileName: 'turnpike_frozen_handcrafted.heifs', - commonFileName: 'turnpike_frozen_handcrafted.mp4v', - mimeType: 'text/vnd.dmclientscript', - commonFileType: 'application', - commonFileExt: 'htm', - fileType: 'x-shader', - fileExt: 'dic', - directoryPath: '/var/log', - filePath: '/var/log/forward_supervisor.z2', - semver: '9.4.8', - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -70,14 +23,15 @@ describe('system', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { for (const functionName of functionNames) { it(`${functionName}()`, () => { faker.seed(seed); const actual = faker.system[functionName](); - expect(actual).toEqual(expectations[functionName]); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/unique.spec.ts b/test/unique.spec.ts index 909b26a4329..273526d031c 100644 --- a/test/unique.spec.ts +++ b/test/unique.spec.ts @@ -1,33 +1,7 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; import { FakerError } from '../src/errors/faker-error'; - -const seededRuns = [ - { - seed: 42, - expectations: { - withCustomMethod: 'Test-188', - withNumberMethod: 37454, - withNumberMethodAndArgs: 19, - }, - }, - { - seed: 1337, - expectations: { - withCustomMethod: 'Test-132', - withNumberMethod: 26202, - withNumberMethodAndArgs: 13, - }, - }, - { - seed: 1211, - expectations: { - withCustomMethod: 'Test-465', - withNumberMethod: 92852, - withNumberMethodAndArgs: 47, - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -46,13 +20,14 @@ describe('unique', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { it('unique(customMethod)', () => { faker.seed(seed); const actual = faker.unique(customMethod); - expect(actual).toEqual(expectations.withCustomMethod); + + expect(actual).toMatchSnapshot(); }); it('unique(customMethod, args)', () => { @@ -61,21 +36,24 @@ describe('unique', () => { const prefix = 'prefix-1-'; const actual = faker.unique(customMethod, [prefix]); - expect(actual).toEqual(prefix + expectations.withCustomMethod); + + expect(actual).toMatchSnapshot(); }); it('unique(() => number)', () => { faker.seed(seed); const actual = faker.unique(faker.datatype.number); - expect(actual).toEqual(expectations.withNumberMethod); + + expect(actual).toMatchSnapshot(); }); it('unique(() => number), args)', () => { faker.seed(seed); const actual = faker.unique(faker.datatype.number, [50]); - expect(actual).toEqual(expectations.withNumberMethodAndArgs); + + expect(actual).toMatchSnapshot(); }); }); } diff --git a/test/vehicle.spec.ts b/test/vehicle.spec.ts index a9c69b0a3d3..c8cb9ae4df5 100644 --- a/test/vehicle.spec.ts +++ b/test/vehicle.spec.ts @@ -1,50 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - vehicle: 'Ford Golf', - manufacturer: 'Ford', - model: 'Escalade', - type: 'Extended Cab Pickup', - fuel: 'Electric', - vin: 'CTY6RSKK5ED315227', - color: 'grey', - vrm: 'JU91TUP', - bicycle: 'Fitness Bicycle', - }, - }, - { - seed: 1337, - expectations: { - vehicle: 'Dodge Model S', - manufacturer: 'Dodge', - model: 'Colorado', - type: 'Coupe', - fuel: 'Electric', - vin: '8J579HF1A7MK33574', - color: 'black', - vrm: 'GO12HOL', - bicycle: 'Cyclocross Bicycle', - }, - }, - { - seed: 1211, - expectations: { - vehicle: 'Toyota Challenger', - manufacturer: 'Toyota', - model: '2', - type: 'Wagon', - fuel: 'Hybrid', - vin: 'XFWS74Z1N5S678767', - color: 'azure', - vrm: 'YL87FDZ', - bicycle: 'Triathlon/Time Trial Bicycle', - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -65,14 +21,15 @@ describe('vehicle', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + 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).toEqual(expectations[functionName]); + + expect(actual).toMatchSnapshot(); }); } }); diff --git a/test/word.spec.ts b/test/word.spec.ts index f3ef451c202..f3508c380fd 100644 --- a/test/word.spec.ts +++ b/test/word.spec.ts @@ -1,128 +1,6 @@ import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; - -const seededRuns = [ - { - seed: 42, - expectations: { - adjective: { - noArgs: 'harmonious', - length10: 'gregarious', - length20: 'harmonious', - }, - adverb: { - noArgs: 'jealously', - length10: 'generously', - length20: 'jealously', - }, - conjunction: { - noArgs: 'however', - length10: 'as much as', - length20: 'however', - }, - interjection: { - noArgs: 'yahoo', - length10: 'yahoo', - length20: 'yahoo', - }, - noun: { - noArgs: 'gale', - length10: 'exposition', - length20: 'gale', - }, - preposition: { - noArgs: 'concerning', - length10: 'throughout', - length20: 'concerning', - }, - verb: { - noArgs: 'function', - length10: 'exasperate', - length20: 'function', - }, - }, - }, - { - seed: 1337, - expectations: { - adjective: { - noArgs: 'fabulous', - length10: 'enchanting', - length20: 'fabulous', - }, - adverb: { - noArgs: 'frankly', - length10: 'enormously', - length20: 'frankly', - }, - conjunction: { - noArgs: 'even if', - length10: 'as long as', - length20: 'even if', - }, - interjection: { - noArgs: 'ew', - length10: 'ew', - length20: 'ew', - }, - noun: { - noArgs: 'digit', - length10: 'depressive', - length20: 'digit', - }, - preposition: { - noArgs: 'barring', - length10: 'concerning', - length20: 'barring', - }, - verb: { - noArgs: 'dispense', - length10: 'demoralize', - length20: 'dispense', - }, - }, - }, - { - seed: 1211, - expectations: { - adjective: { - noArgs: 'verifiable', - length10: 'unfinished', - length20: 'verifiable', - }, - adverb: { - noArgs: 'viciously', - length10: 'unbearably', - length20: 'viciously', - }, - conjunction: { - noArgs: 'whereas', - length10: 'as soon as', - length20: 'whereas', - }, - interjection: { - noArgs: 'er', - length10: 'er', - length20: 'er', - }, - noun: { - noArgs: 'trick', - length10: 'trafficker', - length20: 'trick', - }, - preposition: { - noArgs: 'upon', - length10: 'underneath', - length20: 'upon', - }, - verb: { - noArgs: 'trick', - length10: 'trampoline', - length20: 'trick', - }, - }, - }, -]; +import { seededRuns } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -141,7 +19,7 @@ describe('word', () => { faker.locale = 'en'; }); - for (const { seed, expectations } of seededRuns) { + for (const seed of seededRuns) { describe(`seed: ${seed}`, () => { for (const functionName of functionNames) { it(`${functionName}()`, () => { @@ -149,9 +27,8 @@ describe('word', () => { const actual = faker.word[functionName](); - expect(actual).toBeTruthy(); expect(actual).toBeTypeOf('string'); - expect(actual).toEqual(expectations[functionName].noArgs); + expect(actual).toMatchSnapshot(); }); it(`${functionName}(10)`, () => { @@ -159,9 +36,8 @@ describe('word', () => { const actual = faker.word[functionName](10); - expect(actual).toBeTruthy(); expect(actual).toBeTypeOf('string'); - expect(actual).toEqual(expectations[functionName].length10); + expect(actual).toMatchSnapshot(); }); it(`${functionName}(20)`, () => { @@ -169,9 +45,8 @@ describe('word', () => { const actual = faker.word[functionName](20); - expect(actual).toBeTruthy(); expect(actual).toBeTypeOf('string'); - expect(actual).toEqual(expectations[functionName].length20); + expect(actual).toMatchSnapshot(); }); } });