Skip to content

Commit 525cf13

Browse files
committed
refactor(e2e): add createTestAccount CreateTestAccountResult and createEnvVars utils
1 parent 4649dc5 commit 525cf13

File tree

14 files changed

+834
-186
lines changed

14 files changed

+834
-186
lines changed

packages/e2e/CHANGELOG.md

Lines changed: 300 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,305 @@
11
# @lit-protocol/e2e
22

3+
## 0.0.0-20251024170206
4+
5+
### Patch Changes
6+
7+
- testing
8+
- Updated dependencies
9+
- @lit-protocol/auth-helpers@0.0.0-20251024170206
10+
- @lit-protocol/lit-client@0.0.0-20251024170206
11+
- @lit-protocol/constants@0.0.0-20251024170206
12+
- @lit-protocol/contracts@0.0.0-20251024170206
13+
- @lit-protocol/networks@0.0.0-20251024170206
14+
- @lit-protocol/auth@0.0.0-20251024170206
15+
- @lit-protocol/wasm@0.0.0-20251024170206
16+
17+
## 0.0.0-20251024163511
18+
19+
### Patch Changes
20+
21+
- test
22+
- Updated dependencies
23+
- @lit-protocol/auth-helpers@0.0.0-20251024163511
24+
- @lit-protocol/lit-client@0.0.0-20251024163511
25+
- @lit-protocol/constants@0.0.0-20251024163511
26+
- @lit-protocol/contracts@0.0.0-20251024163511
27+
- @lit-protocol/networks@0.0.0-20251024163511
28+
- @lit-protocol/auth@0.0.0-20251024163511
29+
- @lit-protocol/wasm@0.0.0-20251024163511
30+
31+
## 0.0.0-20251024162057
32+
33+
### Patch Changes
34+
35+
- testing
36+
- Updated dependencies
37+
- @lit-protocol/auth-helpers@0.0.0-20251024162057
38+
- @lit-protocol/lit-client@0.0.0-20251024162057
39+
- @lit-protocol/constants@0.0.0-20251024162057
40+
- @lit-protocol/contracts@0.0.0-20251024162057
41+
- @lit-protocol/networks@0.0.0-20251024162057
42+
- @lit-protocol/auth@0.0.0-20251024162057
43+
- @lit-protocol/wasm@0.0.0-20251024162057
44+
45+
## 0.0.0-20251024161700
46+
47+
### Patch Changes
48+
49+
- testing
50+
- Updated dependencies
51+
- @lit-protocol/auth-helpers@0.0.0-20251024161700
52+
- @lit-protocol/lit-client@0.0.0-20251024161700
53+
- @lit-protocol/constants@0.0.0-20251024161700
54+
- @lit-protocol/contracts@0.0.0-20251024161700
55+
- @lit-protocol/networks@0.0.0-20251024161700
56+
- @lit-protocol/auth@0.0.0-20251024161700
57+
- @lit-protocol/wasm@0.0.0-20251024161700
58+
59+
## 0.0.0-20251024160651
60+
61+
### Patch Changes
62+
63+
- test
64+
- Updated dependencies
65+
- @lit-protocol/auth-helpers@0.0.0-20251024160651
66+
- @lit-protocol/lit-client@0.0.0-20251024160651
67+
- @lit-protocol/constants@0.0.0-20251024160651
68+
- @lit-protocol/contracts@0.0.0-20251024160651
69+
- @lit-protocol/networks@0.0.0-20251024160651
70+
- @lit-protocol/auth@0.0.0-20251024160651
71+
- @lit-protocol/wasm@0.0.0-20251024160651
72+
73+
## 0.0.0-20251024155326
74+
75+
### Patch Changes
76+
77+
- testing
78+
- Updated dependencies
79+
- @lit-protocol/auth-helpers@0.0.0-20251024155326
80+
- @lit-protocol/lit-client@0.0.0-20251024155326
81+
- @lit-protocol/constants@0.0.0-20251024155326
82+
- @lit-protocol/contracts@0.0.0-20251024155326
83+
- @lit-protocol/networks@0.0.0-20251024155326
84+
- @lit-protocol/auth@0.0.0-20251024155326
85+
- @lit-protocol/wasm@0.0.0-20251024155326
86+
87+
## 0.0.0-20251024152031
88+
89+
### Patch Changes
90+
91+
- testing
92+
- Updated dependencies
93+
- @lit-protocol/auth-helpers@0.0.0-20251024152031
94+
- @lit-protocol/lit-client@0.0.0-20251024152031
95+
- @lit-protocol/constants@0.0.0-20251024152031
96+
- @lit-protocol/contracts@0.0.0-20251024152031
97+
- @lit-protocol/networks@0.0.0-20251024152031
98+
- @lit-protocol/auth@0.0.0-20251024152031
99+
- @lit-protocol/wasm@0.0.0-20251024152031
100+
101+
## 0.0.0-20251024151319
102+
103+
### Patch Changes
104+
105+
- testing
106+
- Updated dependencies
107+
- @lit-protocol/auth-helpers@0.0.0-20251024151319
108+
- @lit-protocol/lit-client@0.0.0-20251024151319
109+
- @lit-protocol/constants@0.0.0-20251024151319
110+
- @lit-protocol/contracts@0.0.0-20251024151319
111+
- @lit-protocol/networks@0.0.0-20251024151319
112+
- @lit-protocol/auth@0.0.0-20251024151319
113+
- @lit-protocol/wasm@0.0.0-20251024151319
114+
115+
## 0.0.0-20251024145531
116+
117+
### Patch Changes
118+
119+
- testing
120+
- Updated dependencies
121+
- @lit-protocol/auth-helpers@0.0.0-20251024145531
122+
- @lit-protocol/lit-client@0.0.0-20251024145531
123+
- @lit-protocol/constants@0.0.0-20251024145531
124+
- @lit-protocol/contracts@0.0.0-20251024145531
125+
- @lit-protocol/networks@0.0.0-20251024145531
126+
- @lit-protocol/auth@0.0.0-20251024145531
127+
- @lit-protocol/wasm@0.0.0-20251024145531
128+
129+
## 0.0.0-20251024145018
130+
131+
### Patch Changes
132+
133+
- testing
134+
- Updated dependencies
135+
- @lit-protocol/auth-helpers@0.0.0-20251024145018
136+
- @lit-protocol/lit-client@0.0.0-20251024145018
137+
- @lit-protocol/constants@0.0.0-20251024145018
138+
- @lit-protocol/contracts@0.0.0-20251024145018
139+
- @lit-protocol/networks@0.0.0-20251024145018
140+
- @lit-protocol/auth@0.0.0-20251024145018
141+
- @lit-protocol/wasm@0.0.0-20251024145018
142+
143+
## 0.0.0-20251024143634
144+
145+
### Patch Changes
146+
147+
- testing
148+
- Updated dependencies
149+
- @lit-protocol/auth-helpers@0.0.0-20251024143634
150+
- @lit-protocol/lit-client@0.0.0-20251024143634
151+
- @lit-protocol/constants@0.0.0-20251024143634
152+
- @lit-protocol/contracts@0.0.0-20251024143634
153+
- @lit-protocol/networks@0.0.0-20251024143634
154+
- @lit-protocol/auth@0.0.0-20251024143634
155+
- @lit-protocol/wasm@0.0.0-20251024143634
156+
157+
## 0.0.0-20251024141155
158+
159+
### Patch Changes
160+
161+
- testing
162+
- Updated dependencies
163+
- @lit-protocol/auth-helpers@0.0.0-20251024141155
164+
- @lit-protocol/lit-client@0.0.0-20251024141155
165+
- @lit-protocol/constants@0.0.0-20251024141155
166+
- @lit-protocol/contracts@0.0.0-20251024141155
167+
- @lit-protocol/networks@0.0.0-20251024141155
168+
- @lit-protocol/auth@0.0.0-20251024141155
169+
- @lit-protocol/wasm@0.0.0-20251024141155
170+
171+
## 0.0.0-20251024133737
172+
173+
### Patch Changes
174+
175+
- testing
176+
- Updated dependencies
177+
- @lit-protocol/auth-helpers@0.0.0-20251024133737
178+
- @lit-protocol/lit-client@0.0.0-20251024133737
179+
- @lit-protocol/constants@0.0.0-20251024133737
180+
- @lit-protocol/contracts@0.0.0-20251024133737
181+
- @lit-protocol/networks@0.0.0-20251024133737
182+
- @lit-protocol/auth@0.0.0-20251024133737
183+
- @lit-protocol/wasm@0.0.0-20251024133737
184+
185+
## 0.0.0-20251024130442
186+
187+
### Patch Changes
188+
189+
- testing
190+
- Updated dependencies
191+
- @lit-protocol/auth-helpers@0.0.0-20251024130442
192+
- @lit-protocol/lit-client@0.0.0-20251024130442
193+
- @lit-protocol/constants@0.0.0-20251024130442
194+
- @lit-protocol/contracts@0.0.0-20251024130442
195+
- @lit-protocol/networks@0.0.0-20251024130442
196+
- @lit-protocol/auth@0.0.0-20251024130442
197+
- @lit-protocol/wasm@0.0.0-20251024130442
198+
199+
## 0.0.0-20251024124204
200+
201+
### Patch Changes
202+
203+
- test
204+
- Updated dependencies
205+
- @lit-protocol/auth-helpers@0.0.0-20251024124204
206+
- @lit-protocol/lit-client@0.0.0-20251024124204
207+
- @lit-protocol/constants@0.0.0-20251024124204
208+
- @lit-protocol/contracts@0.0.0-20251024124204
209+
- @lit-protocol/networks@0.0.0-20251024124204
210+
- @lit-protocol/auth@0.0.0-20251024124204
211+
- @lit-protocol/wasm@0.0.0-20251024124204
212+
213+
## 0.0.0-20251024030642
214+
215+
### Patch Changes
216+
217+
- testing
218+
- Updated dependencies
219+
- @lit-protocol/auth-helpers@0.0.0-20251024030642
220+
- @lit-protocol/lit-client@0.0.0-20251024030642
221+
- @lit-protocol/constants@0.0.0-20251024030642
222+
- @lit-protocol/contracts@0.0.0-20251024030642
223+
- @lit-protocol/networks@0.0.0-20251024030642
224+
- @lit-protocol/auth@0.0.0-20251024030642
225+
- @lit-protocol/wasm@0.0.0-20251024030642
226+
227+
## 0.0.0-20251024030050
228+
229+
### Patch Changes
230+
231+
- testing
232+
- Updated dependencies
233+
- @lit-protocol/auth-helpers@0.0.0-20251024030050
234+
- @lit-protocol/lit-client@0.0.0-20251024030050
235+
- @lit-protocol/constants@0.0.0-20251024030050
236+
- @lit-protocol/contracts@0.0.0-20251024030050
237+
- @lit-protocol/networks@0.0.0-20251024030050
238+
- @lit-protocol/auth@0.0.0-20251024030050
239+
- @lit-protocol/wasm@0.0.0-20251024030050
240+
241+
## 0.0.0-20251024024728
242+
243+
### Patch Changes
244+
245+
- testing
246+
- Updated dependencies
247+
- @lit-protocol/lit-client@0.0.0-20251024024728
248+
- @lit-protocol/networks@0.0.0-20251024024728
249+
- @lit-protocol/auth@0.0.0-20251024024728
250+
251+
## 0.0.0-20251024023206
252+
253+
### Patch Changes
254+
255+
- testing
256+
- Updated dependencies
257+
- @lit-protocol/lit-client@0.0.0-20251024023206
258+
- @lit-protocol/networks@0.0.0-20251024023206
259+
- @lit-protocol/auth@0.0.0-20251024023206
260+
261+
## 0.0.0-20251024021019
262+
263+
### Patch Changes
264+
265+
- testing
266+
- Updated dependencies
267+
- @lit-protocol/lit-client@0.0.0-20251024021019
268+
- @lit-protocol/networks@0.0.0-20251024021019
269+
- @lit-protocol/auth@0.0.0-20251024021019
270+
271+
## 0.0.0-20251024013142
272+
273+
### Patch Changes
274+
275+
- testing
276+
- Updated dependencies
277+
- @lit-protocol/lit-client@0.0.0-20251024013142
278+
- @lit-protocol/networks@0.0.0-20251024013142
279+
- @lit-protocol/auth@0.0.0-20251024013142
280+
281+
## 0.0.0-20251024005233
282+
283+
### Patch Changes
284+
285+
- testing
286+
- Updated dependencies
287+
- @lit-protocol/lit-client@0.0.0-20251024005233
288+
- @lit-protocol/networks@0.0.0-20251024005233
289+
- @lit-protocol/auth@0.0.0-20251024005233
290+
291+
## 0.0.0-20251024002924
292+
293+
### Patch Changes
294+
295+
- e2e testing
296+
- testing
297+
- Updated dependencies
298+
- Updated dependencies
299+
- @lit-protocol/lit-client@0.0.0-20251024002924
300+
- @lit-protocol/networks@0.0.0-20251024002924
301+
- @lit-protocol/auth@0.0.0-20251024002924
302+
3303
## 2.0.0
4304

