diff options
| author | Guilherme Minozzi <[email protected]> | 2022-09-21 09:56:47 -0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-09-21 14:56:47 +0200 |
| commit | ea8d873c5388f405fbdd18ad4ff978bc49996868 (patch) | |
| tree | a2342993741f0259df60646becb6fcedfe95e178 /test | |
| parent | bdd380db2c96abef3f46a12b446b5b0b5725b40c (diff) | |
| download | faker-ea8d873c5388f405fbdd18ad4ff978bc49996868.tar.xz faker-ea8d873c5388f405fbdd18ad4ff978bc49996868.zip | |
test(finance): use validator.js for bitcoin addresses (#1375)
Diffstat (limited to 'test')
| -rw-r--r-- | test/__snapshots__/finance.spec.ts.snap | 6 | ||||
| -rw-r--r-- | test/finance.spec.ts | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/test/__snapshots__/finance.spec.ts.snap b/test/__snapshots__/finance.spec.ts.snap index 1cc36e29..e42b6c80 100644 --- a/test/__snapshots__/finance.spec.ts.snap +++ b/test/__snapshots__/finance.spec.ts.snap @@ -18,7 +18,7 @@ exports[`finance > 42 > amount > with min and max and dec and symbol 1`] = `"$24 exports[`finance > 42 > bic 1`] = `"JUYEPSSLXXX"`; -exports[`finance > 42 > bitcoinAddress 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1b"`; +exports[`finance > 42 > bitcoinAddress 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1bZb"`; exports[`finance > 42 > creditCardCVV 1`] = `"379"`; @@ -82,7 +82,7 @@ exports[`finance > 1211 > amount > with min and max and dec and symbol 1`] = `"$ exports[`finance > 1211 > bic 1`] = `"YLXUDE4Z"`; -exports[`finance > 1211 > bitcoinAddress 1`] = `"1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsA"`; +exports[`finance > 1211 > bitcoinAddress 1`] = `"1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsAUc9n"`; exports[`finance > 1211 > creditCardCVV 1`] = `"948"`; @@ -146,7 +146,7 @@ exports[`finance > 1337 > amount > with min and max and dec and symbol 1`] = `"$ exports[`finance > 1337 > bic 1`] = `"GOEFFIJG"`; -exports[`finance > 1337 > bitcoinAddress 1`] = `"3adhxs2jewAgkYgJi7No6Cn8JZa"`; +exports[`finance > 1337 > bitcoinAddress 1`] = `"3adhxs2jewAgkYgJi7No6Cn8JZar"`; exports[`finance > 1337 > creditCardCVV 1`] = `"251"`; diff --git a/test/finance.spec.ts b/test/finance.spec.ts index afc671a7..70534449 100644 --- a/test/finance.spec.ts +++ b/test/finance.spec.ts @@ -1,3 +1,4 @@ +import isValidBtcAddress from 'validator/lib/isBtcAddress'; import { afterEach, describe, expect, it } from 'vitest'; import { faker } from '../src'; import { FakerError } from '../src/errors/faker-error'; @@ -290,7 +291,7 @@ describe('finance', () => { expect(bitcoinAddress).toBeTruthy(); expect(bitcoinAddress).toBeTypeOf('string'); - expect(bitcoinAddress).toMatch(/^[13][a-km-zA-HJ-NP-Z1-9]{24,33}$/); + expect(bitcoinAddress).toSatisfy(isValidBtcAddress); }); }); |
