Line returns added in serialized function when running through jest
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js
- 領域
- backend
調査の方向性
issue に記載されている Jest テストの再現から始め、その出力をスタンドアロンの Node.js の結果およびリンク先の gist と比較します。Jest を通して実行したときに、シリアライズされた例が改行を挿入せず、期待される関数のフォーマットを生成すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I always get the weirdest issues. So, serialize-javascript works fine in actual production, but it somehow outputs a different thing while running a test. In the example of the object with all the types including the function, I get an odd line return within the serialized function.
Environment:
- Node 14.13.0
- Jest 26.5.2
- serialize-javascript 5.0.1
Reproduction:
(Alternatively, see https://gist.github.com/eslachance/6dbd88820f09de4509d4f19c4c0e7ad6 for reproduction)
- Create a jest test
- import serialize-javascript
- Add a console.log of the serialized example.
test("serializes javascript", () => {
console.log(serialize({
str : 'string',
num : 0,
obj : {foo: 'foo'},
arr : [1, 2, 3],
bool : true,
nil : null,
undef: undefined,
inf : Infinity,
date : new Date("Thu, 28 Apr 2016 22:02:17 GMT"),
map : new Map([['hello', 'world']]),
set : new Set([123, 456]),
fn : function echo(arg) { return arg; },
re : /([^\s]+)/g,
big : BigInt(10),
}))
});
Expected result:
{"str":"string","num":0,"obj":{"foo":"foo"},"arr":[1,2,3],"bool":true,"nil":null,"undef":undefined,"inf":Infinity,"date":new Date("2016-04-28T22:02:17.000Z"),"map":new Map([["hello","world"]]),"set":new Set([123,456]),"fn":function echo(arg) { return arg; },"re":new RegExp("([^\\s]+)", "g"),"big":BigInt("10")}
Actual Result:
{"str":"string","num":0,"obj":{"foo":"foo"},"arr":[1,2,3],"bool":true,"nil":null,"undef":undefined,"inf":Infinity,"date":new Date("2016-04-28T22:02:17.000Z"),"map":new Map([["hello","world"]]),"set":new Set([123,456]),"fn":function echo(arg) {
return arg;
},"re":new RegExp("([^\\s]+)", "g"),"big":BigInt("10")}
The expected result was a simple nodejs file which outputs the serialized data and nothing else.
This is confusing me very much, and I don't know where to begin in troubleshooting it.
- 主要言語
- JavaScript
- スター
- 2.9k
- フォーク
- 215
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 2
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
yahoo/serialize-javascript のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
yahoo/serialize-javascript#230 ·
-
Ad java script オープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
yahoo/serialize-javascript#212 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
yahoo/serialize-javascript#208 · コメント 10 件 · リアクション 25 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
yahoo/serialize-javascript#195 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
yahoo/serialize-javascript#182 ·
yahoo/serialize-javascript の issue をすべて見る
似ている issue
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·