5305
### Patch Changes

packages/e2e/README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,32 @@ LOG_LEVEL=info
2525

2626
# Optional local overrides
2727
NAGA_LOCAL_CONTEXT_PATH=./lit-assets/blockchain/contracts/networkContext.json
28-
NAGA_LOCAL_CONTEXT_NAME=naga-develop
2928
LIT_YELLOWSTONE_PRIVATE_RPC_URL=http://127.0.0.1:8545
3029
```
3130

3231
Make sure the referenced network (local Naga cluster, Shiva-managed testnet, or live subnet) is running and reachable from your test machine.
3332

34-
## Run the Bundled Suite
33+
## Run the Canonical Suite
3534

36-
The published package contains the compiled `e2e.spec.ts`. You can execute it either through the provided CLI or by calling Jest directly:
35+
The published suite now imports everything from the package entrypoint, so you can execute it directly through Jest without wiring up helper paths manually.
3736

3837
```bash
39-
# Preferred: CLI wrapper injects the packaged config automatically
40-
pnpm exec lit-e2e
41-
42-
# Equivalent manual invocation
4338
pnpm exec jest \
4439
--config node_modules/@lit-protocol/e2e/jest.e2e.package.config.cjs \
45-
node_modules/@lit-protocol/e2e/specs/e2e.spec.ts
40+
--runTestsByPath node_modules/@lit-protocol/e2e/src/e2e.spec.ts \
41+
--runInBand
42+
```
43+
44+
Prefer local config files? Run `pnpm lit-e2e init` once to scaffold `jest.e2e.local.cjs` and `babel.config.cjs`, then:
45+
46+
```bash
47+
pnpm exec jest \
48+
--config jest.e2e.local.cjs \
49+
--runTestsByPath node_modules/@lit-protocol/e2e/src/e2e.spec.ts \
50+
--runInBand
4651
```
4752

48-
Both commands honour additional Jest flags (e.g. `--runInBand`, `--verbose`), so you can tailor runs to your infrastructure.
53+
That is the only CLI command most teams need; all other helpers are available via imports.
4954

5055
## Author Your Own Specs
5156

@@ -63,7 +68,9 @@ describe('Epoch rollover', () => {
6368

6469
const before = await shiva.inspectEpoch();
6570
await shiva.transitionEpochAndWait();
66-
const after = await shiva.waitForEpochChange({ baselineEpoch: before.epoch });
71+
const after = await shiva.waitForEpochChange({
72+
baselineEpoch: before.epoch,
73+
});
6774

6875
expect(after.epoch).not.toEqual(before.epoch);
6976
});
@@ -74,9 +81,6 @@ Execute custom specs with the same packaged config:
7481

7582
```bash
7683
pnpm exec jest --config node_modules/@lit-protocol/e2e/jest.e2e.package.config.cjs qa-epoch.spec.ts
77-
78-
# or add them on the fly with the CLI
79-
pnpm exec lit-e2e --patterns qa-epoch.spec.ts
8084
```
8185

8286
## Bundled APIs
@@ -108,7 +112,7 @@ Refer to the source under `packages/e2e/src/helper` for additional exported func
108112
## Troubleshooting
109113

110114
- **Jest not found** – install it locally (`pnpm add -D jest`). The CLI wrapper will exit with a helpful message if the dependency is missing.
111-
- **Missing signatures on naga-local** – provide `NAGA_LOCAL_CONTEXT_PATH` and optional `NAGA_LOCAL_CONTEXT_NAME` so the init routine calls `nagaLocal.withLocalContext`.
115+
- **Missing signatures on naga-local** – provide `NAGA_LOCAL_CONTEXT_PATH` so the init routine calls `nagaLocal.withLocalContext`.
112116
- **RPC connectivity** – when pointing at a private RPC, set `LIT_YELLOWSTONE_PRIVATE_RPC_URL` so the Lit Client bypasses defaults.
113117

114118
With these additions, QA can stay in sync with the canonical Lit Protocol E2E coverage while extending it with custom assertions tailored to fast-epoch or failure scenarios.

packages/e2e/babel.config.cjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = {
22
presets: [
3-
['@babel/preset-env', { targets: { node: 'current' }, modules: 'commonjs' }],
3+
[
4+
'@babel/preset-env',
5+
{ targets: { node: 'current' }, modules: 'commonjs' },
6+
],
47
['@babel/preset-typescript', { allowDeclareFields: true }],
58
],
69
};

0 commit comments

Comments
 (0)