-
-
Notifications
You must be signed in to change notification settings - Fork 224
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(nodecli): ユニットテストのセクション、目次とサンプルコード #210
Conversation
<p>これはHTMLです</p> | ||
`.trim(); | ||
|
||
assert.deepStrictEqual(md2html(markdown), expected); |
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.
===
にする
@azu テストコードの
あたり、どう思います?特に trim()あたり |
実際やるなら、 actual.html と expeceted.md をファイルとして作って比較できるようにするかなー
|
|
ファイルとして置いてfs.readFileSyncでもいい気はする(テストだし同期でいいんじゃねという話もできそう) requireだとNodeは読めないのでは。 |
const fs = require("fs"); | ||
const md2html = require("../md2html"); | ||
|
||
it("default options", () => { |
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.
itを日本語にするか問題
const md2html = require("../md2html"); | ||
|
||
it("default options", () => { | ||
const sample = fs.readFileSync("test/fixtures/sample.md", "utf8"); |
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.
微妙に require
と相対パス解決が違う __dirnameとpath.joinで解決するか
const markdown = ` | ||
これはサンプルです。 | ||
https://asciidwango.github.io/js-primer/ | ||
it("default options", () => { |
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.
itはもっと説明的な内容でもいい気がする。
日本語でも良さそうではあるけど
とりあえずこれで |
#7