ava-to-jest.md AVAからJestへの移行 大枠の書き方 テストケースの定義 AVAのtest('コメント', () => {/* テスト内容 */});という書き方(xUnit形式)はJestでも可能です。AVAではimport test from 'ava';という感じでtest関数をインポートしていましたが、Jestではグローバル変数として定義されているのでインポートは不要です。test関数だけでなく、Jestが提供するAPIは全てグローバル変数で定義されているので、importせずに参照できます。 // AVA import test from 'ava'; test('テストケース名など', t => { t.true(true); }); // Jest // 全てのAPIはグローバルに定義されており、importは不要 test('テストケース名など', ()
Update April 15, 2020: Still go for May 13. Update March 6, 2020: There's a difficult balance to be had between trying to get it right and shipping a usable product. The repository continues to see rapid development and we have yet to make substantial progress on the major missing feature: dev tool support. Therefore we are bumping the release date yet again. However instead of blindly estimating
Node.jsでUnhandled Rejectionsが発生してprocessが終了すると、Exit Statusが0となる問題とその対策についてのメモです。 追記: Node.js 15+からUnhandle Rejectionが発生するとプロセスがExit Status 1で終了する動作がデフォルトとなりました Node.js v15ではunhandled rejectionでプロセスがエラー終了する 事前知識: Async FunctionはPromiseを返す関数定義です。 その辺について詳しくは次のサイトを読んでください。 JavaScript Promiseの本 非同期処理:コールバック/Promise/Async Function · JavaScript Primer #jsprimer 今回のサンプルコードは次のリポジトリにあります。 azu/unhandled-rej
reg is a package manager for native ES Modules. It's built to enable dependency management for Universal JavaScript (JavaScript that can run in the Browser and in Node.js w/o a compiler). This library is highly experimental and still likely to break without notice. DO NOT USE THIS IN PRODUCTION. Supporting Universal JavaScript is quite difficult as the Browser's module system has a very unique set
Warning: This blog post is outdated. It may contain incorrect information. Update 2019-11-22: ESM support in Node.js is not experimental, anymore. This post was updated to reflect that. Conditional exports are now explained. In this blog post, we look at npm packages that contain both ES modules and CommonJS modules. Required knowledge: How ES modules are supported natively on Node.js. You can rea
A stream is an abstract interface for working with streaming data in Node.js. The node:stream module provides an API for implementing the stream interface. There are many stream objects provided by Node.js. For instance, a request to an HTTP server and process.stdout are both stream instances. Streams can be readable, writable, or both. All streams are instances of EventEmitter. To access the node
You can discuss the course and related topics in our dedicated group on Discord https://study.cs.helsinki.fi/discord/join/fullstack. Please join the conversation! See here how to ask questions in a proper way Parts 0-8 and 13 of the course material is written by Matti Luukkainen. The content of part 9 is written by developers from Terveystalo. Part 10 is written by Kalle Ilves. The content of part
技術書、ブログ、READMEを書いてていて、文章中に出てくるコードブロックのコードをテストしたいことがあると思います。 そのサンプルコードが本当に動いてるのか不安になることがあるからです。 power-doctestは、そのコードブロック中のコードにコメントを入れるだけでテスト可能にするツール群です。 power-doctestの例 具体的な例から見ていきます。 次の例では、Markdownで説明とJavaScriptのコードブロックを書いています。 デフォルト引数を使って書くことで、このような挙動は起きなくなるため安全です。 デフォルト引数では、引数が渡されなかった場合のみデフォルト値が入ります。 ```js function addPrefix(text, prefix = "デフォルト:") { return prefix + text; } // falsyな値を渡してもデフォルト
🧬 Cross platform. Works on major Linux flavours and Windows. Help is requested to bring it to ARM based MacOS. See issue 1024 📉 Low CPU and memory footprint. Current CPU stays at 0% on idle and memory usage is under 20MB for a Hello World program. 💅 Styling with CSS (includes actual cascading). Also has full support for Flexbox layout (thanks to Yoga). ✅ Complete Nodejs API support (Currently r
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く