-
-
Notifications
You must be signed in to change notification settings - Fork 919
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into drop-node-v14-support
- Loading branch information
Showing
1 changed file
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
import { execSync } from 'node:child_process'; | ||
import * as semver from 'semver'; | ||
import { describe, expect, it } from 'vitest'; | ||
import { oldVersions } from '../../docs/.vitepress/versions'; | ||
|
||
describe('docs versions', () => { | ||
function isFakerOrigin(): boolean { | ||
try { | ||
const originUrl = execSync('git remote get-url origin') | ||
.toString('utf8') | ||
.trim(); | ||
return ( | ||
originUrl === '[email protected]:faker-js/faker' || | ||
originUrl === '[email protected]:faker-js/faker.git' || | ||
originUrl === 'https://github.com/faker-js/faker' || | ||
originUrl === 'https://github.com/faker-js/faker.git' | ||
); | ||
} catch { | ||
return false; | ||
} | ||
} | ||
|
||
describe.runIf(isFakerOrigin())('docs versions', () => { | ||
describe('oldVersions', () => { | ||
it('should have a complete set of oldVersions', () => { | ||
expect(oldVersions.length).toBeGreaterThanOrEqual(2); | ||
|