{"version":3,"sources":["../../src/utils/code-block.test.ts"],"sourcesContent":["import { codeBlock } from './code-block.js';\n\ndescribe('codeBlock', () => {\n  it('should normalise indentation', () => {\n    const input = `\n    function foo() {\n      logger.info('Hello, world!');\n    }\n  `;\n\n    expect(codeBlock(input)).toMatchInlineSnapshot(`\n      \"function foo() {\n        logger.info('Hello, world!');\n      }\n      \"\n    `);\n  });\n\n  it('should not change indentation if there is no whitespace at the start of line one', () => {\n    const input = [\n      'function foo() {',\n      `  logger.info('Hello, world!');`,\n      '}',\n    ].join('\\n');\n\n    expect(codeBlock(input)).toMatchInlineSnapshot(`\n      \"function foo() {\n        logger.info('Hello, world!');\n      }\n      \"\n    `);\n  });\n\n  it('should remove whitespace on the last line', () => {\n    const input = [\n      'function foo() {',\n      `  logger.info('Hello, world!');`,\n      '}',\n      '  ',\n    ].join('\\n');\n\n    expect(codeBlock(input)).toMatchInlineSnapshot(`\n      \"function foo() {\n        logger.info('Hello, world!');\n      }\n      \"\n    `);\n  });\n\n  it('should throw an error if the input is empty', () => {\n    expect(() => codeBlock('')).toThrowErrorMatchingInlineSnapshot(\n      `[Error: Input string cannot be empty]`,\n    );\n  });\n});\n"],"mappings":";AAAA,wBAA0B;AAE1B,SAAS,aAAa,MAAM;AAC1B,KAAG,gCAAgC,MAAM;AACvC,UAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAMd,eAAO,6BAAU,KAAK,CAAC,EAAE,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA,KAK9C;AAAA,EACH,CAAC;AAED,KAAG,oFAAoF,MAAM;AAC3F,UAAM,QAAQ;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,KAAK,IAAI;AAEX,eAAO,6BAAU,KAAK,CAAC,EAAE,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA,KAK9C;AAAA,EACH,CAAC;AAED,KAAG,6CAA6C,MAAM;AACpD,UAAM,QAAQ;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,KAAK,IAAI;AAEX,eAAO,6BAAU,KAAK,CAAC,EAAE,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA,KAK9C;AAAA,EACH,CAAC;AAED,KAAG,+CAA+C,MAAM;AACtD,WAAO,UAAM,6BAAU,EAAE,CAAC,EAAE;AAAA,MAC1B;AAAA,IACF;AAAA,EACF,CAAC;AACH,CAAC;","names":[]}