Skip to content

Commit

Permalink
Improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luismulinari committed Dec 3, 2024
1 parent e97a9e1 commit 89f8d8d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
File renamed without changes.
Binary file modified __fixtures__/custom-deploy/valid-zip.zip
Binary file not shown.
20 changes: 19 additions & 1 deletion __tests__/bin/vip-app-deploy-validate.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,39 @@ describe( 'vip-app-deploy-validate e2e', () => {

describe( 'validateZipFile', () => {
it( 'should not throw error for valid zip file', async () => {
// Archive: __fixtures__/custom-deploy/valid-zip.zip
// __MACOSX/
// mysite/
// mysite/.DS_Store
// mysite/__MACOSX
// mysite/themes
// mysite/themes/.DS_Store
// mysite/themes/__MACOSX
// mysite/themes/mytheme.php
await validateZipFile( '__fixtures__/custom-deploy/valid-zip.zip' );

expect( exitSpy ).not.toHaveBeenCalled();
} );

it.each( [
{
file: '__fixtures__/custom-deploy/invalid-file.zip',
// Archive: __fixtures__/custom-deploy/invalid-file-chars.zip
// mysite/
// mysite/themes
// mysite/themes/invalid-file-name?.txt
file: '__fixtures__/custom-deploy/invalid-file-chars.zip',
error: `Filename invalid-file-name?.txt contains disallowed characters: [!/:*?"<>|'/^..]+`,
},
{
// Archive: __fixtures__/custom-deploy/no-root-folder.zip
// no-root-folder.txt
file: '__fixtures__/custom-deploy/no-root-folder.zip',
error: `The compressed file must contain a single root directory.`,
},
{
// Archive: __fixtures__/custom-deploy/no-themes-folder.zip
// mysite/
// mysite/file
file: '__fixtures__/custom-deploy/no-themes-folder.zip',
error: `Missing \`themes\` directory from root folder.`,
},
Expand Down

0 comments on commit 89f8d8d

Please sign in to comment.