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 11import faker from 'faker' ;
22
3- describe ( 'Courses ' , ( ) => {
3+ describe ( 'Create courses ' , ( ) => {
44 before ( ( ) => {
5- cy . task ( 'reset:db' ) ;
5+ cy . task ( 'reset:mooc: db' ) ;
66 } ) ;
77
88 beforeEach ( ( ) => {
Original file line number Diff line number Diff line change 11import cypress from 'cypress' ;
22import { 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' ;
45
56async function open ( ) {
6- const server = await startBackofficeFrontend ( ) ;
7+ const backofficeFrontendServer = await startBackofficeFrontend ( ) ;
8+ const backofficeBackendServer = await startBackofficeBackend ( ) ;
79 await openCypress ( ) ;
8- server . close ( ( ) => {
10+ backofficeFrontendServer . close ( ( ) => {
11+ process . exit ( 0 ) ;
12+ } ) ;
13+ backofficeBackendServer . close ( ( ) => {
914 process . exit ( 0 ) ;
1015 } ) ;
1116}
@@ -14,7 +19,7 @@ async function openCypress() {
1419 return cypress . open ( {
1520 config : {
1621 supportFile : false ,
17- baseUrl : `http://localhost:${ app . get ( 'port' ) } `
22+ baseUrl : `http://localhost:${ frontendApp . get ( 'port' ) } `
1823 }
1924 } ) ;
2025}
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' ;
22import cypress from 'cypress' ;
33import cypressConfig from '../../../cypress.json' ;
44import { startBackofficeFrontend } from './startBackofficeFrontend' ;
5+ import { startBackofficeBackend } from './startBackofficeBackend' ;
56
67async function run ( ) {
7- const server = await startBackofficeFrontend ( ) ;
8+ const backofficeFrontendServer = await startBackofficeFrontend ( ) ;
9+ const backofficeBackendServer = await startBackofficeBackend ( ) ;
810 await runCypress ( ) ;
9- server . close ( ( ) => {
11+ backofficeFrontendServer . close ( ( ) => {
12+ process . exit ( 0 ) ;
13+ } ) ;
14+ backofficeBackendServer . close ( ( ) => {
1015 process . exit ( 0 ) ;
1116 } ) ;
1217}
@@ -19,7 +24,7 @@ async function runCypress() {
1924 config : {
2025 ...cypressConfig ,
2126 supportFile : false ,
22- baseUrl : `http://localhost:${ app . get ( 'port' ) } `
27+ baseUrl : `http://localhost:${ frontendApp . get ( 'port' ) } `
2328 }
2429 } ) ;
2530}
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