Skip to content

Commit

Permalink
Merge pull request #26 from Marketionist/update-dependencies
Browse files Browse the repository at this point in the history
Update test
  • Loading branch information
Marketionist authored Aug 23, 2024
2 parents 6fad156 + 6e77ef9 commit bf632e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ jobs:
echo "Tests from code:"
npm test
echo "Tests from file with TARGET_FILE_PATH env variable:"
TARGET_FILE_PATH='./README.md' npm test
TARGET_FILE_PATH='./README.md' node index.js
22 changes: 15 additions & 7 deletions tests/links.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
const { checkFile } = require('../index.js');

checkFile(
'./README.md',
[
'https://github.com/Marketionist/img-link-checker/actions',
'https://www.linkedin.com/in/test/'
]
);
(async () => {
const brokenLinks = await checkFile(
'./README.md',
[
'https://github.com/Marketionist/img-link-checker/actions',
'https://www.linkedin.com/in/test/'
]
);

// Print a list of broken links and exit the process (will mark the CI/CD build as failed)
if (brokenLinks.length > 0) {
console.error('Broken links list:', brokenLinks);
process.exit(1);
}
})();

0 comments on commit bf632e8

Please sign in to comment.