diff options
| author | Shinigami <[email protected]> | 2022-04-22 19:21:49 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-04-22 19:21:49 +0200 |
| commit | 956e3423ec75d15194e97b3868a15dfdb9de4e9f (patch) | |
| tree | ba86f0a191469a6bb083eac64471b97fab4a590f /test/git.spec.ts | |
| parent | 29bba7be530d2e11c56de021fc67a9641b2e6e0d (diff) | |
| download | faker-956e3423ec75d15194e97b3868a15dfdb9de4e9f.tar.xz faker-956e3423ec75d15194e97b3868a15dfdb9de4e9f.zip | |
test: use consistent assertion functions (#852)
Diffstat (limited to 'test/git.spec.ts')
| -rw-r--r-- | test/git.spec.ts | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/test/git.spec.ts b/test/git.spec.ts index 84f85e76..5da5deb5 100644 --- a/test/git.spec.ts +++ b/test/git.spec.ts @@ -111,7 +111,7 @@ describe('git', () => { expect(branch).toBeTruthy(); expect(branch).toBeTypeOf('string'); - expect(branch).satisfy(validator.isSlug); + expect(branch).toSatisfy(validator.isSlug); }); }); @@ -124,21 +124,21 @@ describe('git', () => { const parts = commitEntry.split(/\r?\n/); - expect(parts.length).greaterThanOrEqual(6); - expect(parts.length).lessThanOrEqual(7); + expect(parts.length).toBeGreaterThanOrEqual(6); + expect(parts.length).toBeLessThanOrEqual(7); - expect(parts[0]).match(/^commit [a-f0-9]+$/); + expect(parts[0]).toMatch(/^commit [a-f0-9]+$/); if (parts.length === 7) { - expect(parts[1]).match(/^Merge: [a-f0-9]+ [a-f0-9]+$/); - expect(parts[2]).match(/^Author: \w+ \w+ \<[\w\.]+@[\w\.]+\>$/); - expect(parts[3]).match(/^Date: .+$/); + expect(parts[1]).toMatch(/^Merge: [a-f0-9]+ [a-f0-9]+$/); + expect(parts[2]).toMatch(/^Author: \w+ \w+ \<[\w\.]+@[\w\.]+\>$/); + expect(parts[3]).toMatch(/^Date: .+$/); expect(parts[4]).toBe(''); - expect(parts[5]).match(/^\s{4}.+$/); + expect(parts[5]).toMatch(/^\s{4}.+$/); } else { - expect(parts[1]).match(/^Author: \w+ \w+ \<[\w\.]+@[\w\.]+\>$/); - expect(parts[2]).match(/^Date: .+$/); + expect(parts[1]).toMatch(/^Author: \w+ \w+ \<[\w\.]+@[\w\.]+\>$/); + expect(parts[2]).toMatch(/^Date: .+$/); expect(parts[3]).toBe(''); - expect(parts[4]).match(/^\s{4}.+$/); + expect(parts[4]).toMatch(/^\s{4}.+$/); } }); }); @@ -151,7 +151,7 @@ describe('git', () => { expect(commitMessage).toBeTypeOf('string'); const parts = commitMessage.split(' '); - expect(parts.length).greaterThanOrEqual(3); + expect(parts.length).toBeGreaterThanOrEqual(3); }); }); @@ -161,7 +161,7 @@ describe('git', () => { expect(commitSha).toBeTruthy(); expect(commitSha).toBeTypeOf('string'); - expect(commitSha).satisfy(validator.isHexadecimal); + expect(commitSha).toSatisfy(validator.isHexadecimal); expect(commitSha).toHaveLength(40); }); }); @@ -172,7 +172,7 @@ describe('git', () => { expect(shortSha).toBeTruthy(); expect(shortSha).toBeTypeOf('string'); - expect(shortSha).satisfy(validator.isHexadecimal); + expect(shortSha).toSatisfy(validator.isHexadecimal); expect(shortSha).toHaveLength(7); }); }); |
