Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ava version and related dependencies #96

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gaestradaaedo
Copy link

The main purpose of this PR is to update the ava library dependency and added the @ava/typescript for compatibility. The ava's configuration in the package.json file was updated to adhere to the required structure from the package.

It also updates/adds all the related/affected libraries for testing, such as nyc, prettier and source-map-support.

Additionally, it updates the typescript and tslint packages.

All the tests run successfully with the command npm run testFix and the changes made in the files where done automatically by prettier.

@@ -53,7 +53,6 @@ module.exports = {
'no-switch-case-fall-through': true,
'no-unsafe-finally': true,
'no-unused-expression': true,
'no-use-before-declare': true,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was deleted as it no longer exists with the new tslint package version.

@ftrimble
Copy link
Collaborator

CI isn't passing @gaestradaaedo

@ftrimble ftrimble assigned gaestradaaedo and unassigned ftrimble Apr 16, 2024
"sources": [
"src/*.ts",
"src/**/*.ts"
"!dist/test/**/*.test.js",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very confused by this update. Doesn't this say that it's only testing files that don't satisfy these globs? I would expect this to mean that no tests are run at all.

],
"concurrency": 5,
"verbose": true,
"timeout": "10000",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this option no longer supported in ava?

@@ -12,7 +12,7 @@ export async function delay<T>(delayTimeMs: number): Promise<void>;
export async function delay<T>(delayTime: any, value?: T): Promise<void | T> {
return new Promise(
// tslint:disable-next-line:no-any (typed by overload signatures)
resolve => setTimeout(() => resolve(value), delayTime),
(resolve) => setTimeout(() => resolve(value), delayTime),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally hate this lint change, but if you feel strongly this is the right strategy I don't really care as long as it's consistent and is handled automatically with the --fix operation

@@ -34,10 +34,11 @@ export function retry<T extends Function>(fn: T, retryOpts: RetryOpts): T {
try {
return await fn(...args);
} catch (err) {
if (retryOpts.isRetryable && !retryOpts.isRetryable(err)) {
if (err instanceof Error && (!retryOpts.isRetryable || retryOpts.isRetryable(err))) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would cast error or expand the type on line 30 rather than adding this to the check. As written in your update this will ignore the retryOpts if the function throws a non-error which i don't think is desirable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants