Skip to content

Commit

Permalink
test: update unit tests for bigint in react-devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
nutboltu committed Dec 4, 2019
1 parent f3d1ae5 commit 8b3ee24
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ exports[`InspectedElementContext should support complex data types: 1: Inspected
"hooks": null,
"props": {
"array_buffer": {},
"big_int": {},
"date": {},
"fn": {},
"html_element": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@ describe('InspectedElementContext', () => {
ReactDOM.render(
<Example
array_buffer={typedArray.buffer}
// eslint-disable-next-line no-undef
big_int={BigInt(123)}
date={new Date()}
fn={exampleFunction}
html_element={div}
Expand Down Expand Up @@ -577,6 +579,7 @@ describe('InspectedElementContext', () => {

const {
array_buffer,
big_int,
date,
fn,
html_element,
Expand All @@ -595,6 +598,10 @@ describe('InspectedElementContext', () => {
expect(array_buffer[meta.name]).toBe('ArrayBuffer');
expect(array_buffer[meta.type]).toBe('array_buffer');

expect(big_int[meta.inspectable]).toBe(false);
expect(big_int[meta.name]).toBe('123');
expect(big_int[meta.type]).toBe('bigint');

expect(date[meta.inspectable]).toBe(false);
expect(date[meta.type]).toBe('date');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Object {
"hooks": null,
"props": {
"array_buffer": {},
"big_int": {},
"date": {},
"fn": {},
"html_element": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ describe('InspectedElementContext', () => {
ReactDOM.render(
<Example
array_buffer={typedArray.buffer}
// eslint-disable-next-line no-undef
big_int={BigInt(123)}
date={new Date()}
fn={exampleFunction}
html_element={div}
Expand All @@ -190,6 +192,7 @@ describe('InspectedElementContext', () => {

const {
array_buffer,
big_int,
date,
fn,
html_element,
Expand All @@ -208,6 +211,10 @@ describe('InspectedElementContext', () => {
expect(array_buffer[meta.name]).toBe('ArrayBuffer');
expect(array_buffer[meta.type]).toBe('array_buffer');

expect(big_int[meta.inspectable]).toBe(false);
expect(big_int[meta.name]).toBe('123');
expect(big_int[meta.type]).toBe('bigint');

expect(date[meta.inspectable]).toBe(false);
expect(date[meta.type]).toBe('date');

Expand Down

0 comments on commit 8b3ee24

Please sign in to comment.