-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
draft: Add unit tests #5412
base: master
Are you sure you want to change the base?
draft: 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
|
||
expect(obj).toHaveProperty('_callbacks', { | ||
testEvent: [callback] | ||
}) |
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.
|
||
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.
|
||
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'); |
|
||
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.
|
||
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.
|
||
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'); |
|
||
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'); |
Changes
Add unit tests to some
utils
files.Issues
Fixes #4872