Skip to content

Commit

Permalink
test: update store tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed Apr 6, 2024
1 parent 42cc3e1 commit bae11ca
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 19 deletions.
12 changes: 9 additions & 3 deletions packages/store-bitbucket/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ describe("store-bitbucket", () => {
});

it("Initiates plug-in", async () => {
const indiekit = await Indiekit.initialize({ config: {} });
bitbucket.init(indiekit);
const indiekit = await Indiekit.initialize({
config: {
plugins: ["@indiekit/store-bitbucket"],
publication: { me: "https://website.example" },
"@indiekit/store-bitbucket": { user: "user", repo: "repo" },
},
});
await indiekit.bootstrap();

assert.equal(
indiekit.publication.store.info.name,
"username/repo on Bitbucket",
"user/repo on Bitbucket",
);
});

Expand Down
10 changes: 8 additions & 2 deletions packages/store-file-system/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ describe("store-file-system", () => {
});

it("Initiates plug-in", async () => {
const indiekit = await Indiekit.initialize({ config: {} });
fileSystem.init(indiekit);
const indiekit = await Indiekit.initialize({
config: {
plugins: ["@indiekit/store-file-system"],
publication: { me: "https://website.example" },
"@indiekit/store-file-system": { directory: "directory" },
},
});
await indiekit.bootstrap();

assert.equal(indiekit.publication.store.info.name, "directory");
});
Expand Down
10 changes: 8 additions & 2 deletions packages/store-ftp/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ describe("store-ftp", () => {
});

it("Initiates plug-in", async () => {
const indiekit = await Indiekit.initialize({ config: {} });
ftp.init(indiekit);
const indiekit = await Indiekit.initialize({
config: {
plugins: ["@indiekit/store-ftp"],
publication: { me: "https://website.example" },
"@indiekit/store-ftp": { user: "username", host: "127.0.0.1" },
},
});
await indiekit.bootstrap();

assert.equal(indiekit.publication.store.info.name, "username on 127.0.0.1");
});
Expand Down
15 changes: 9 additions & 6 deletions packages/store-gitea/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ describe("store-github", async () => {
});

it("Initiates plug-in", async () => {
const indiekit = await Indiekit.initialize({ config: {} });
gitea.init(indiekit);
const indiekit = await Indiekit.initialize({
config: {
plugins: ["@indiekit/store-gitea"],
publication: { me: "https://website.example" },
"@indiekit/store-gitea": { user: "user", repo: "repo" },
},
});
await indiekit.bootstrap();

assert.equal(
indiekit.publication.store.info.name,
"username/repo on Gitea",
);
assert.equal(indiekit.publication.store.info.name, "user/repo on Gitea");
});

it("Creates file", async () => {
Expand Down
10 changes: 8 additions & 2 deletions packages/store-github/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ describe("store-github", async () => {
});

it("Initiates plug-in", async () => {
const indiekit = await Indiekit.initialize({ config: {} });
github.init(indiekit);
const indiekit = await Indiekit.initialize({
config: {
plugins: ["@indiekit/store-github"],
publication: { me: "https://website.example" },
"@indiekit/store-github": { user: "user", repo: "repo" },
},
});
await indiekit.bootstrap();

assert.equal(indiekit.publication.store.info.name, "user/repo on GitHub");
});
Expand Down
10 changes: 8 additions & 2 deletions packages/store-gitlab/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ describe("store-gitlab", async () => {
});

it("Initiates plug-in", async () => {
const indiekit = await Indiekit.initialize({ config: {} });
gitlab.init(indiekit);
const indiekit = await Indiekit.initialize({
config: {
plugins: ["@indiekit/store-gitlab"],
publication: { me: "https://website.example" },
"@indiekit/store-gitlab": { user: "username", repo: "repo" },
},
});
await indiekit.bootstrap();

assert.equal(
indiekit.publication.store.info.name,
Expand Down
10 changes: 8 additions & 2 deletions packages/store-s3/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ describe("store-s3", () => {
});

it("Initiates plug-in", async () => {
const indiekit = await Indiekit.initialize({ config: {} });
s3.init(indiekit);
const indiekit = await Indiekit.initialize({
config: {
plugins: ["@indiekit/store-s3"],
publication: { me: "https://website.example" },
"@indiekit/store-s3": { bucket: "website" },
},
});
await indiekit.bootstrap();

assert.equal(indiekit.publication.store.info.name, "website bucket");
});
Expand Down

0 comments on commit bae11ca

Please sign in to comment.