mirror of
https://github.com/HackPlan/polaris-react.git
synced 2026-01-12 22:44:36 +08:00
- Stop publishing css files to sdks.shopifycdn.com - Update docs to use unpkg link for CCSS files - Make it clear that we sugggest downloading these files and hosting them yourself rather than using unpkg directly
22 lines
765 B
JavaScript
22 lines
765 B
JavaScript
const fs = require('fs-extra');
|
|
const {semverRegExp, readmes} = require('../scripts/utilities');
|
|
|
|
describe('readme-update-version', () => {
|
|
it('matches 5 semver numbers in READMEs', () => {
|
|
const occurrences = readmes.reduce((accumulator, readmePath) => {
|
|
const readme = fs.readFileSync(readmePath, 'utf8');
|
|
return accumulator + (readme.match(semverRegExp) || []).length;
|
|
}, 0);
|
|
|
|
expect(occurrences).toBe(4);
|
|
});
|
|
|
|
it('semverRegExp matches a variety of valid semver numbers', () => {
|
|
const testCase =
|
|
'Version 2.5.0 (or v2.5.0) and 99.99.99-beta.1 are valid, so is version v100.200.300. But, foo.bar.qux is not';
|
|
const occurrences = (testCase.match(semverRegExp) || []).length;
|
|
|
|
expect(occurrences).toBe(4);
|
|
});
|
|
});
|