|
1 | 1 | # Contribute |
2 | 2 |
|
| 3 | +## Coverage |
| 4 | + |
| 5 | +Here are some tips for dealing with coverage gutters. |
| 6 | + |
| 7 | +The goal is to allow it to look like the example below. The extension needs to |
| 8 | +be installed, and enabled. I typically press **F1** and type "Display Coverage" |
| 9 | +and enter or **SHIFT + CMD + 7** for a shortcut. |
| 10 | + |
| 11 | +Assuming you have a valid coverage report at _./coverage/lcov.info_ (change in |
| 12 | +_.vscode/settings.json_ or other) then this will display as below. |
| 13 | + |
| 14 | +As you make changes, you need to update the coverage reports so the gutters stay |
| 15 | +consistent with your work. See the example below for how to do that. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | +```bash |
| 21 | +# remove old coverage reports |
| 22 | +rm -rf coverage |
| 23 | +# run a test OR |
| 24 | +deno test --allow-write --allow-read --allow-env --unstable --import-map=import_map.json --fail-fast --coverage=./coverage/output src/common/file_test.ts |
| 25 | +# run all tests |
| 26 | +deno test --allow-write --allow-read --allow-env --unstable --import-map=import_map.json --fail-fast --coverage=./coverage/output |
| 27 | +# generage lcov.info, must have exclude as the default doesn't have the _ |
| 28 | +deno coverage --exclude="(_|.)conf(ig){0,1}\.(ts|js|tsx)" --exclude="_test\.(ts|js)" --unstable ./coverage --lcov > ./coverage/lcov.info |
| 29 | +# at this point you would reload you coverage with SHIFT+CMD+7 or F1 + "Display Coverage" + enter |
| 30 | +# optionally, generate a coverage report to view in a browser |
| 31 | +genhtml -o coverage/html ./coverage/lcov.info |
| 32 | +``` |
| 33 | + |
| 34 | +## Docker |
| 35 | + |
3 | 36 | ```bash |
4 | 37 | # docker should be installed |
5 | 38 | docker build -t trailmix -f .docker/Dockerfile . |
6 | 39 |
|
7 | 40 | # now run tests |
8 | 41 | docker run trailmix deno test --unstable --allow-write --allow-read --allow-env --import-map=import_map.json |
9 | 42 | ``` |
| 43 | + |
| 44 | +## imports |
| 45 | + |
| 46 | +### std/path |
| 47 | + |
| 48 | +| function | from | to | |
| 49 | +| :---------------- | :------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------ | |
| 50 | +| MATH | | | |
| 51 | +| resolve | 'a/b/../d/c','b','c' | /Users/trilom/repos/utilities/a/d/c/b/c | |
| 52 | +| resolve(absolute) | '/a/b/../d/c','b','c' | /a/d/c/b/c | |
| 53 | +| normalize | 'a/b/../d/c' | a/d/c | |
| 54 | +| join | 'a/b/../d/c','b','c' | a/d/c/b/c | |
| 55 | +| isAbsolute | /a/b/c | true | |
| 56 | +| isAbsolute(false) | a/b/c | false | |
| 57 | +| relative | /Users/trilom/repos/utilities,/Users/trilom | ../../ | |
| 58 | +| dirname | /Users/trilom/repos/utilities/trailmix.config.ts | /Users/trilom/repos/utilities | |
| 59 | +| basename | /Users/trilom/repos/utilities/trailmix.config.ts | trailmix.config.ts | |
| 60 | +| basename(no ext) | /Users/trilom/repos/utilities/trailmix.config.ts, | .ts trailmix.config | |
| 61 | +| extname | /Users/trilom/repos/utilities/trailmix.config.ts | .ts | |
| 62 | +| CONVERT | | | |
| 63 | +| fromFileUrl | file:///Users/trilom/repos/utilities/trailmix.config.ts | /Users/trilom/repos/utilities/trailmix.config.ts | |
| 64 | +| toFileUrl | /Users/trilom/repos/utilities/trailmix.config.ts | file:///Users/trilom/repos/utilities/trailmix.config.ts | |
| 65 | +| OBJECT | | | |
| 66 | +| parse | /Users/trilom/repos/utilities/trailmix.config.ts | {root: "/",dir: "/Users/bkillian/trailmix/utilities",base: "trailmix.config.ts",ext: ".ts",name: "trailmix.config"} | |
| 67 | +| format | {root: "/",dir: "/Users/trilom/repos/utilities",base: "trailmix.config.ts",ext: ".ts",name: "trailmix.config"} | /Users/trilom/repos/utilities/trailmix.config.ts | |
0 commit comments