Skip to content

Commit

Permalink
test(zip): improved tests and error handling for zip
Browse files Browse the repository at this point in the history
  • Loading branch information
H4ad committed Aug 14, 2022
1 parent f199462 commit f0dc23d
Show file tree
Hide file tree
Showing 9 changed files with 646 additions and 101 deletions.
1 change: 1 addition & 0 deletions .mocharc.json
Expand Up @@ -6,6 +6,7 @@
"watch-extensions": [
"ts"
],
"parallel": false,
"recursive": true,
"reporter": "spec",
"timeout": 10000
Expand Down
12 changes: 0 additions & 12 deletions .nycrc

This file was deleted.

207 changes: 205 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Expand Up @@ -11,10 +11,11 @@
"prepack": "yarn build && oclif manifest && oclif readme",
"clean": "rm -rf ./lib/",
"cm": "cz",
"coverage": "codecov",
"coverage": "codecov --disable=gcov",
"lint": "eslint ./src/ ./test/ --fix",
"semantic-release": "semantic-release",
"test": "nyc --extension .ts --reporter=html mocha --forbid-only \"test/**/*.test.ts\"",
"pretest": "npm run build",
"test": "nyc --extension .ts --reporter=html --reporter=json mocha --forbid-only \"test/**/*.test.ts\"",
"typecheck": "tsc --noEmit",
"version": "oclif readme && git add README.md"
},
Expand Down Expand Up @@ -101,6 +102,7 @@
"@types/node": "12.20.43",
"@types/plist": "^3.0.2",
"@types/rimraf": "^3.0.2",
"@types/sinon": "^10.0.13",
"@types/unzipper": "^0.10.5",
"@types/yazl": "^2.4.2",
"@typescript-eslint/eslint-plugin": "^5.12.1",
Expand All @@ -126,6 +128,7 @@
"oclif": "^3",
"prettier": "^2.5.1",
"semantic-release": "^19.0.3",
"sinon": "^14.0.0",
"tape": "^5.5.3",
"ts-node": "^10.4.0",
"typescript": "^4.5.5",
Expand Down
12 changes: 1 addition & 11 deletions src/commands/run/index.ts
Expand Up @@ -499,17 +499,7 @@ export default class Run extends CustomCommand {
const rootPath = resolve(process.cwd(), dir);
const fasterZip = new FasterZip();

await fasterZip.run(rootPath, outputPath, zipArtifacts).catch(error => {
throw new CustomError(
`An error occurred while creating the zip: ${error.message}`,
{
code: 'ERR_FASTER_ZIP',
suggestions: [
"Make sure you didn't pass invalid path to files or remapping.",
],
},
);
});
await fasterZip.run(rootPath, outputPath, zipArtifacts);

this.logMessage(flags, 'log', 'Creating the output file... created');
}
Expand Down

0 comments on commit f0dc23d

Please sign in to comment.