Skip to content

Commit

Permalink
test: fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Mar 1, 2025
1 parent a436d12 commit 1e80a4d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@
"reporter": ["html", "text"],
"lines": 98,
"branches": "90",
"statements": "98"
"statements": "98",
"exclude": [
"build/deno.js",
"build/vendor-extra.cjs",
"build/vendor-core.cjs",
"build/esblib.cjs",
"test/**",
"scripts",
"src/util.ts"
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"test:it": "node ./test/it/build.test.js",
"test:jsr": "node ./test/it/build-jsr.test.js",
"test:unit": "node --experimental-strip-types ./test/all.test.js",
"test:coverage": "c8 -x build/deno.js -x build/vendor-extra.cjs -x build/vendor-core.cjs -x build/esblib.cjs -x 'test/**' -x scripts --check-coverage npm run test:unit",
"test:coverage": "c8 -c .nycrc --check-coverage npm run test:unit",
"test:circular": "madge --circular src/*",
"test:types": "tsd",
"test:license": "node ./test/extra.test.js",
Expand Down
9 changes: 9 additions & 0 deletions test/md.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { transformMarkdown } from '../src/md.ts'

describe('md', () => {
test('transformMarkdown()', () => {
assert.equal(transformMarkdown('\n'), '// \n// ')
// prettier-ignore
assert.equal(transformMarkdown(`
# Title
Expand All @@ -35,6 +36,10 @@ await $\`echo "ts"\`
unknown code block
~~~
~~~sh
echo foo
~~~
`), `//
// # Title
//
Expand All @@ -50,6 +55,10 @@ await $\`echo "ts"\`
// unknown code block
//
await $\`
echo foo
\`
//
// `)
})
Expand Down

0 comments on commit 1e80a4d

Please sign in to comment.