Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3f66ba3
feat: app deploy command
aman19K Jun 11, 2024
d783fe2
update launch version
aman19K Jun 11, 2024
5335578
Merge pull request #253 from contentstack/staging
cs-raj Jun 11, 2024
5df4ce5
fix org type def issue
aman19K Jun 11, 2024
43b0570
Merge pull request #250 from contentstack/feat/DX-541
aman19K Jun 11, 2024
3683642
feat: config based launch project creation
aman19K Jun 17, 2024
b2bda01
Merge pull request #254 from contentstack/feat/DX-785
aman19K Jun 17, 2024
8403398
refactor: updated examples
aman19K Jun 18, 2024
e4bfc23
updated readme
aman19K Jun 18, 2024
b4950f2
fix: snyk issues
aman19K Jun 18, 2024
dd1e7dc
updated utilities version
aman19K Jun 18, 2024
83b96dc
version bump
aman19K Jun 18, 2024
fabe102
Merge pull request #255 from contentstack/feat/app-deploy-command
aman19K Jun 18, 2024
09754e4
fix: deploy command
aman19K Jun 19, 2024
335f067
refactor: launch project flag
aman19K Jun 19, 2024
2f923bc
refactor: app disconnect
aman19K Jun 19, 2024
cef7d91
Merge pull request #256 from contentstack/fix/deploy-command
aman19K Jun 19, 2024
8eba9b7
fix: launch project query, removed duplicate yes flag & updated readm…
aman19K Jun 19, 2024
b9cf987
Merge pull request #257 from contentstack/fix/launch-project-query
aman19K Jun 19, 2024
4cd7cc6
fix: app uid issue
aman19K Jun 19, 2024
99f75d8
added check for app-uid
aman19K Jun 19, 2024
e008e13
updated reademe file
aman19K Jun 19, 2024
5c9d2ca
Merge branch 'development' into fix/app-uid-issue
aman19K Jun 19, 2024
f327429
Merge pull request #258 from contentstack/fix/app-uid-issue
aman19K Jun 19, 2024
75dfe08
build: updated oclif/test version to 2.5.6
harshithad0703 Jun 24, 2024
6b18665
test: deploy command unit test
harshithad0703 Jun 24, 2024
57afe40
test: :adhesive_bandage: deploy command unit test update
harshithad0703 Jun 24, 2024
57af772
chore: updated test script in package.json
harshithad0703 Jun 24, 2024
d342cb5
refactor: deploy command ui text
aman19K Jun 26, 2024
b9ed523
Merge pull request #261 from contentstack/refactor/deploy-command-ui-…
aman19K Jun 26, 2024
6f7b5f5
test: added hosting with launch test case for deploy
harshithad0703 Jun 26, 2024
43e2bb6
refactor: deploy command ui text
aman19K Jun 26, 2024
cf74caa
test: added mock data for deploy unit test
harshithad0703 Jun 26, 2024
9d7bb0f
Merge branch 'development' into test/DX-543-deploy-command-unit-tests
harshithad0703 Jun 27, 2024
2feb7d0
test: added 1 more test case using flags in command
harshithad0703 Jun 27, 2024
6afde49
Merge pull request #260 from contentstack/test/DX-543-deploy-command-…
harshithad0703 Jun 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: added hosting with launch test case for deploy
  • Loading branch information
harshithad0703 committed Jun 26, 2024
commit 6f7b5f559117f2e83cd36fb41579ae9ebb368dea
63 changes: 42 additions & 21 deletions test/unit/commands/app/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const region: { cma: string; cda: string; name: string } =
const developerHubBaseUrl = getDeveloperHubUrl();

describe("app:deploy", () => {
describe("Deploy an with custom hosting", () => {
describe("Deploy an app with custom hosting", () => {
test
.stdout({ print: process.env.PRINT === "true" || false })
.stub(ux.action, "stop", () => {})
Expand All @@ -22,7 +22,7 @@ describe("app:deploy", () => {
App: mock.apps[1].name,
Organization: mock.organizations[0].name,
"hosting types": "Custom Hosting",
"app-url": "https://example.com",
appUrl: "https://example.com",
};
return (cases as Record<string, any>)[prompt.name];
})
Expand All @@ -35,40 +35,61 @@ describe("app:deploy", () => {
api
.get("/manifests?limit=50&asc=name&include_count=true&skip=0")
.reply(200, {
data: mock.apps,
data: mock.apps2,
})
)
.nock(`https://${developerHubBaseUrl}`, (api) =>
api.put(`/manifests/${mock.apps[1].uid}`).reply(200, {
data: mock.apps,
})
api.put(`/manifests/${mock.apps2[1].uid}`).reply(200, mock.deploy_custom_host)
)
.nock(`https://${developerHubBaseUrl}`, (api) =>
.command(["app:deploy"])
.do(({ stdout }) => {
expect(stdout).to.contain(
$t(messages.APP_DEPLOYED, { app: mock.apps[1].name })
);
})
.it("should deploy the app with custom hosting");
});

describe("Deploy an app with Hosting with Launch with existing project", () => {
test
.stdout({ print: process.env.PRINT === "true" || false })
.stub(ux.action, "stop", () => {})
.stub(ux.action, "start", () => {})
.stub(cliux, "inquire", async (...args: any) => {
const [prompt]: any = args;
const cases = {
App: mock.apps2[1].name,
Organization: mock.organizations[0].name,
"hosting types": "Hosting with Launch",
"provider": "launch",
"selected_launch_project":"existing",
"deployment_url": "https://example.com",
"environment_uid": "environment_uid",
"project_uid": "project_uid",
};
return (cases as Record<string, any>)[prompt.name];
})
.nock(region.cma, (api) =>
api
.patch(`/manifests/${mock.apps[1].uid}/hosting/disconnect`)
.reply(200, {
data: mock.apps,
})
.get("/v3/organizations?limit=100&asc=name&include_count=true&skip=0")
.reply(200, { organizations: mock.organizations })
)
.nock(`https://${developerHubBaseUrl}`, (api) =>
api
.put(`/manifests/${mock.apps[1].uid}/hosting`, {
hosting: {
provider: "external",
deployment_url: "https://example.com",
},
uid: mock.apps[1].uid,
})
.get("/manifests?limit=50&asc=name&include_count=true&skip=0")
.reply(200, {
data: mock.apps,
data: mock.apps2,
})
)
.nock(`https://${developerHubBaseUrl}`, (api) =>
api.put(`/manifests/${mock.apps2[1].uid}`).reply(200, mock.deploy_launch_host)
)
.command(["app:deploy"])
.do(({ stdout }) => {
expect(stdout).to.contain(
$t(messages.APP_DEPLOYED, { app: mock.apps[1].name })
$t(messages.APP_DEPLOYED, { app: mock.apps2[1].name })
);
})
.it("should deploy the app with custom hosting");
.it("should deploy the app with Hosting with Launch with existing project");
});
});