@@ -71,68 +71,41 @@ describe("JSON Browser", () => {
71
71
72
72
test ( "null" , async ( ) => {
73
73
const node = await hyperjump . get ( `${ testDomain } /foo#/null` ) ;
74
- if ( hyperjump . typeOf ( node , "null" ) ) {
75
- /** @type null */
76
- const subject = hyperjump . value ( node ) ;
77
- expect ( subject ) . to . equal ( null ) ;
78
- } else {
79
- expect . fail ( ) ;
80
- }
74
+ const subject = hyperjump . value ( node ) ;
75
+ expect ( subject ) . to . equal ( null ) ;
81
76
} ) ;
82
77
83
78
test ( "true" , async ( ) => {
84
79
const node = await hyperjump . get ( `${ testDomain } /foo#/true` ) ;
85
- if ( hyperjump . typeOf ( node , "boolean" ) ) {
86
- /** @type boolean */
87
- const subject = hyperjump . value ( node ) ;
88
- expect ( subject ) . to . equal ( true ) ;
89
- } else {
90
- expect . fail ( ) ;
91
- }
80
+ const subject = hyperjump . value ( node ) ;
81
+ expect ( subject ) . to . equal ( true ) ;
92
82
} ) ;
93
83
94
84
test ( "false" , async ( ) => {
95
85
const node = await hyperjump . get ( `${ testDomain } /foo#/false` ) ;
96
- if ( hyperjump . typeOf ( node , "boolean" ) ) {
97
- /** @type boolean */
98
- const subject = hyperjump . value ( node ) ;
99
- expect ( subject ) . to . equal ( false ) ;
100
- } else {
101
- expect . fail ( ) ;
102
- }
86
+ const subject = hyperjump . value ( node ) ;
87
+ expect ( subject ) . to . equal ( false ) ;
103
88
} ) ;
104
89
105
90
test ( "number" , async ( ) => {
106
91
const node = await hyperjump . get ( `${ testDomain } /foo#/number` ) ;
107
- if ( hyperjump . typeOf ( node , "number" ) ) {
108
- /** @type number */
109
- const subject = hyperjump . value ( node ) ;
110
- expect ( subject ) . to . equal ( 42 ) ;
111
- } else {
112
- expect . fail ( ) ;
113
- }
92
+ const subject = hyperjump . value ( node ) ;
93
+ expect ( subject ) . to . equal ( 42 ) ;
114
94
} ) ;
115
95
116
96
test ( "string" , async ( ) => {
117
97
const node = await hyperjump . get ( `${ testDomain } /foo#/string` ) ;
118
- if ( hyperjump . typeOf ( node , "string" ) ) {
119
- /** @type string */
120
- const subject = hyperjump . value ( node ) ;
121
- expect ( subject ) . to . equal ( "foo" ) ;
122
- } else {
123
- expect . fail ( ) ;
124
- }
98
+ const subject = hyperjump . value ( node ) ;
99
+ expect ( subject ) . to . equal ( "foo" ) ;
125
100
} ) ;
126
101
127
102
test ( "array" , async ( ) => {
128
103
const node = await hyperjump . get ( `${ testDomain } /foo#/array` ) ;
129
- expect ( hyperjump . typeOf ( node , "array" ) ) . to . equal ( true ) ;
130
104
expect ( ( ) => hyperjump . value ( node ) ) . to . throw ( ) ;
131
105
} ) ;
132
106
133
107
test ( "object" , async ( ) => {
134
108
const node = await hyperjump . get ( `${ testDomain } /foo#/object` ) ;
135
- expect ( hyperjump . typeOf ( node , "object" ) ) . to . equal ( true ) ;
136
109
expect ( ( ) => hyperjump . value ( node ) ) . to . throw ( ) ;
137
110
} ) ;
138
111
} ) ;
0 commit comments