Skip to content

Commit

Permalink
Update links part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
piaskowyk committed Sep 23, 2024
1 parent 99106da commit acaad4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ test('stop in a middle of animation', () => {

More example tests you can see in our repository

- [SharedValue.test.js](https://github.com/software-mansion/react-native-reanimated/blob/Reanimated2/__tests__/SharedValue.test.tsx)
- [Animation.test.js](https://github.com/software-mansion/react-native-reanimated/blob/Reanimated2/__tests__/Animation.test.tsx)
- [SharedValue.test.js](https://github.com/software-mansion/react-native-reanimated/blob/Reanimated2/__tests__/SharedValue.test.js)
- [Animation.test.js](https://github.com/software-mansion/react-native-reanimated/blob/Reanimated2/__tests__/Animation.test.js)

## Recommended testing library

Expand Down
7 changes: 4 additions & 3 deletions packages/react-native-reanimated/scripts/validate-urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const extensions = [
const ignoredDirectories = ['node_modules', 'Pods', 'lib', 'build', 'cypress'];

const urlRegex =
/\b((http|https):\/\/?)[^\s<>[\]`]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))(?<!\.)\b/g;
/\b((http|https):\/\/?)[^\s<>[\]`]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))(?<!\.)[\b,)]/g;

async function getFileAndUrls(dir) {
const directories = await fsp.readdir(dir, { withFileTypes: true });
Expand All @@ -44,7 +44,7 @@ async function getFileAndUrls(dir) {
let urls = Array.from(fileContent.matchAll(urlRegex), (m) => m[0]);
urls = urls.filter((url) => !/({|})/.test(url));
return urls.length > 0
? urls.map((url) => ({ file: resource, url: url }))
? urls.map((url) => ({ file: resource, url }))
: [];
} else {
return [];
Expand All @@ -69,7 +69,8 @@ function validUrls(data) {
if (
currentData.url.includes('twitter.com') || // redirect issue
currentData.url.includes('blog.swmansion.com') || // authorization issue
currentData.url.includes('opensource.org') // request from GitHub actions probably blocked
currentData.url.includes('opensource.org') || // request from GitHub actions probably blocked
currentData.url.includes('good+first+issue') // sometimes we don't have any issues with this label
) {
index++;
sendRequest();
Expand Down

0 comments on commit acaad4a

Please sign in to comment.