Skip to content

Commit

Permalink
GH Action Standards
Browse files Browse the repository at this point in the history
  • Loading branch information
confused-Techie authored and github-actions[bot] committed Jan 17, 2024
1 parent 2207381 commit 5115ac5
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 56 deletions.
2 changes: 1 addition & 1 deletion docs/resources/complexity-report.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Complexity report, 1/13/2024
# Complexity report, 1/17/2024

* Mean per-function logical LOC: 14.271929824561404
* Mean per-function parameter count: 0.1324561403508772
Expand Down
13 changes: 6 additions & 7 deletions tests/helpers/package.jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ const gh = require("parse-github-url");
// opts:
// * versions: An array of different versions, optional.
// * extraVersionData: An object that should be added to every single version
module.exports =
function genPackage(repo, opts = {}) {
module.exports = function genPackage(repo, opts = {}) {
let pack = {};

// Repo Info
Expand All @@ -23,7 +22,7 @@ function genPackage(repo, opts = {}) {
pack.name = parsedGH.name;
pack.repository = {
url: repo,
type: "git" // TODO stop hardcoding git
type: "git", // TODO stop hardcoding git
};
pack.owner = parsedGH.owner;

Expand All @@ -38,8 +37,8 @@ function genPackage(repo, opts = {}) {
name: pack.name,
dist: {
tarball: "download-url",
sha: "1234"
}
sha: "1234",
},
};

if (opts.extraVersionData) {
Expand All @@ -61,7 +60,7 @@ function genPackage(repo, opts = {}) {

// Construct Metadata
let metadata = {
name: pack.name
name: pack.name,
};

if (opts.extraVersionData) {
Expand All @@ -71,7 +70,7 @@ function genPackage(repo, opts = {}) {
pack.metadata = metadata;

return pack;
}
};

/**
Example Usage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("DELETE /api/packages/:packageName/versions/:versionName", () => {
genPackage(
"https://github.com/confused-Techie/dlt-pkg-ver-by-name-test",
{
versions: [ "1.0.1", "1.0.0" ]
versions: ["1.0.1", "1.0.0"],
}
)
);
Expand Down
47 changes: 20 additions & 27 deletions tests/http/getPackages.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,30 @@ const genPackage = require("../helpers/package.jest.js");
describe("Behaves as expected", () => {
beforeAll(async () => {
await database.insertNewPackage(
genPackage(
"https://github.com/unique_user/get-packages-test",
{
versions: [ "1.1.0", "1.0.0" ],
extraVersionData: {
providedServices: {
refactor: {
versions: { "0.0.1": "provideRefactor" }
}
}
}
}
)
genPackage("https://github.com/unique_user/get-packages-test", {
versions: ["1.1.0", "1.0.0"],
extraVersionData: {
providedServices: {
refactor: {
versions: { "0.0.1": "provideRefactor" },
},
},
},
})
);

await database.insertNewPackage(
genPackage(
"https://github.com/savetheclocktower/calculator-light-ui",
{
versions: [ "9.0.0" ],
extraVersionData: {
providedServices: {
another: {
versions: { "0.1.1": "provideanother" }
}
}
}
}
)
genPackage("https://github.com/savetheclocktower/calculator-light-ui", {
versions: ["9.0.0"],
extraVersionData: {
providedServices: {
another: {
versions: { "0.1.1": "provideanother" },
},
},
},
})
);

});

afterAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/http/getPackagesFeatured.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("Behaves as expected", () => {
// We know a currently featured package is 'x-terminal-reloaded'
"https://github.com/Spiker985/x-terminal-reloaded",
{
versions: [ "1.1.0", "1.0.0" ]
versions: ["1.1.0", "1.0.0"],
}
)
);
Expand Down
9 changes: 3 additions & 6 deletions tests/http/getPackagesPackageName.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ describe("Behaves as expected", () => {

test("Returns package on success", async () => {
await database.insertNewPackage(
genPackage(
"https://github.com/confused-Techie/get-package-test",
{
versions: [ "1.1.0", "1.0.0" ]
}
)
genPackage("https://github.com/confused-Techie/get-package-test", {
versions: ["1.1.0", "1.0.0"],
})
);

const sso = await endpoint.logic(
Expand Down
16 changes: 10 additions & 6 deletions tests/http/getPackagesSearch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ const genPackage = require("../helpers/package.jest.js");
describe("Behaves as expected", () => {
beforeAll(async () => {
await database.insertNewPackage(
genPackage("https://github.com/getPackagesSearch/get-packages-search-theme-test", {
extraVersionData: {
theme: "syntax"
genPackage(
"https://github.com/getPackagesSearch/get-packages-search-theme-test",
{
extraVersionData: {
theme: "syntax",
},
}
})
)
);

await database.insertNewPackage(
genPackage("https://github.com/getPackagesSearch/get-packages-search-test")
genPackage(
"https://github.com/getPackagesSearch/get-packages-search-test"
)
);

});

afterAll(async () => {
Expand Down
6 changes: 3 additions & 3 deletions tests/http/getThemes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ describe("Behaves as expected", () => {
test("Returns proper data on success", async () => {
await database.insertNewPackage(
genPackage("https://github.com/confused-Techie/test-package", {
versions: [ "1.1.0", "1.0.0" ],
versions: ["1.1.0", "1.0.0"],
extraVersionData: {
theme: "syntax"
}
theme: "syntax",
},
})
);

Expand Down
4 changes: 2 additions & 2 deletions tests/http/getThemesFeatured.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe("Behaves as expected", () => {
// We know a currently featured package is 'atom-material-ui'
genPackage("https://github.com/confused-Techie/atom-material-ui", {
extraVersionData: {
theme: "ui"
}
theme: "ui",
},
})
);

Expand Down
4 changes: 2 additions & 2 deletions tests/http/getThemesSearch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ describe("Behaves as expected", () => {
await database.insertNewPackage(
genPackage("https://github.com/confused-Techie/atom-material-syntax", {
extraVersionData: {
theme: "ui"
}
theme: "ui",
},
})
);

Expand Down

0 comments on commit 5115ac5

Please sign in to comment.