@@ -3,7 +3,7 @@ import * as path from "@std/path";
33import { handleInitCommand } from "./init.ts" ;
44
55Deno . test ( {
6- name : "init prepares the default gambit directory without running the chat" ,
6+ name : "init prepares the default directory without running the chat" ,
77 permissions : { read : true , write : true , env : true } ,
88} , async ( ) => {
99 const tempDir = await Deno . makeTempDir ( ) ;
@@ -14,19 +14,23 @@ Deno.test({
1414 try {
1515 Deno . chdir ( tempDir ) ;
1616 await handleInitCommand ( undefined , { interactive : false } ) ;
17- const projectRoot = path . join ( tempDir , "gambit" ) ;
17+ const projectRoot = tempDir ;
1818 assert ( await exists ( projectRoot ) , "project root should exist" ) ;
1919 assert (
2020 ! await exists ( path . join ( projectRoot , ".env" ) ) ,
2121 "should not create .env when OPENROUTER_API_KEY is set" ,
2222 ) ;
2323 assert (
24- ! await exists ( path . join ( projectRoot , "root.deck .md" ) ) ,
25- "init should not write root.deck. md before the chat runs " ,
24+ await exists ( path . join ( projectRoot , "PROMPT .md" ) ) ,
25+ "init should write PROMPT. md in non-interactive mode " ,
2626 ) ;
2727 assert (
28- ! await exists ( path . join ( projectRoot , "tests" , "first.test.deck.md" ) ) ,
29- "init should not write test deck before the chat runs" ,
28+ await exists ( path . join ( projectRoot , "scenarios" , "default" , "PROMPT.md" ) ) ,
29+ "init should write the default scenario deck" ,
30+ ) ;
31+ assert (
32+ await exists ( path . join ( projectRoot , "graders" , "default" , "PROMPT.md" ) ) ,
33+ "init should write the default grader deck" ,
3034 ) ;
3135 } finally {
3236 Deno . chdir ( originalCwd ) ;
@@ -52,6 +56,10 @@ Deno.test({
5256 await handleInitCommand ( "custom/project" , { interactive : false } ) ;
5357 const projectRoot = path . join ( tempDir , "custom" , "project" ) ;
5458 assert ( await exists ( projectRoot ) , "custom project root should exist" ) ;
59+ assert (
60+ await exists ( path . join ( projectRoot , "PROMPT.md" ) ) ,
61+ "init should write PROMPT.md in custom path" ,
62+ ) ;
5563 } finally {
5664 Deno . chdir ( originalCwd ) ;
5765 if ( originalKey === undefined ) {
@@ -96,12 +104,16 @@ Deno.test({
96104 try {
97105 Deno . chdir ( tempDir ) ;
98106 await handleInitCommand ( undefined , { interactive : false } ) ;
99- const projectRoot = path . join ( tempDir , "gambit" ) ;
107+ const projectRoot = tempDir ;
100108 assert ( await exists ( projectRoot ) , "project root should exist" ) ;
101109 assert (
102110 ! await exists ( path . join ( projectRoot , ".env" ) ) ,
103111 "should not create .env when Ollama is available" ,
104112 ) ;
113+ assert (
114+ await exists ( path . join ( projectRoot , "PROMPT.md" ) ) ,
115+ "init should write PROMPT.md when Ollama is available" ,
116+ ) ;
105117 } finally {
106118 Deno . chdir ( originalCwd ) ;
107119 if ( originalKey !== undefined ) {
0 commit comments