Skip to content

Commit

Permalink
pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
TooManyBees committed Dec 15, 2023
1 parent d1e23d0 commit 0d45f33
Showing 1 changed file with 55 additions and 44 deletions.
99 changes: 55 additions & 44 deletions src/__tests__/internal/deployment.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -121,9 +122,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -182,12 +184,9 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(400,
{ message: 'Bad request' },
{ headers: { 'content-type': 'application/json' } }
)
.reply(400, { message: 'Bad request' }, { headers: { 'content-type': 'application/json' } })

// Create the deployment
const deployment = new Deployment()
Expand All @@ -203,9 +202,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -245,9 +245,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -287,9 +288,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -329,9 +331,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -372,9 +375,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 2,
artifacts: [
Expand Down Expand Up @@ -405,9 +409,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 0,
artifacts: []
Expand All @@ -427,12 +432,9 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(500,
{ message: 'oh no' },
{ headers: { 'content-type': 'application/json' } }
)
.reply(500, { message: 'oh no' }, { headers: { 'content-type': 'application/json' } })

const deployment = new Deployment()
await expect(deployment.create(fakeJwt)).rejects.toThrow(
Expand All @@ -447,9 +449,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 12, name: `github-pages`, size_in_bytes: artifactSize }]
Expand Down Expand Up @@ -502,9 +505,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -573,9 +577,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -641,9 +646,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -693,9 +699,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -791,9 +798,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -878,9 +886,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -968,9 +977,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down Expand Up @@ -1043,9 +1053,10 @@ describe('Deployment', () => {
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`,
method: "GET",
method: 'GET'
})
.reply(200,
.reply(
200,
{
total_count: 1,
artifacts: [{ id: 11, name: `github-pages`, size_in_bytes: 221 }]
Expand Down

0 comments on commit 0d45f33

Please sign in to comment.