Skip to content

Commit

Permalink
test: add new ecosystems test & monitor URLs to mock server
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanstanev committed Oct 9, 2020
1 parent 02e7681 commit 2013477
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions test/acceptance/fake-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,53 @@ export function fakeServer(root, apikey) {
return next();
});

server.post(root + '/test-dependencies', (req, res, next) => {
if (req.query.org && req.query.org === 'missing-org') {
res.status(404);
res.send({
code: 404,
userMessage: 'cli error message',
});
return next();
}

res.send({
result: {
issues: [],
issuesData: {},
},
meta: {
org: 'test-org',
isPublic: false,
},
});
return next();
});

server.put(root + '/monitor-dependencies', (req, res, next) => {
if (req.query.org && req.query.org === 'missing-org') {
res.status(404);
res.send({
code: 404,
userMessage: 'cli error message',
});
return next();
}

res.send({
ok: true,
org: 'test-org',
id: 'project-public-id',
isMonitored: true,
trialStarted: true,
licensesPolicy: {},
uri:
'http://example-url/project/project-public-id/history/snapshot-public-id',
projectName: 'test-project',
});
return next();
});

server.post(root + '/test-iac', (req, res, next) => {
if (req.query.org && req.query.org === 'missing-org') {
res.status(404);
Expand Down

0 comments on commit 2013477

Please sign in to comment.