MCPcopy Index your code
hub / github.com/jetify-com/devbox / TestAliases

Function TestAliases

internal/devconfig/config_test.go:300–323  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

298}
299
300func TestAliases(t *testing.T) {
301 dir := t.TempDir()
302 cfgJSON := `{
303 "shell": {
304 "init_hook": "echo hi"
305 },
306 "aliases": {
307 "ll": "ls -la",
308 "gs": "git status"
309 }
310}`
311 if err := os.WriteFile(filepath.Join(dir, configfile.DefaultName), []byte(cfgJSON), 0o644); err != nil {
312 t.Fatal(err)
313 }
314 cfg, err := Open(dir)
315 if err != nil {
316 t.Fatalf("Open error: %v", err)
317 }
318 got := cfg.Aliases()
319 want := map[string]string{"ll": "ls -la", "gs": "git status"}
320 if diff := cmp.Diff(want, got); diff != "" {
321 t.Errorf("Aliases() mismatch (-want +got):\n%s", diff)
322 }
323}
324
325func TestAliasesEmpty(t *testing.T) {
326 dir := t.TempDir()

Callers

nothing calls this directly

Calls 2

AliasesMethod · 0.80
OpenFunction · 0.70

Tested by

no test coverage detected