Skip to content

Commit 88a286f

Browse files
committed
chore: update acceptance tests
1 parent af51cb9 commit 88a286f

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

test/acceptance/fake-server.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,9 +855,22 @@ export const fakeServer = (basePath: string, snykToken: string): FakeServer => {
855855
});
856856
});
857857

858-
app.post(`*/feature_flags/evaluation`, (req, res) => {
858+
app.post(`*orgs/:orgId/feature_flags/evaluation`, (req, res) => {
859859
const flags: string[] = req.body?.data?.attributes?.flags ?? [];
860860

861+
const { orgId } = req.params;
862+
if (orgId === 'no-flag') {
863+
return res.send({
864+
data: {
865+
type: 'feature_flags_evaluation',
866+
attributes: {
867+
evaluations: [],
868+
evaluatedAt: new Date().toISOString(),
869+
},
870+
},
871+
});
872+
}
873+
861874
const evaluations = flags.map((flag) => {
862875
if (!featureFlags.has(flag)) {
863876
return {

test/jest/acceptance/snyk-sbom-monitor/all-projects.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ describe('snyk sbom monitor (mocked server only)', () => {
2121
SNYK_HOST: 'http://localhost:' + port,
2222
SNYK_TOKEN: '123456789',
2323
SNYK_DISABLE_ANALYTICS: '1',
24+
SNYK_INTERNAL_ORGID: 'orgid-sbom-monitor-cli',
2425
};
2526
server = fakeServer(baseApi, env.SNYK_TOKEN);
2627
server.listen(port, () => {

test/jest/acceptance/snyk-test/all-projects.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ describe('snyk test --all-projects (mocked server only)', () => {
2424
SNYK_HOST: 'http://localhost:' + port,
2525
SNYK_TOKEN: '123456789',
2626
SNYK_DISABLE_ANALYTICS: '1',
27+
SNYK_INTERNAL_ORGID: 'orgid-test-cli',
2728
};
2829
server = fakeServer(baseApi, env.SNYK_TOKEN);
2930
server.listen(port, () => {

test/jest/acceptance/snyk-test/basic-test-all-languages.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ describe.each(userJourneyWorkflows)(
6060
SNYK_HOST: 'http://localhost:' + port,
6161
SNYK_TOKEN: '123456789',
6262
SNYK_DISABLE_ANALYTICS: '1',
63+
SNYK_INTERNAL_ORGID: 'orgid-test-cli',
6364
};
6465
server = fakeServer(baseApi, env.SNYK_TOKEN);
6566
server.listen(port, () => {

test/jest/acceptance/snyk-test/fail-on.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ describe('snyk test --fail-on', () => {
1717
SNYK_API: 'http://localhost:' + apiPort + apiPath,
1818
SNYK_TOKEN: '123456789',
1919
SNYK_DISABLE_ANALYTICS: '1',
20+
SNYK_INTERNAL_ORGID: 'orgid-test-cli',
2021
};
2122

2223
server = fakeServer(apiPath, env.SNYK_TOKEN);

0 commit comments

Comments
 (0)