17 lines
663 B
TypeScript
17 lines
663 B
TypeScript
import {Base64Decoder} from './base64-decoder';
|
|
|
|
describe('Base64Decoder', () => {
|
|
it('should create an instance', () => {
|
|
expect(new Base64Decoder()).toBeTruthy();
|
|
});
|
|
it('should have the id "base64decode"', () => {
|
|
expect(new Base64Decoder().getId()).toEqual('base64decode');
|
|
});
|
|
it('should decode "SGVsbG8sIFdvcmxkIQ==" to "Hello, World!"', () => {
|
|
expect(new Base64Decoder().convert('SGVsbG8sIFdvcmxkIQ==')).toEqual('Hello, World!');
|
|
});
|
|
it('should raise an exception on invalid input', () => {
|
|
expect(() => new Base64Decoder().convert('foo bar.')).toThrowError('Could not decode base64 string. Maybe corrupt input?');
|
|
});
|
|
});
|