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

feat: add type coverage #1102

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d35f154
refactor: getStarkName & getStarkProfile for latest version of contract
irisdv Apr 22, 2024
23ae319
Snjs enc dec doc (#1101)
PhilippeR26 Apr 25, 2024
d0fdd73
feat: add type coverage
saimeunt Apr 25, 2024
ae5dcf9
chore: add examples to JsDoc for num.ts file (#1100)
NueloSE Apr 26, 2024
d56cad2
feat: switch to type-coverage
saimeunt Apr 27, 2024
8ba8d10
Merge pull request #1093 from irisdv/ref/starknetid_address_to_domain
tabaktoni Apr 29, 2024
f77bae5
chore: Add JsDoc comments and examples for merkle.ts file (#1107)
NueloSE Apr 29, 2024
0b25aba
chore: Add JsDoc comments and examples for selector.ts file (#1106)
NueloSE Apr 29, 2024
0ab0de7
chore: add examples to JsDoc for transaction.ts file (#1105)
petersdt Apr 29, 2024
59eb01e
Revert "chore: add examples to JsDoc for transaction.ts file (#1105)"…
ivpavici Apr 29, 2024
d9d2968
fix: add back typescript-coverage-report
saimeunt May 1, 2024
00342f2
fix: document how to display the type coverage report
saimeunt May 1, 2024
1f3c934
chore/add JsDoc for address.ts file (#1096)
BlackStarkGoku May 2, 2024
fd471d3
feat: add type coverage
saimeunt Apr 25, 2024
35e3c8b
feat: switch to type-coverage
saimeunt Apr 27, 2024
1dd68b4
fix: add back typescript-coverage-report
saimeunt May 1, 2024
73e63ed
fix: document how to display the type coverage report
saimeunt May 1, 2024
78ff4f6
fix: clarify how to view typespcript-coverage-report HTML report
saimeunt May 4, 2024
705ecdd
Merge branch 'feat/add-type-coverage-1088' of https://github.com/saim…
saimeunt May 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions coverage-ts/assets/source-file.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.uncovered {
background: rgba(235, 26, 26, 0.3);
}
.CodeMirror {
border: 1px solid #ccc;
border-radius: 3px;
height: auto;
}
.TS-lineuncovered {
background: rgba(255, 255, 255, 0.3);
width: 24px;
}
/* NOTE: I have to increase the specificity because of semantic-ui */
p.footer-text {
text-align: center;
margin: 3em 0;
}
.gutter-marker {
text-align: center;
font-size: 0.6em;
}
38 changes: 38 additions & 0 deletions coverage-ts/assets/source-file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use strict';

document.addEventListener('DOMContentLoaded', () => {
const myTextArea = document.getElementById('editor');
const codeMirrorInstance = CodeMirror.fromTextArea(myTextArea, {
readOnly: true,
lineNumbers: true,
lineWrapping: false,
mode: 'text/typescript',
gutters: ['TS-lineuncovered', 'CodeMirror-linenumbers'],
});
const annotations = JSON.parse(document.getElementById('annotations').textContent);
const gutters = {};

annotations.forEach((annotation) => {
gutters[annotation.line] = (gutters[annotation.line] || 0) + 1;
codeMirrorInstance.markText(
{ line: annotation.line, ch: annotation.character },
{
line: annotation.line,
ch: annotation.character + annotation.text.length,
},
{
className: 'uncovered',
}
);
});

Object.entries(gutters).forEach(([line, count]) => {
const gutterMarker = document.createElement('div');

gutterMarker.textContent = count + 'x';
gutterMarker.classList.add('gutter-marker');
gutterMarker.style.background = 'rgba(255,0,0,' + count * 0.2 + ')';

codeMirrorInstance.setGutterMarker(+line, 'TS-lineuncovered', gutterMarker);
});
});
Loading