import test from "ava";
import { join } from "path";
import execa from "execa";

const nts = join(__dirname, "..", "bin", "npm-template-sync");

test("cli defines", async t => {
  const c = await execa(nts, [
    "-d",
    "description=a new module",
    "--list-properties"
  ]);
  t.truthy(c.stdout.match(/a new module/));
});

test("cli dryrun", async t => {
  const c = await execa(nts, ["--dry", "arlac77/config-expander"]);

  /*
  console.log(c.stdout);
  console.log(c.stderr);
*/
  t.is(c.code, 0);
});

test("cli list properties", async t => {
  const c = await execa(nts, ["--list-properties", "arlac77/config-expander"]);
  t.truthy(c.stdout.match(/Expands expressions in config files/));

  t.is(c.code, 0);
});

@@ -138,24 +138,29 @@
 ync%22);%0A%0Atest
+.only
 (%22cli define
@@ -210,54 +210,33 @@
 s, %5B
-%0A    
 %22-d%22,
-%0A   
  %22
-description=a new module%22,%0A   
+test=test string%22,
  %22--
@@ -251,19 +251,16 @@
 perties%22
-%0A  
 %5D);%0A  t.
@@ -286,20 +286,19 @@
 ch(/
-a new module
+test string
 /));

use now define