@@ -16,7 +16,7 @@ bun install @litprotocol/e2e
1616# For live networks (naga-dev, naga-staging)
1717LIVE_MASTER_ACCOUNT=0x...
1818
19- # For local network (naga-local)
19+ # For local network (naga-local)
2020LOCAL_MASTER_ACCOUNT=0x...
2121
2222# Optional - can also be passed as parameters
@@ -31,7 +31,7 @@ import { runLitE2eTests } from '@litprotocol/e2e';
3131
3232// Run all tests on naga-dev network
3333const results = await runLitE2eTests ({
34- network: ' naga-dev'
34+ network: ' naga-dev' ,
3535});
3636
3737console .log (` Tests completed: ${results .passed }/${results .totalTests } passed ` );
@@ -41,78 +41,22 @@ console.log(`Tests completed: ${results.passed}/${results.totalTests} passed`);
4141
4242``` typescript
4343const results = await runLitE2eTests ({
44- network: ' naga-dev' , // Required: 'naga-dev' | 'naga-local' | 'naga-staging'
45- logLevel: ' info' , // Optional: 'silent' | 'info' | 'debug'
46- testTimeout: 30000 , // Optional: timeout per test in milliseconds
47- selectedTests: [ // Optional: run specific tests only
44+ network: ' naga-dev' , // Required: 'naga-dev' | 'naga-local' | 'naga-staging'
45+ logLevel: ' info' , // Optional: 'silent' | 'info' | 'debug'
46+ testTimeout: 30000 , // Optional: timeout per test in milliseconds
47+ selectedTests: [
48+ // Optional: run specific tests only
4849 ' pkpSign' ,
4950 ' executeJs' ,
50- ' viemSignMessage'
51+ ' viemSignMessage' ,
5152 ],
52- callback : ({testName , testResult }) => { // Optional: callback for each test completion
53- console .log (` Test ${testName } completed with status: ${testResult .status } ` );
54- }
55- });
56- ```
57-
58- ## Callback Functionality
59-
60- You can provide a callback function to receive real-time updates as each test completes:
61-
62- ``` typescript
63- const testResults = [];
64-
65- const results = await runLitE2eTests ({
66- network: ' naga-dev' ,
67- logLevel: ' info' ,
68- selectedTests: [' pkpSign' , ' executeJs' , ' viemSignMessage' ],
69- callback : ({testName , testResult }) => {
70- console .log (` 📝 Test "${testName }" completed ` );
71- console .log (` Status: ${testResult .status } ` );
72- console .log (` Duration: ${testResult .duration }ms ` );
73- console .log (` Auth Context: ${testResult .authContext } ` );
74- console .log (` Category: ${testResult .category } ` );
75-
76- if (testResult .status === ' failed' ) {
77- console .log (` Error: ${testResult .error } ` );
78- }
79-
80- // Store for further processing
81- testResults .push ({
82- name: testName ,
83- ... testResult
84- });
85- }
8653});
87-
88- // Process collected results
89- const failedTests = testResults .filter (test => test .status === ' failed' );
90- console .log (` Failed tests: ${failedTests .map (t => t .name ).join (' , ' )} ` );
91- ```
92-
93- ### Callback Parameters
94-
95- The callback function receives an object with:
96- - ` testName ` (string) - Name of the completed test
97- - ` testResult ` (TestResult) - Complete test result object
98-
99- ### TestResult Object
100-
101- ``` typescript
102- interface TestResult {
103- name: string ; // Test name
104- authContext: string ; // Authentication context used
105- category: ' endpoints' | ' integrations' ; // Test category
106- status: ' passed' | ' failed' | ' skipped' ; // Test status
107- duration: number ; // Test duration in milliseconds
108- error? : string ; // Error message if failed
109- details? : Record <string , any >; // Additional test details
110- }
11154```
11255
11356## Available Tests
11457
11558### Endpoint Tests
59+
11660- ` pkpSign ` - PKP signing functionality
11761- ` executeJs ` - Lit Actions execution
11862- ` viewPKPsByAddress ` - PKP lookup by address
@@ -123,6 +67,7 @@ interface TestResult {
12367- ` eoaNativeAuthFlow ` - EOA native authentication and PKP minting
12468
12569### Integration Tests
70+
12671- ` viemSignMessage ` - Viem integration for message signing
12772- ` viemSignTransaction ` - Viem integration for transaction signing
12873- ` viemSignTypedData ` - Viem integration for typed data signing
@@ -139,16 +84,16 @@ console.log(`Duration: ${results.duration}ms`);
13984
14085// Check for failures
14186if (results .failed > 0 ) {
142- const failedTests = results .results .filter (r => r .status === ' failed' );
143- failedTests .forEach (test => {
87+ const failedTests = results .results .filter (( r ) => r .status === ' failed' );
88+ failedTests .forEach (( test ) => {
14489 console .log (` Failed: ${test .name } - ${test .error } ` );
14590 });
14691}
14792```
14893
14994## Examples
15095
151- See ` example.js ` for detailed usage examples including callback functionality .
96+ See ` example.js ` for detailed usage examples.
15297
15398## Networks
15499
@@ -158,4 +103,4 @@ See `example.js` for detailed usage examples including callback functionality.
158103
159104## License
160105
161- MIT
106+ MIT
0 commit comments