File tree Expand file tree Collapse file tree 5 files changed +29
-3
lines changed Expand file tree Collapse file tree 5 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 9
9
"dev:web" : " pnpm --filter @notesuite/client dev & pnpm --filter @notesuite/common dev" ,
10
10
"dev:server" : " pnpm --filter @notesuite/server start" ,
11
11
"dev:client" : " pnpm --filter @notesuite/client tauri dev & pnpm --filter @notesuite/common dev" ,
12
- "test" : " playwright test --debug " ,
13
- "test:clean " : " pnpm clean && pnpm test" ,
12
+ "test" : " playwright test" ,
13
+ "test:headed " : " playwright test --debug " ,
14
14
"clean" : " pnpm --filter @notesuite/server clean"
15
15
},
16
16
"devDependencies" : {
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ export function initWSServer(context: AppContext) {
68
68
69
69
wss . on ( 'connection' , ( ws , request ) => {
70
70
setupWSConnection ( ws , request , { gc : true } ) ;
71
- console . log ( 'doc count' , [ ...docs . keys ( ) ] . length ) ;
71
+ // console.log('doc count', [...docs.keys()].length);
72
72
} ) ;
73
73
74
74
const { activeWorkspaceId } = context . db . data ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ test.describe('basic test', () => {
8
8
webPort : 5173 ,
9
9
backendPort : 3000 ,
10
10
} ;
11
+ let workspaceId = '' ;
11
12
test . beforeAll ( ( ) => agent . start ( options ) ) ;
12
13
13
14
test ( 'local server works' , async ( { page } ) => {
@@ -21,6 +22,12 @@ test.describe('basic test', () => {
21
22
await page . getByPlaceholder ( 'Workspace name' ) . fill ( 'hello' ) ;
22
23
await page . getByRole ( 'button' , { name : 'Create' } ) . click ( ) ;
23
24
await expect ( page . getByText ( 'Test Client' ) ) . toBeVisible ( ) ;
25
+
26
+ const currentUrl = page . url ( ) ;
27
+ const parts = currentUrl . split ( '/' ) ;
28
+ const id = parts [ parts . length - 1 ] ;
29
+ expect ( id ) . not . toBe ( '' ) ;
30
+ workspaceId = id ;
24
31
} ) ;
25
32
26
33
test . afterAll ( ( ) => agent . stop ( ) ) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export class TestAgent {
32
32
33
33
async start ( options : StartOptions ) {
34
34
this . options = options ;
35
+ await this . runner . clean ( ) ;
35
36
await Promise . all ( [
36
37
this . runner . startServer ( options . backendPort , options . name ) ,
37
38
this . runner . startWeb ( options . webPort , options . backendPort ) ,
Original file line number Diff line number Diff line change @@ -8,6 +8,24 @@ export class AppRunner {
8
8
this . webProcess = null ;
9
9
}
10
10
11
+ async clean ( ) {
12
+ await /** @type {Promise<void> } */ (
13
+ new Promise ( ( resolve , reject ) => {
14
+ const process = spawn ( 'pnpm' , [ 'clean' ] , {
15
+ stdio : 'inherit' ,
16
+ } ) ;
17
+
18
+ process . on ( 'error' , err => reject ( err ) ) ;
19
+ process . on ( 'close' , code => {
20
+ if ( code !== 0 ) {
21
+ reject ( new Error ( `Clean process exited with code ${ code } ` ) ) ;
22
+ }
23
+ resolve ( ) ;
24
+ } ) ;
25
+ } )
26
+ ) ;
27
+ }
28
+
11
29
/**
12
30
* @param {number } port
13
31
* @param {string } instanceName
You can’t perform that action at this time.
0 commit comments