Fix plugni.spec.ts's reliance on the node-fetch mock (again?).

This commit is contained in:
Sam Rose 2024-08-01 12:36:32 +01:00
parent c8fadc33d9
commit a973b65a72
No known key found for this signature in database
1 changed files with 22 additions and 0 deletions

View File

@ -172,6 +172,28 @@ describe("/plugins", () => {
})
describe("npm", () => {
it("should be able to create a plugin from npm", async () => {
nock("https://registry.npmjs.org")
.get("/budibase-component")
.reply(200, {
name: "budibase-component",
"dist-tags": {
latest: "1.0.0",
},
versions: {
"1.0.0": {
dist: {
tarball:
"https://registry.npmjs.org/budibase-component/-/budibase-component-1.0.1.tgz",
},
},
},
})
.get("/budibase-component/-/budibase-component-1.0.1.tgz")
.replyWithFile(
200,
"src/api/routes/tests/data/budibase-component-1.0.1.tgz"
)
const { plugin } = await config.api.plugin.create({
source: PluginSource.NPM,
url: "https://www.npmjs.com/package/budibase-component",