Skip to content

Commit

Permalink
chore(deps): bump webextension-store-meta from 1.1.0 to 1.2.1; test […
Browse files Browse the repository at this point in the history
…chromewebstore] (#10094)

* chore(deps): bump webextension-store-meta from 1.1.0 to 1.2.1

Bumps [webextension-store-meta](https://github.com/awesome-webextension/webextension-store-meta) from 1.1.0 to 1.2.1.
- [Changelog](https://github.com/awesome-webextension/webextension-store-meta/blob/main/CHANGELOG.md)
- [Commits](https://github.com/awesome-webextension/webextension-store-meta/commits/v1.2.1)

---
updated-dependencies:
- dependency-name: webextension-store-meta
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* update import

* fix the mocked tests

I don't love this, but it will do

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: chris48s <[email protected]>
  • Loading branch information
dependabot[bot] and chris48s committed Apr 18, 2024
1 parent d8e3452 commit 68bfc3c
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 13 deletions.
28 changes: 20 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"semver": "~7.6.0",
"simple-icons": "11.12.0",
"smol-toml": "1.1.4",
"webextension-store-meta": "^1.1.0",
"webextension-store-meta": "^1.2.1",
"xpath": "~0.0.34"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion services/chrome-web-store/chrome-web-store-base.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ChromeWebStore from 'webextension-store-meta/lib/chrome-web-store/index.js'
import { ChromeWebStore } from 'webextension-store-meta/lib/chrome-web-store/index.js'
import checkErrorResponse from '../../core/base-service/check-error-response.js'
import { BaseService, Inaccessible } from '../index.js'

Expand Down
12 changes: 11 additions & 1 deletion services/chrome-web-store/chrome-web-store-rating.tester.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Joi from 'joi'
import { Agent, MockAgent, setGlobalDispatcher } from 'undici'
import { isStarRating } from '../test-validators.js'
import { ServiceTester } from '../tester.js'

Expand Down Expand Up @@ -39,7 +40,16 @@ t.create('Stars (not found)')
.expectBadge({ label: 'rating', message: 'not found' })

// Keep this "inaccessible" test, since this service does not use BaseService#_request.
const mockAgent = new MockAgent()
t.create('Rating (inaccessible)')
.get('/rating/alhjnofcnnpeaphgeakdhkebafjcpeae.json')
.networkOff()
// webextension-store-meta uses undici internally, so we can't mock it with nock
.before(function () {
setGlobalDispatcher(mockAgent)
mockAgent.disableNetConnect()
})
.after(async function () {
await mockAgent.close()
setGlobalDispatcher(new Agent())
})
.expectBadge({ label: 'rating', message: 'inaccessible' })
12 changes: 11 additions & 1 deletion services/chrome-web-store/chrome-web-store-users.tester.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Agent, MockAgent, setGlobalDispatcher } from 'undici'
import { isMetric } from '../test-validators.js'
import { ServiceTester } from '../tester.js'

Expand All @@ -22,7 +23,16 @@ t.create('Users (not found)')
.expectBadge({ label: 'users', message: 'not found' })

// Keep this "inaccessible" test, since this service does not use BaseService#_request.
const mockAgent = new MockAgent()
t.create('Users (inaccessible)')
.get('/users/alhjnofcnnpeaphgeakdhkebafjcpeae.json')
.networkOff()
// webextension-store-meta uses undici internally, so we can't mock it with nock
.before(function () {
setGlobalDispatcher(mockAgent)
mockAgent.disableNetConnect()
})
.after(async function () {
await mockAgent.close()
setGlobalDispatcher(new Agent())
})
.expectBadge({ label: 'users', message: 'inaccessible' })
12 changes: 11 additions & 1 deletion services/chrome-web-store/chrome-web-store-version.tester.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Agent, MockAgent, setGlobalDispatcher } from 'undici'
import { isVPlusDottedVersionAtLeastOne } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
Expand All @@ -12,7 +13,16 @@ t.create('Version (not found)')
.expectBadge({ label: 'chrome web store', message: 'not found' })

// Keep this "inaccessible" test, since this service does not use BaseService#_request.
const mockAgent = new MockAgent()
t.create('Version (inaccessible)')
.get('/alhjnofcnnpeaphgeakdhkebafjcpeae.json')
.networkOff()
// webextension-store-meta uses undici internally, so we can't mock it with nock
.before(function () {
setGlobalDispatcher(mockAgent)
mockAgent.disableNetConnect()
})
.after(async function () {
await mockAgent.close()
setGlobalDispatcher(new Agent())
})
.expectBadge({ label: 'chrome web store', message: 'inaccessible' })

0 comments on commit 68bfc3c

Please sign in to comment.