Skip to content

Commit

Permalink
test: update E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Jun 20, 2024
1 parent 86c4e3a commit 1fd9a14
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions __tests__/devenv-e2e/001-create.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ describe( 'vip dev-env create', () => {
const expectedXDebug = false;
const expectedMailpit = false;
const expectedPhoton = false;
const expectedCron = false;

expect( await checkEnvExists( slug ) ).toBe( false );

Expand Down Expand Up @@ -102,6 +103,7 @@ describe( 'vip dev-env create', () => {
xdebug: expectedXDebug,
mailpit: expectedMailpit,
photon: expectedPhoton,
cron: expectedCron,
} );
} );

Expand All @@ -116,6 +118,7 @@ describe( 'vip dev-env create', () => {
const expectedXDebug = true;
const expectedMailpit = true;
const expectedPhoton = true;
const expectedCron = true;

expect( await checkEnvExists( slug ) ).toBe( false );

Expand All @@ -135,6 +138,7 @@ describe( 'vip dev-env create', () => {
'-x', `${ expectedXDebug }`,
'-A', `${ expectedMailpit }`,
'-H', `${ expectedPhoton }`,
'-c', `${ expectedCron }`,
], { env }, true );

expect( result.rc ).toBe( 0 );
Expand All @@ -156,6 +160,7 @@ describe( 'vip dev-env create', () => {
xdebug: expectedXDebug,
mailpit: expectedMailpit,
photon: expectedPhoton,
cron: expectedCron,
} );
} );
} );
4 changes: 4 additions & 0 deletions __tests__/devenv-e2e/005-update.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ describe( 'vip dev-env update', () => {
const expectedXDebug = false;
const expectedMailpit = false;
const expectedPhoton = false;
const expectedCron = false;

expect( await checkEnvExists( slug ) ).toBe( false );

Expand All @@ -95,6 +96,7 @@ describe( 'vip dev-env update', () => {
xdebug: expectedXDebug,
mailpit: expectedMailpit,
photon: expectedPhoton,
cron: expectedCron,
} );

// prettier-ignore
Expand All @@ -106,6 +108,7 @@ describe( 'vip dev-env update', () => {
'-x', `${ ! expectedXDebug }`,
'-A', `${ ! expectedMailpit }`,
'-H', `${ ! expectedPhoton }`,
'-c', `${ ! expectedCron }`,
], { env }, true );

expect( result.rc ).toBe( 0 );
Expand All @@ -119,6 +122,7 @@ describe( 'vip dev-env update', () => {
xdebug: ! expectedXDebug,
mailpit: ! expectedMailpit,
photon: ! expectedPhoton,
cron: ! expectedCron,
} );
} );

Expand Down
8 changes: 8 additions & 0 deletions __tests__/devenv-e2e/013-configuration-file.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ describe( 'vip dev-env configuration file', () => {
const expectedXDebug = true;
const expectedMailpit = true;
const expectedPhoton = true;
const expectedCron = true;

expect( await checkEnvExists( expectedSlug ) ).toBe( false );

Expand All @@ -222,6 +223,7 @@ describe( 'vip dev-env configuration file', () => {
xdebug: expectedXDebug,
mailpit: expectedMailpit,
photon: expectedPhoton,
cron: expectedCron,
'mu-plugins': 'image',
'app-code': 'image',
} );
Expand Down Expand Up @@ -256,6 +258,7 @@ describe( 'vip dev-env configuration file', () => {
xdebug: expectedXDebug,
mailpit: expectedMailpit,
photon: expectedPhoton,
cron: expectedCron,
} );

return expect( checkEnvExists( expectedSlug ) ).resolves.toBe( true );
Expand All @@ -268,6 +271,7 @@ describe( 'vip dev-env configuration file', () => {
const expectedXDebug = false;
const expectedMailpit = false;
const expectedPhoton = false;
const expectedCron = false;

expect( await checkEnvExists( slug ) ).toBe( false );

Expand All @@ -280,6 +284,7 @@ describe( 'vip dev-env configuration file', () => {
xdebug: expectedXDebug,
mailpit: expectedMailpit,
photon: expectedPhoton,
cron: expectedCron,
} );

const spawnOptions = {
Expand All @@ -299,6 +304,7 @@ describe( 'vip dev-env configuration file', () => {
xdebug: expectedXDebug,
mailpit: expectedMailpit,
photon: expectedPhoton,
cron: expectedCron,
} );

// Update environment from changed configuration file
Expand All @@ -310,6 +316,7 @@ describe( 'vip dev-env configuration file', () => {
xdebug: ! expectedXDebug,
mailpit: ! expectedMailpit,
photon: ! expectedPhoton,
cron: ! expectedCron,
} );

result = await cliTest.spawn( [ process.argv[ 0 ], vipDevEnvUpdate ], spawnOptions, true );
Expand All @@ -324,6 +331,7 @@ describe( 'vip dev-env configuration file', () => {
xdebug: ! expectedXDebug,
mailpit: ! expectedMailpit,
photon: ! expectedPhoton,
cron: ! expectedCron,
} );
} );
} );

0 comments on commit 1fd9a14

Please sign in to comment.