SourceMapModeSanitizer.spec.ts 915 B

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