Skip to content

Commit

Permalink
Merge pull request #66 from descript-org/typescript
Browse files Browse the repository at this point in the history
v4: types fixes
  • Loading branch information
madimp authored Nov 12, 2024
2 parents 9580740 + a8d955a commit bc1aff5
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class DescriptError {
}

if (this.error?.id === 'Error') {
this.error.id = ERROR_ID.UNKNOWN_ERROR;
this.error.id = ERROR_ID.JS_ERROR;
}

if (!this.error?.id) {
Expand Down
2 changes: 2 additions & 0 deletions lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export type LoggerEvent = SuccessLoggerEvent | ErrorLoggerEvent | StartLoggerEve


class Logger {
static EVENT = EVENT;

private _debug = false;

constructor(config: Config) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"name": "descript",
"description": "descript",
"version": "4.0.0",
"version": "4.0.1",
"homepage": "https://github.com/pasaran/descript3",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion tests/error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('de.error', () => {
Object.keys(e).forEach(key => err[key] = e[key]);
const error = de.error(err);

expect(error.error.id).toBe('UNKNOWN_ERROR');
expect(error.error.id).toBe('JS_ERROR');
expect(error.error.code).toBe('ENOENT');
expect(error.error.syscall).toBe('open');
// FIXME: Может лучше .toBeDefined() использовать?
Expand Down
4 changes: 2 additions & 2 deletions tests/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ describe('request', () => {

} catch (error) {
expect(de.isError(error)).toBe(true);
expect(error.error.id).toBe('UNKNOWN_ERROR');
expect(error.error.id).toBe('JS_ERROR');
expect(error.error.code).toBe('Z_DATA_ERROR');
}
});
Expand Down Expand Up @@ -812,7 +812,7 @@ describe('request', () => {

} catch (error) {
expect(de.isError(error)).toBe(true);
expect(error.error.id).toBe('UNKNOWN_ERROR');
expect(error.error.id).toBe('JS_ERROR');
expect(error.error.code).toBe('GenericFailure');
}
});
Expand Down

0 comments on commit bc1aff5

Please sign in to comment.