SourceMapModeSanitizer.spec.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { assert } from 'chai';
  2. import { SourceMapModeSanitizer } from '../../../../src/cli/sanitizers/SourceMapModeSanitizer';
  3. describe('SourceMapModeSanitizer', () => {
  4. describe('SourceMapModeSanitizer: TCLISanitizer = (value: string): string', () => {
  5. describe('Variant #1: valid source map mode', () => {
  6. const inputValue: string = 'inline';
  7. const expectedValue: string = inputValue;
  8. let value: string;
  9. before(() => {
  10. value = SourceMapModeSanitizer(inputValue);
  11. });
  12. it('should sanitize value', () => {
  13. assert.equal(value, expectedValue);
  14. });
  15. });
  16. describe('Variant #2: invalid source map mode', () => {
  17. const inputValue: string = 'foo';
  18. let testFunc: () => void;
  19. before(() => {
  20. testFunc = () => SourceMapModeSanitizer(inputValue);
  21. });
  22. it('should throw error', () => {
  23. assert.throw(testFunc, ReferenceError);
  24. });
  25. });
  26. });
  27. });