@@ -3,15 +3,15 @@ import {jsonl} from "../dist/tiny-jsonl.cjs";
3
3
4
4
describe ( "Testing functionality" , function ( ) {
5
5
it ( "It should handle an Object" , function ( ) {
6
- const jsonldObject = jsonl ( { "id" :
"test-123" , "email" :
"[email protected] " , "field1:field2" :
"d,e" , "description" :
"this field has \"embed quotes\"" , "object" :
{ "abc" :
true , "def" :
false } , "array" :
[ "ghi" , 1234 , "other string" , { "nested" :
true } ] } ) ;
6
+ const jsonlObject = jsonl ( { "id" :
"test-123" , "email" :
"[email protected] " , "field1:field2" :
"d,e" , "description" :
"this field has \"embed quotes\"" , "object" :
{ "abc" :
true , "def" :
false } , "array" :
[ "ghi" , 1234 , "other string" , { "nested" :
true } ] } ) ;
7
7
const expectedResult = "{\"id\": \"test-123\", \"email\": \"[email protected] \", \"field1:field2\": \"d,e\", \"description\": \"this field has \\\"embed quotes\\\"\", \"object\": {\"abc\": true, \"def\": false}, \"array\": [\"ghi\", 1234, \"other string\", {\"nested\": true}]}" ;
8
- strictEqual ( jsonldObject , expectedResult , "Should match the jsonld string" ) ;
8
+ strictEqual ( jsonlObject , expectedResult , "Should match the jsonl string" ) ;
9
9
} ) ;
10
10
11
11
it ( "It should handle an Array of Objects" , function ( ) {
12
- const jsonldObject = jsonl ( [ { "id" :
"test-123" , "email" :
"[email protected] " } , { "id" :
"test-456" , "email" :
"[email protected] " } ] ) ;
12
+ const jsonlObject = jsonl ( [ { "id" :
"test-123" , "email" :
"[email protected] " } , { "id" :
"test-456" , "email" :
"[email protected] " } ] ) ;
13
13
const expectedResult = "{\"id\": \"test-123\", \"email\": \"[email protected] \"}\n{\"id\": \"test-456\", \"email\": \"[email protected] \"}" ;
14
- strictEqual ( jsonldObject , expectedResult , "Should match the jsonld string" ) ;
14
+ strictEqual ( jsonlObject , expectedResult , "Should match the jsonl string" ) ;
15
15
} ) ;
16
16
17
17
it ( "It should throw a TypeError if receiving a String" , function ( ) {
0 commit comments