@@ -48,10 +48,10 @@ test('a repair-armed session excludes get/is/find by default but keeps recording
4848 });
4949 store.set('default', session);
5050
51- recordIfSession(store, 'default', req('get'), {});
52- recordIfSession(store, 'default', req('is'), {});
53- recordIfSession(store, 'default', req('find'), {});
54- recordIfSession(store, 'default', req('wait'), {});
51+ recordIfSession(store, store.lookup( 'default') , req('get'), {});
52+ recordIfSession(store, store.lookup( 'default') , req('is'), {});
53+ recordIfSession(store, store.lookup( 'default') , req('find'), {});
54+ recordIfSession(store, store.lookup( 'default') , req('wait'), {});
5555
5656 expect(store.get('default')!.actions.map((a) => a.command)).toEqual(['wait']);
5757});
@@ -73,9 +73,9 @@ test('a repair-armed session still records get/is/find dispatched as replay plan
7373 });
7474 store.set('default', session);
7575
76- recordIfSession(store, 'default', planStepReq('get'), {});
77- recordIfSession(store, 'default', planStepReq('is'), {});
78- recordIfSession(store, 'default', planStepReq('find'), {});
76+ recordIfSession(store, store.lookup( 'default') , planStepReq('get'), {});
77+ recordIfSession(store, store.lookup( 'default') , planStepReq('is'), {});
78+ recordIfSession(store, store.lookup( 'default') , planStepReq('find'), {});
7979
8080 expect(store.get('default')!.actions.map((a) => a.command)).toEqual(['get', 'is', 'find']);
8181});
@@ -92,9 +92,9 @@ test('--record forces get/is/find through even while repair-armed', () => {
9292 });
9393 store.set('default', session);
9494
95- recordIfSession(store, 'default', req('get', { record: true }), {});
96- recordIfSession(store, 'default', req('is', { record: true }), {});
97- recordIfSession(store, 'default', req('find', { record: true }), {});
95+ recordIfSession(store, store.lookup( 'default') , req('get', { record: true }), {});
96+ recordIfSession(store, store.lookup( 'default') , req('is', { record: true }), {});
97+ recordIfSession(store, store.lookup( 'default') , req('find', { record: true }), {});
9898
9999 expect(store.get('default')!.actions.map((a) => a.command)).toEqual(['get', 'is', 'find']);
100100});
@@ -105,10 +105,10 @@ test('outside a repair-armed session, get/is/find/wait all record normally', ()
105105 expect(session.scriptPublication).toBeUndefined();
106106 store.set('default', session);
107107
108- recordIfSession(store, 'default', req('get'), {});
109- recordIfSession(store, 'default', req('is'), {});
110- recordIfSession(store, 'default', req('find'), {});
111- recordIfSession(store, 'default', req('wait'), {});
108+ recordIfSession(store, store.lookup( 'default') , req('get'), {});
109+ recordIfSession(store, store.lookup( 'default') , req('is'), {});
110+ recordIfSession(store, store.lookup( 'default') , req('find'), {});
111+ recordIfSession(store, store.lookup( 'default') , req('wait'), {});
112112
113113 expect(store.get('default')!.actions.map((a) => a.command)).toEqual([
114114 'get',
@@ -122,7 +122,7 @@ test('wait absent records positionals without target-v1 annotation', () => {
122122 const store = makeStore();
123123 store.set('default', makeIosSession('default'));
124124
125- recordIfSession(store, 'default', waitAbsentReq(), { waitedMs: 0 });
125+ recordIfSession(store, store.lookup( 'default') , waitAbsentReq(), { waitedMs: 0 });
126126
127127 expect(store.get('default')!.actions[0]).toMatchObject({
128128 command: 'wait',
@@ -131,3 +131,12 @@ test('wait absent records positionals without target-v1 annotation', () => {
131131 });
132132 expect(store.get('default')!.actions[0]?.targetEvidence).toBeUndefined();
133133});
134+
135+ test('sessionless recording cannot acquire a newly published address', () => {
136+ const store = makeStore();
137+ const admitted = store.lookup('default');
138+ const session = makeIosSession('default');
139+ store.publish('default', session);
140+ recordIfSession(store, admitted, req('wait'), { waitedMs: 100 });
141+ expect(session.actions).toEqual([]);
142+ });
0 commit comments