Skip to content

Commit 5d05d76

Browse files
committed
Fix skipping google books api test on jsdom
1 parent 8f32099 commit 5d05d76

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"devDependencies": {
8181
"@eslint/js": "~9.39",
8282
"@fortawesome/fontawesome-free": "~7.2",
83-
"@types/node": "~25.2",
83+
"@types/node": "~25.3",
8484
"add-dist-header": "~1.6",
8585
"assert-deep-strict-equal": "~1.2",
8686
"copy-file-util": "~1.3",

spec/jsdom.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('Google Books API search result for "spacex" fetched by fetchJson.get()
7373
it('contains the correct "kind" value and "totalItems" as a number', (done) => {
7474
const url = 'https://www.googleapis.com/books/v1/volumes?q=spacex';
7575
const handleData = (data) => {
76-
const skip = !data.ok && data.status === 429;
76+
const skip = data.status === 429 || data.status === 500; //http: Too Many Requests
7777
if (skip)
7878
console.warn('[Assertion Skipped]', url, data.data?.error?.message);
7979
const actual = { total: typeof data.totalItems, kind: data.kind };

spec/node.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('Google Books API search result for "spacex" fetched by fetchJson.get()
5656
it('contains the correct "kind" value and "totalItems" as a number', (done) => {
5757
const url = 'https://www.googleapis.com/books/v1/volumes?q=spacex';
5858
const handleData = (data) => {
59-
const skip = !data.ok && data.status === 429;
59+
const skip = data.status === 429 || data.status === 500; //http: Too Many Requests
6060
if (skip)
6161
console.warn('[Assertion Skipped]', url, data.data?.error?.message);
6262
const actual = { total: typeof data.totalItems, kind: data.kind };

spec/puppeteer.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('Google Books API search result for "spacex" fetched by fetchJson.get()
2727

2828
it('contains the correct "kind" value and "totalItems" as a number', (done) => {
2929
const handleData = (data) => {
30-
const skip = !data.ok && data.status === 429;
30+
const skip = data.status === 429 || data.status === 500; //http: Too Many Requests
3131
if (skip)
3232
console.warn('[Assertion Skipped]', data.data?.error?.message);
3333
const actual = { total: typeof data.totalItems, kind: data.kind };

0 commit comments

Comments
 (0)