-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add unit tests #5412
Add unit tests #5412
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
Cloudflare Pages deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
src/utils/events.test.ts
Outdated
|
||
eventsUtils.trigger(obj, 'testEvent', ['testValue1', 'testValue2']); | ||
|
||
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space is required after '{'. object-curly-spacing
Fix available:
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); | |
expect(callback).toHaveBeenCalledWith({ type: 'testEvent'}, 'testValue1', 'testValue2'); |
src/utils/events.test.ts
Outdated
|
||
eventsUtils.trigger(obj, 'testEvent', ['testValue1', 'testValue2']); | ||
|
||
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space is required before '}'. object-curly-spacing
Fix available:
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); | |
expect(callback).toHaveBeenCalledWith({type: 'testEvent' }, 'testValue1', 'testValue2'); |
src/utils/events.test.ts
Outdated
|
||
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); | ||
}); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/utils/events.test.ts
Outdated
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); | ||
}); | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
src/utils/events.test.ts
Outdated
|
||
expect(obj).toHaveProperty('_callbacks', { testEvent: [initialCallback] }); | ||
}); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/utils/events.test.ts
Outdated
|
||
eventsUtils.trigger(obj, 'testEvent', ['testValue1', 'testValue2']); | ||
|
||
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space is required after '{'. object-curly-spacing
Fix available:
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); | |
expect(callback).toHaveBeenCalledWith({ type: 'testEvent'}, 'testValue1', 'testValue2'); |
src/utils/events.test.ts
Outdated
|
||
eventsUtils.trigger(obj, 'testEvent', ['testValue1', 'testValue2']); | ||
|
||
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space is required before '}'. object-curly-spacing
Fix available:
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); | |
expect(callback).toHaveBeenCalledWith({type: 'testEvent' }, 'testValue1', 'testValue2'); |
@Airthee I'm trying to clean up some stale PRs... do you plan to continue working on this? |
Hi ! Sorry I didn't work on it since many months, but I will try to fix lint and remove draft when all is green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
src/utils/events.test.ts
Outdated
|
||
expect(obj).toHaveProperty('_callbacks', { testEvent: [initialCallback] }); | ||
}); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/utils/events.test.ts
Outdated
|
||
eventsUtils.trigger(obj, 'testEvent', ['testValue1', 'testValue2']); | ||
|
||
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space is required after '{'. @stylistic/object-curly-spacing
Fix available:
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); | |
expect(callback).toHaveBeenCalledWith({ type: 'testEvent'}, 'testValue1', 'testValue2'); |
src/utils/events.test.ts
Outdated
|
||
eventsUtils.trigger(obj, 'testEvent', ['testValue1', 'testValue2']); | ||
|
||
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space is required before '}'. @stylistic/object-curly-spacing
Fix available:
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2'); | |
expect(callback).toHaveBeenCalledWith({type: 'testEvent' }, 'testValue1', 'testValue2'); |
Quality Gate passedIssues Measures |
@thornbill I think it's all good ! |
Yes, you can continue to reference the closed issue or just leave it blank. Either way is fine. |
Changes
Add unit tests to some
utils
files.Issues
Fixes #4872