import test from "ava";
import { yellow } from "chalk";
import { format } from "./common";

test("formatting", t => {
  t.is(
    format(undefined, "level", ["example %s", 100, "after"]),
    "level example 100 after"
  );

  t.is(
    format("prefix", "level", ["example %s", 100, "after"]),
    `level ${yellow("prefix")}: example 100 after`
  );
});

@@ -341,13 +341,520 @@
 er%60%0A  );
+%0A%0A  t.is(%0A    format(%22prefix%22, %22level%22, %5B%22example %25s%22, 100, %7B prop: %22value%22 %7D%5D),%0A    %60level $%7Byellow(%22prefix%22)%7D: example 100 %7B prop: 'value' %7D%60%0A  );%0A%0A  const err = new Error(%22message%22);%0A%0A  err.stack = %5B%0A    %22Error: message%22,%0A    %22    at Thing.method (lib/thing.js:21:15)%22%0A  %5D.join(%22%5Cn%22);%0A%0A  t.is(%0A    format(%22prefix%22, %22level%22, %5Berr%5D),%0A    %60level $%7Byellow(%22prefix%22)%7D: $%7Berr.stack%7D%60%0A  );%0A%0A  t.is(%0A    format(%22prefix%22, %22level%22, %5B%22example %25s%22, err%5D),%0A    %60level $%7Byellow(%22prefix%22)%7D: example Error: message%60%0A  );
 %0A%7D);%0A

Add more formatting tests