Skip to content

Commit

Permalink
test(up): add mocks for admin responses (404)
Browse files Browse the repository at this point in the history
  • Loading branch information
trieloff committed Jan 12, 2024
1 parent adc2837 commit 5615ee7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/up-cmd.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ describe('Integration test for up command with helix pages', function suite() {
.get('/not-found.txt')
.reply(404);

nock('https://admin.hlx.page:443')
.get('/sidekick/dummy-foo/adobe/master/config.json')
.reply(404);

let port;
await new Promise((resolve, reject) => {
let error = null;
Expand Down Expand Up @@ -116,6 +120,10 @@ describe('Integration test for up command with helix pages', function suite() {
.get('/not-found.txt')
.reply(404);

nock('https://admin.hlx.page:443')
.get('/sidekick/dummy-foo/adobe/tripod/test/config.json')
.reply(404);

cmd
.on('started', async () => {
try {
Expand Down Expand Up @@ -160,6 +168,10 @@ describe('Integration test for up command with helix pages', function suite() {
.get('/fstab.yaml')
.reply(404, 'dummy');

nock('https://admin.hlx.page:443')
.get('/sidekick/dummy-foo/adobe/master/config.json')
.reply(404);

cmd
.on('started', async () => {
try {
Expand Down Expand Up @@ -208,6 +220,14 @@ describe('Integration test for up command with helix pages', function suite() {
.get('/fstab.yaml')
.reply(200, 'yep!');

nock('https://admin.hlx.page:443')
.get('/sidekick/dummy-foo/adobe/master/config.json')
.reply(404);

nock('https://admin.hlx.page:443')
.get('/sidekick/dummy-foo/adobe/new-branch/config.json')
.reply(404);

let timer;
cmd
.on('started', async () => {
Expand Down Expand Up @@ -257,6 +277,14 @@ describe('Integration test for up command with helix pages', function suite() {
.get('/fstab.yaml')
.reply(404, 'dummy');

nock('https://admin.hlx.page:443')
.get('/sidekick/dummy-foo/adobe/master/config.json')
.reply(404);

nock('https://admin.hlx.page:443')
.get('/sidekick/dummy-foo/adobe/new-and-totally-unreasonably-long-in-fact-too-long-branch/config.json')
.reply(404);

let timer;
cmd
.on('started', async () => {
Expand Down

0 comments on commit 5615ee7

Please sign in to comment.