Skip to content

Commit

Permalink
Move tests into subdir, QA
Browse files Browse the repository at this point in the history
  • Loading branch information
mashb1t committed Nov 9, 2020
1 parent 42da706 commit e13a2c7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
- name: Install Dependencies
# if: steps.cache.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline
- run: npm run test
- run: npm run test-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ dist
website/index.html
website/table.html

.idea
**/.DS_Store
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "build.js",
"scripts": {
"build": "rimraf ./dist/ && node build.js",
"test": "node pull_request.js"
"test-pr": "node tests/pull_request.js"
},
"repository": {
"type": "git",
Expand Down
File renamed without changes.
9 changes: 2 additions & 7 deletions pull_request.js → tests/pull_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const LINKS_OPTIONS = {
},
};


const LOG = {
error: (...args) => console.error('❌ ERROR', args),
error_string: (...args) =>
Expand Down Expand Up @@ -86,12 +85,6 @@ async function batch_fetch({ arr, get, post_filter_func, BATCH_SIZE = 8 }) {
return result;
}

const extract_repos = (arr) =>
arr
.map((e) => e.substr('https://github.com/'.length).split('/'))
.filter((r) => r.length === 2 && r[1] !== '');


const exclude_length = exclude.length;
const exclude_from_list = (link) => {
let is_excluded = false;
Expand Down Expand Up @@ -144,6 +137,8 @@ async function main() {

console.log(`checking ${github_links.length} GitHub repositories...`);

console.log(`skipping GitHub repository check. Run "npm run test" to execute them manually.`);

console.log({
TEST_PASSED: !has_error.show,
EXTERNAL_LINKS: external_links.length,
Expand Down

0 comments on commit e13a2c7

Please sign in to comment.