Remove some deprecations

Signed-off-by: MALIN WIDÈN <malwi130@student.liu.se>
This commit is contained in:
MALIN WIDÈN
2022-11-21 17:20:14 +01:00
parent 8141a9707e
commit 9e4fbf0ff4
5 changed files with 7 additions and 12 deletions
@@ -45,7 +45,6 @@ import {
} from './github';
import {
createPublishAzureAction,
createPublishBitbucketAction,
createPublishBitbucketCloudAction,
createPublishBitbucketServerAction,
createPublishGerritAction,
@@ -142,10 +141,6 @@ export const createBuiltinActions = (
createPublishGitlabMergeRequestAction({
integrations,
}),
createPublishBitbucketAction({
integrations,
config,
}),
createPublishBitbucketCloudAction({
integrations,
config,
@@ -15,7 +15,6 @@
*/
export { createPublishAzureAction } from './azure';
export { createPublishBitbucketAction } from './bitbucket';
export { createPublishBitbucketCloudAction } from './bitbucketCloud';
export { createPublishBitbucketServerAction } from './bitbucketServer';
export { createPublishGerritAction } from './gerrit';
@@ -25,7 +25,7 @@ describe('base64EncodeContent', () => {
it('encodes text files', () => {
expect(base64EncodeContent('abc')).toBe('YWJj');
expect(base64EncodeContent('abc'.repeat(1000000))).toBe(
btoa('<file too large>'),
Buffer.from('<file too large>').toString('base64'),
);
});
@@ -38,7 +38,7 @@ describe('base64EncodeContent', () => {
);
// Triggers size check
expect(base64EncodeContent('😅'.repeat(1000000))).toBe(
btoa('<file too large>'),
Buffer.from('<file too large>').toString('base64'),
);
});
});
@@ -59,11 +59,11 @@ interface DryRunProviderProps {
export function base64EncodeContent(content: string): string {
if (content.length > MAX_CONTENT_SIZE) {
return btoa('<file too large>');
return Buffer.from('<file too large>').toString('base64');
}
try {
return btoa(content);
return Buffer.from(content).toString('base64');
} catch {
const decoder = new TextEncoder();
const buffer = decoder.encode(content);
@@ -74,7 +74,7 @@ export function base64EncodeContent(content: string): string {
String.fromCharCode(...buffer.slice(offset, offset + CHUNK_SIZE)),
);
}
return btoa(chunks.join(''));
return Buffer.from(chunks.join('')).toString('base64');
}
}
@@ -58,7 +58,8 @@ describe('DryRunResultsView', () => {
directoryContents: [
{
path: 'foo.txt',
base64Content: btoa('Foo Content'),
base64Content:
Buffer.from('Foo Content').toString('base64'),
executable: false,
},
],