File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -17,18 +17,26 @@ import {start} from '@shelf/postgres-local';
17
17
18
18
await start ({
19
19
seedPath: " schema.sql" ,
20
- version: 14
20
+ version: 14 ,
21
+ port: 5555 ,
22
+ includeInstallation: true
21
23
});
22
24
```
25
+ - ` seedPath ` - absolute path to sql file with commands that will set up db structure before tests
26
+ - ` includeInstallation `
27
+ - when this flag is ` true ` (default) macOS will run ` brew install ` and linux ` apt install ` to make sure ` postgres ` is installed
28
+ - when false - package omit installing postgres and relly that it is already in place
23
29
24
30
### 2. Stop Postgres
25
31
26
32
``` js
27
33
import {stop } from ' @shelf/postgres-local' ;
28
34
29
- await stop (14 );
35
+ await stop ({version : 14 } );
30
36
```
31
37
38
+
39
+
32
40
## Publish
33
41
34
42
``` sh
Original file line number Diff line number Diff line change @@ -3,4 +3,6 @@ import cwd from 'cwd';
3
3
module . exports = {
4
4
seedPath : `${ cwd ( ) } /test/seed.sql` ,
5
5
version : 14 ,
6
+ port : 5555 ,
7
+ includeInstallation : true ,
6
8
} ;
Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ export async function start(options: {
44
44
}
45
45
}
46
46
47
- export function stop ( { version = 14 } : { version ?: number ; useSudo ?: boolean } ) : any {
48
- return spawnSync ( getStopScript ( { version} ) , {
47
+ export function stop ( { version = 14 } : { version ?: number } ) : void {
48
+ spawnSync ( getStopScript ( { version} ) , {
49
49
stdio : 'inherit' ,
50
50
shell : true ,
51
51
} ) ;
You can’t perform that action at this time.
0 commit comments