File tree Expand file tree Collapse file tree 4 files changed +34
-10
lines changed
apps/backoffice/frontend/features/courses Expand file tree Collapse file tree 4 files changed +34
-10
lines changed Original file line number Diff line number Diff line change 1
1
import faker from 'faker' ;
2
2
3
- describe ( 'Courses ' , ( ) => {
3
+ describe ( 'Create courses ' , ( ) => {
4
4
before ( ( ) => {
5
- cy . task ( 'reset:db' ) ;
5
+ cy . task ( 'reset:mooc: db' ) ;
6
6
} ) ;
7
7
8
8
beforeEach ( ( ) => {
Original file line number Diff line number Diff line change 1
1
import cypress from 'cypress' ;
2
2
import { startBackofficeFrontend } from './startBackofficeFrontend' ;
3
- import app from '../../../src/apps/backoffice/frontend/app' ;
3
+ import frontendApp from '../../../src/apps/backoffice/frontend/app' ;
4
+ import { startBackofficeBackend } from './startBackofficeBackend' ;
4
5
5
6
async function open ( ) {
6
- const server = await startBackofficeFrontend ( ) ;
7
+ const backofficeFrontendServer = await startBackofficeFrontend ( ) ;
8
+ const backofficeBackendServer = await startBackofficeBackend ( ) ;
7
9
await openCypress ( ) ;
8
- server . close ( ( ) => {
10
+ backofficeFrontendServer . close ( ( ) => {
11
+ process . exit ( 0 ) ;
12
+ } ) ;
13
+ backofficeBackendServer . close ( ( ) => {
9
14
process . exit ( 0 ) ;
10
15
} ) ;
11
16
}
@@ -14,7 +19,7 @@ async function openCypress() {
14
19
return cypress . open ( {
15
20
config : {
16
21
supportFile : false ,
17
- baseUrl : `http://localhost:${ app . get ( 'port' ) } `
22
+ baseUrl : `http://localhost:${ frontendApp . get ( 'port' ) } `
18
23
}
19
24
} ) ;
20
25
}
Original file line number Diff line number Diff line change 1
- import app from '../../../src/apps/backoffice/frontend/app' ;
1
+ import frontendApp from '../../../src/apps/backoffice/frontend/app' ;
2
2
import cypress from 'cypress' ;
3
3
import cypressConfig from '../../../cypress.json' ;
4
4
import { startBackofficeFrontend } from './startBackofficeFrontend' ;
5
+ import { startBackofficeBackend } from './startBackofficeBackend' ;
5
6
6
7
async function run ( ) {
7
- const server = await startBackofficeFrontend ( ) ;
8
+ const backofficeFrontendServer = await startBackofficeFrontend ( ) ;
9
+ const backofficeBackendServer = await startBackofficeBackend ( ) ;
8
10
await runCypress ( ) ;
9
- server . close ( ( ) => {
11
+ backofficeFrontendServer . close ( ( ) => {
12
+ process . exit ( 0 ) ;
13
+ } ) ;
14
+ backofficeBackendServer . close ( ( ) => {
10
15
process . exit ( 0 ) ;
11
16
} ) ;
12
17
}
@@ -19,7 +24,7 @@ async function runCypress() {
19
24
config : {
20
25
...cypressConfig ,
21
26
supportFile : false ,
22
- baseUrl : `http://localhost:${ app . get ( 'port' ) } `
27
+ baseUrl : `http://localhost:${ frontendApp . get ( 'port' ) } `
23
28
}
24
29
} ) ;
25
30
}
Original file line number Diff line number Diff line change
1
+ import app from '../../../src/apps/backoffice/backend/app' ;
2
+ import { Server } from 'http' ;
3
+
4
+ export async function startBackofficeBackend ( ) : Promise < Server > {
5
+ let server : Server ;
6
+
7
+ return new Promise ( ( resolve , reject ) => {
8
+ server = app . listen ( app . get ( 'port' ) , async ( ) => {
9
+ console . log ( ` Backoffice backend is running at http://localhost:${ app . get ( 'port' ) } in ${ app . get ( 'env' ) } mode` ) ;
10
+ console . log ( ' Press CTRL-C to stop\n' ) ;
11
+ resolve ( server ) ;
12
+ } ) ;
13
+ } ) ;
14
+ }
You can’t perform that action at this time.
0 commit comments