Remove redundant enterprise tests
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -34,16 +34,6 @@ Failed to create token for enterprise "test-enterprise" (attempt 1): No enterpri
|
||||
GET /enterprises/test-enterprise/installation
|
||||
`;
|
||||
|
||||
exports[`main-enterprise-mutual-exclusivity-both.test.js > stderr 1`] = `
|
||||
Error: Cannot use 'enterprise-slug' input with 'owner' or 'repositories' inputs
|
||||
at main [90m(file:///Users/parkerbxyz/.copilot/worktrees/create-github-app-token/pr-263/[39mlib/main.js:31:11[90m)[39m
|
||||
at run [90m(file:///Users/parkerbxyz/.copilot/worktrees/create-github-app-token/pr-263/[39mmain.js:35:10[90m)[39m
|
||||
at [90mfile:///Users/parkerbxyz/.copilot/worktrees/create-github-app-token/pr-263/[39mmain.js:50:16
|
||||
[90m at ModuleJob.run (node:internal/modules/esm/module_job:430:25)[39m
|
||||
[90m at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:639:26)[39m
|
||||
at async [90mfile:///Users/parkerbxyz/.copilot/worktrees/create-github-app-token/pr-263/[39mtests/main-enterprise-mutual-exclusivity-both.test.js:13:3
|
||||
`;
|
||||
|
||||
exports[`main-enterprise-mutual-exclusivity-owner.test.js > stderr 1`] = `
|
||||
Error: Cannot use 'enterprise-slug' input with 'owner' or 'repositories' inputs
|
||||
at main [90m(file:///Users/parkerbxyz/.copilot/worktrees/create-github-app-token/pr-263/[39mlib/main.js:31:11[90m)[39m
|
||||
@@ -81,23 +71,6 @@ POST /app/installations/123456/access_tokens
|
||||
null
|
||||
`;
|
||||
|
||||
exports[`main-enterprise-token-success.test.js > stdout 1`] = `
|
||||
Creating enterprise installation token for enterprise "test-enterprise".
|
||||
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a
|
||||
|
||||
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
|
||||
|
||||
::set-output name=installation-id::123456
|
||||
|
||||
::set-output name=app-slug::github-actions
|
||||
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
|
||||
::save-state name=expiresAt::2016-07-11T22:14:10Z
|
||||
--- REQUESTS ---
|
||||
GET /enterprises/test-enterprise/installation
|
||||
POST /app/installations/123456/access_tokens
|
||||
null
|
||||
`;
|
||||
|
||||
exports[`main-enterprise-token-with-permissions.test.js > stdout 1`] = `
|
||||
Creating enterprise installation token for enterprise "test-enterprise".
|
||||
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { DEFAULT_ENV } from "./main.js";
|
||||
|
||||
// Verify `main` exits with an error when `enterprise-slug` is used with both `owner` and `repositories` inputs.
|
||||
try {
|
||||
// Set up environment with enterprise-slug, owner, and repositories all set
|
||||
for (const [key, value] of Object.entries(DEFAULT_ENV)) {
|
||||
process.env[key] = value;
|
||||
}
|
||||
process.env["INPUT_ENTERPRISE-SLUG"] = "test-enterprise";
|
||||
process.env.INPUT_OWNER = "test-owner";
|
||||
process.env.INPUT_REPOSITORIES = "repo1,repo2";
|
||||
|
||||
await import("../main.js");
|
||||
} catch (error) {
|
||||
console.error(error.message);
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
import { test } from "./main.js";
|
||||
|
||||
// Verify `main` successfully generates enterprise token with basic functionality.
|
||||
await test((mockPool) => {
|
||||
process.env["INPUT_ENTERPRISE-SLUG"] = "test-enterprise";
|
||||
delete process.env.INPUT_OWNER;
|
||||
delete process.env.INPUT_REPOSITORIES;
|
||||
|
||||
// Mock the enterprise installation endpoint
|
||||
const mockInstallationId = "123456";
|
||||
const mockAppSlug = "github-actions";
|
||||
mockPool
|
||||
.intercept({
|
||||
path: "/enterprises/test-enterprise/installation",
|
||||
method: "GET",
|
||||
headers: {
|
||||
accept: "application/vnd.github.v3+json",
|
||||
"user-agent": "actions/create-github-app-token",
|
||||
// Intentionally omitting the `authorization` header, since JWT creation is not idempotent.
|
||||
},
|
||||
})
|
||||
.reply(
|
||||
200,
|
||||
{
|
||||
id: mockInstallationId,
|
||||
app_slug: mockAppSlug,
|
||||
},
|
||||
{ headers: { "content-type": "application/json" } }
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user