split auxiliary comment option into before and after - fixes #1721

This commit is contained in:
Sebastian McKenzie
2015-06-10 01:34:44 +01:00
parent 947d3e262d
commit b761cba135
3 changed files with 38 additions and 7 deletions

View File

@@ -18,13 +18,23 @@ suite("api", function () {
assert.ok(!result.ast);
});
test("auxiliaryComment option", function () {
test("auxiliaryCommentBefore option", function () {
assert.ok(transform("class Foo {}", {
auxiliaryComment: "foobar"
auxiliaryCommentBefore: "foobar"
}).code.indexOf("foobar") >= 0);
assert.ok(transform("for (let i in bar) { foo(function () { i; }); break; continue; }", {
auxiliaryComment: "foobar"
auxiliaryCommentBefore: "foobar"
}).code.indexOf("foobar") >= 0);
});
test("auxiliaryCommentAfter option", function () {
assert.ok(transform("class Foo {}", {
auxiliaryCommentAfter: "foobar"
}).code.indexOf("foobar") >= 0);
assert.ok(transform("for (let i in bar) { foo(function () { i; }); break; continue; }", {
auxiliaryCommentAfter: "foobar"
}).code.indexOf("foobar") >= 0);
});