diff --git a/packages/babel-code-frame/test/index.js b/packages/babel-code-frame/test/index.js index 6027130307..910c1aad5a 100644 --- a/packages/babel-code-frame/test/index.js +++ b/packages/babel-code-frame/test/index.js @@ -93,6 +93,20 @@ suite("babel-code-frame", function () { ].join("\n")); }); + test("tabs", function () { + const rawLines = [ + "\tclass Foo {", + "\t \t\t constructor\t(\t)", + "\t};", + ].join('\n'); + assert.equal(codeFrame(rawLines, 2, 25), [ + " 1 | \tclass Foo {", + "> 2 | \t \t\t constructor\t(\t)", + " | \t \t\t \t \t ^", + " 3 | \t};", + ].join('\n')); + }); + test("opts.highlightCode", function () { const rawLines = "console.log('babel')"; const result = codeFrame(rawLines, 1, 9, {highlightCode: true})