@@ -1091,7 +1091,7 @@ test('reads the current store for every project status call without workspace pa
10911091 expect ( firstResult . content ) . toEqual ( [
10921092 {
10931093 type : 'text' ,
1094- text : 'Rstack project status: 1 current context (0 ready, 1 pending); 0 context-store/read issues. See structuredContent for details.' ,
1094+ text : 'Rstack project status: 1 recorded context identity (0 ready, 1 pending); 0 context-store/read issues. See structuredContent for compact selection details.' ,
10951095 } ,
10961096 ] ) ;
10971097
@@ -1111,7 +1111,14 @@ test('reads the current store for every project status call without workspace pa
11111111 producer : run . producer ,
11121112 context,
11131113 state : 'ready' ,
1114- latestSnapshot : snapshot ,
1114+ latestSnapshot : {
1115+ snapshotId : snapshot . snapshotId ,
1116+ observedAt : snapshot . observedAt ,
1117+ status : snapshot . status ,
1118+ completeness : snapshot . completeness ,
1119+ facets : [ 'summary' ] ,
1120+ summary : { } ,
1121+ } ,
11151122 freshness : { state : 'unknown' , changedPaths : [ ] } ,
11161123 } ,
11171124 ] ,
@@ -1120,7 +1127,7 @@ test('reads the current store for every project status call without workspace pa
11201127 expect ( secondResult . content ) . toEqual ( [
11211128 {
11221129 type : 'text' ,
1123- text : 'Rstack project status: 1 current context (1 ready, 0 pending); 0 context-store/read issues. See structuredContent for details.' ,
1130+ text : 'Rstack project status: 1 recorded context identity (1 ready, 0 pending); 0 context-store/read issues. See structuredContent for compact selection details.' ,
11241131 } ,
11251132 ] ) ;
11261133 } ) ;
@@ -1144,7 +1151,7 @@ test('returns a valid empty project status', async () => {
11441151 expect ( result . content ) . toEqual ( [
11451152 {
11461153 type : 'text' ,
1147- text : 'Rstack project status: 0 current contexts (0 ready, 0 pending); 0 context-store/read issues. See structuredContent for details.' ,
1154+ text : 'Rstack project status: 0 recorded context identities (0 ready, 0 pending); 0 context-store/read issues. See structuredContent for compact selection details.' ,
11481155 } ,
11491156 ] ) ;
11501157 } ) ;
@@ -1793,6 +1800,50 @@ define.test({ include: ['./tests/*.never.ts'], passWithNoTests: ${fixture.testSt
17931800 } ) ;
17941801} ) ;
17951802
1803+ test ( 'does not capture tests when the selected Rstack package has no test config' , async ( ) => {
1804+ await withTempWorkspace ( async ( workspaceRoot ) => {
1805+ const rstackEntry = pathToFileURL ( path . resolve ( 'dist/index.js' ) ) . href ;
1806+ await writeFile (
1807+ path . join ( workspaceRoot , 'package.json' ) ,
1808+ JSON . stringify ( { name : '@repo/app' , type : 'module' } ) ,
1809+ ) ;
1810+ await writeFile (
1811+ path . join ( workspaceRoot , 'rstack.config.ts' ) ,
1812+ `import { define } from ${ JSON . stringify ( rstackEntry ) } ;
1813+ define.app({});
1814+ ` ,
1815+ ) ;
1816+
1817+ const transport = new StdioClientTransport ( {
1818+ command : process . execPath ,
1819+ args : [ path . resolve ( 'bin/rs.js' ) , 'mcp' ] ,
1820+ cwd : workspaceRoot ,
1821+ env : getDefaultEnvironment ( ) ,
1822+ stderr : 'pipe' ,
1823+ } ) ;
1824+ const client = new Client ( {
1825+ name : 'rstack-unconfigured-test-capture' ,
1826+ version : '1.0.0' ,
1827+ } ) ;
1828+
1829+ try {
1830+ await client . connect ( transport ) ;
1831+ const result = await client . callTool ( { name : 'test_snapshot' , arguments : { } } ) ;
1832+
1833+ expect ( result . isError ) . toBe ( true ) ;
1834+ expect ( result . content ) . toEqual ( [
1835+ {
1836+ type : 'text' ,
1837+ text : 'Rstest is not configured for package root ".".' ,
1838+ } ,
1839+ ] ) ;
1840+ expect ( ( await readProjectStatus ( workspaceRoot ) ) . contexts ) . toEqual ( [ ] ) ;
1841+ } finally {
1842+ await client . close ( ) ;
1843+ }
1844+ } ) ;
1845+ } ) ;
1846+
17961847test ( 'rejects unexpected fields at every Phase 3/4 MCP input boundary' , async ( ) => {
17971848 await withTempWorkspace ( async ( workspaceRoot ) => {
17981849 await withMcpClient ( workspaceRoot , async ( client ) => {
0 commit comments