Add E2E test
This commit is contained in:
parent
1240b90475
commit
e88e243d4c
1 changed files with 13 additions and 0 deletions
|
|
@ -1005,6 +1005,19 @@ layers: {
|
|||
assert.Equal(t, "x -> y\n", string(gotBar))
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "fmt-check",
|
||||
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
|
||||
writeFile(t, dir, "foo.d2", `a ---> b`)
|
||||
writeFile(t, dir, "bar.d2", `x ---> y`)
|
||||
err := runTestMainPersist(t, ctx, dir, env, "fmt", "--check", "foo.d2", "bar.d2")
|
||||
assert.ErrorString(t, err, "failed to wait xmain test: e2etests-cli/d2: failed to fmt: exiting with code 1: found 2 unformatted files. Run d2 fmt to fix.")
|
||||
gotFoo := readFile(t, dir, "foo.d2")
|
||||
gotBar := readFile(t, dir, "bar.d2")
|
||||
assert.Equal(t, "a ---> b", string(gotFoo))
|
||||
assert.Equal(t, "x ---> y", string(gotBar))
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "watch-regular",
|
||||
serial: true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue