File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/packages/file-server/conat Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { fsServer } from "@cocalc/conat/files/fs" ;
2
- import { conat } from "@cocalc/backend/conat" ;
3
2
import { SandboxedFilesystem } from "@cocalc/file-server/fs/sandbox" ;
4
3
import { mkdir } from "fs/promises" ;
5
4
import { join } from "path" ;
6
5
import { isValidUUID } from "@cocalc/util/misc" ;
6
+ import { type Client , getClient } from "@cocalc/conat/core/client" ;
7
7
8
8
export function localPathFileserver ( {
9
9
service,
10
10
path,
11
+ client,
11
12
} : {
12
13
service : string ;
13
14
path : string ;
15
+ client ?: Client ;
14
16
} ) {
15
- const client = conat ( ) ;
17
+ client ??= getClient ( ) ;
16
18
const server = fsServer ( {
17
19
service,
18
20
client,
Original file line number Diff line number Diff line change @@ -4,17 +4,19 @@ import { tmpdir } from "node:os";
4
4
import { join } from "path" ;
5
5
import { fsClient } from "@cocalc/conat/files/fs" ;
6
6
import { randomId } from "@cocalc/conat/names" ;
7
+ import { before , after , client } from "@cocalc/backend/conat/test/setup" ;
7
8
8
9
let tempDir ;
9
10
beforeAll ( async ( ) => {
11
+ await before ( ) ;
10
12
tempDir = await mkdtemp ( join ( tmpdir ( ) , "cocalc-local-path" ) ) ;
11
13
} ) ;
12
14
13
15
describe ( "use the simple fileserver" , ( ) => {
14
16
const service = `fs-${ randomId ( ) } ` ;
15
17
let server ;
16
18
it ( "creates the simple fileserver service" , async ( ) => {
17
- server = await localPathFileserver ( { service, path : tempDir } ) ;
19
+ server = await localPathFileserver ( { client , service, path : tempDir } ) ;
18
20
} ) ;
19
21
20
22
const project_id = "6b851643-360e-435e-b87e-f9a6ab64a8b1" ;
@@ -104,5 +106,6 @@ describe("use the simple fileserver", () => {
104
106
} ) ;
105
107
106
108
afterAll ( async ( ) => {
109
+ await after ( ) ;
107
110
await rm ( tempDir , { force : true , recursive : true } ) ;
108
111
} ) ;
You can’t perform that action at this time.
0 commit comments