Skip to content

Commit

Permalink
Merge pull request #9 from cpwood/main
Browse files Browse the repository at this point in the history
Run tests every Friday at 13:00 UTC
  • Loading branch information
DaveBathnes authored May 24, 2022
2 parents 2b5b1bd + cf4e200 commit 4b32b03
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: CI
on:
schedule:
- cron: "0 13 * * 5" # Every Friday at 13:00 UTC
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm install
- name: Run tests
run: npm run test-ci
2 changes: 1 addition & 1 deletion connectors/prism3.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports.getLibraries = async function (service) {
const $ = cheerio.load(advancedSearchPageRequest.text)

$('#locdd option').each((idx, option) => {
if (common.isLibrary($(option).text())) responseLibraries.libraries.push($(option).text().trim())
if (common.isLibrary($(option).text().trim())) responseLibraries.libraries.push($(option).text().trim())
})
}
catch(e) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "webpack-dev-server --open --mode development",
"build": "webpack --mode production",
"test": "jest --runInBand",
"test-ci": "jest --silent",
"test-file": "jest --no-color 2>output.txt"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ exports.runTest = async (isbn, service) => {

// Libraries
results = await index.libraries(service);
console.log(results);
//console.log(results);
expect(results).not.toHaveLength(0);

if (!librariesIgnoreList.includes(service))
expect(results[0].libraries).not.toHaveLength(0);

// Availability
results = await index.availability(isbn, service);
console.log(results);
//console.log(results);
expect(results).not.toHaveLength(0);

if (!availabilityIgnoreList.includes(service)) {
Expand Down

0 comments on commit 4b32b03

Please sign in to comment.