-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: disable amplitude and sentry when using fedramp endpoints (#372)
* feat: disable sending amplitude and sentry events when using fedramp endpoints
- Loading branch information
Showing
8 changed files
with
120 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { strictEqual } from 'assert'; | ||
import { Iteratively } from '../../../../snyk/common/analytics/itly'; | ||
import { SnykConfiguration } from '../../../../snyk/common/configuration/snykConfiguration'; | ||
import { User } from '../../../../snyk/common/user'; | ||
import { LoggerMock } from '../../mocks/logger.mock'; | ||
|
||
suite.only('Iteratively', () => { | ||
const snykConfig = {} as SnykConfiguration; | ||
const isDevelopment = false; | ||
|
||
suite('.load()', () => { | ||
suite('when connecting to FEDRAMP endpoints', () => { | ||
const isFedramp = true; | ||
[true, false].forEach(shouldReportEvents => { | ||
test(`Returns "null" when shouldReportEvents == ${shouldReportEvents}`, () => { | ||
const iteratively = new Iteratively( | ||
new User(), | ||
new LoggerMock(), | ||
shouldReportEvents, | ||
isFedramp, | ||
isDevelopment, | ||
snykConfig, | ||
); | ||
|
||
const result = iteratively.load(); | ||
|
||
strictEqual(result, null); | ||
}); | ||
}); | ||
}); | ||
|
||
suite('when connecting to non-FEDRAMP endpoints', () => { | ||
const isFedramp = false; | ||
|
||
test('Returns "null" when shouldReportEvents == false', () => { | ||
const iteratively = new Iteratively(new User(), new LoggerMock(), false, isFedramp, isDevelopment, snykConfig); | ||
|
||
const result = iteratively.load(); | ||
|
||
strictEqual(result, null); | ||
}); | ||
|
||
test('Returns "Iteratively" when shouldReportEvents == true', () => { | ||
const iteratively = new Iteratively(new User(), new LoggerMock(), true, isFedramp, isDevelopment, snykConfig); | ||
|
||
const result = iteratively.load(); | ||
|
||
strictEqual(result instanceof Iteratively, true); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters