-
Notifications
You must be signed in to change notification settings - Fork 307
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
improve HTML - init commit #802
Conversation
b45099f
to
625db82
Compare
src/lib/reporters/Html.ts
Outdated
@@ -3,6 +3,32 @@ import Reporter, { eventHandler, ReporterProperties } from './Reporter'; | |||
import Test from '../Test'; | |||
import Suite from '../Suite'; | |||
|
|||
const location = window.location; | |||
|
|||
function getFullName(test: Suite | Test): string { |
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.
Don't specify a return type when it's not necessary. Also applies to createLinkNode
.
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.
done
src/lib/reporters/Html.ts
Outdated
let search = location.search; | ||
|
||
if (search) { | ||
search = search.slice(1).split('&').filter(function (el) { |
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.
For consistency, prefer arrow functions for simple callbacks.
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.
done
I like where this is going. Some thoughts:
|
Also, the 'skipped' icon is rendering fine for me using Chrome on a Mac. Is there a particular browser you're seeing the issue with? |
It was my mistake - I use outdated master branch. |
7f9aaa0
to
5ff87c5
Compare
Done, but now i need window.encodeURIComponent function. So, can I just add window property to the HtmlProperties or I should write some provider for window.encodeURIComponent?
@jason0x43 Are you sure about that? Maybe we should build another html representation in case when grep property is specified? Show skipped tests in another (last) section or something like that? |
13a6e78
to
bc7badd
Compare
@jason0x43 one more question. I tried to write tests but looks like i should register me mocks somehow. What i should do? Stacktrace:
|
Assuming you want to use the same createLocation code in the browser and in Node, you don't need to deal with the plugin system, just do |
e268dac
to
890fc47
Compare
So, how's this going? From the last CI error, it looks like the self tests are just missing a few commas. |
890fc47
to
5dff892
Compare
Codecov Report
@@ Coverage Diff @@
## master #802 +/- ##
==========================================
- Coverage 92.96% 92.93% -0.03%
==========================================
Files 54 54
Lines 4349 4361 +12
Branches 942 944 +2
==========================================
+ Hits 4043 4053 +10
- Misses 306 308 +2
Continue to review full report at Codecov.
|
Well, I believe that feature itself is ready. There is only one little problem: I can't just add test for So - only one unit test left. Seems that I should call multiply methods if I want test this. It's sad - I was sure that I can call only |
You could aspect import { after } from '@dojo/core/aspect';
// ...
test() {
let nodes: HTMLElement[] = [];
after(reporter.document, 'createElement', (returnValue: any, args: IArguments) => {
nodes.push(returnValue);
return returnValue;
});
// do test
// make assertions about created nodes
} |
5dff892
to
4be0f00
Compare
@jason0x43 It's ready now. Thanks for core/aspect - it's very useful. |
@jason0x43 any news? |
Hah, good timing, I was just reviewing it. |
I made a couple minor changes (updated the createLinkNode method to use |
Hello @dylans, hello @jason0x43!
This pull request can fix several issues:
#636 #724
Now it's looks like this:
Feedback:
npm test serveOnly
command sayListening on localhost:9000 (ws 9001)
it's not comfortable - maybe it's should sayListening on http://127.0.0.1:9000/__intern/ (ws 9001)
? In that case you can copy-paste this URL to browser.If you prefer arrow function for callback - maybe you should add linter rule for that?
https://eslint.org/docs/rules/prefer-arrow-callback