Skip to content

Commit fa66c5e

Browse files
Eprince-hubporsager
authored andcommitted
Refactor test for json primitive
1 parent 3fb8538 commit fa66c5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,12 +612,12 @@ t('Transform nested json in arrays', async() => {
612612
return ['aBcD', (await sql`select '[{"a_b":1},{"c_d":2}]'::jsonb as x`)[0].x.map(Object.keys).join('')]
613613
})
614614

615-
t('Transform null json in arrays', async() => {
615+
t('Bypass transform for json primitive', async() => {
616616
const sql = postgres({
617617
...options,
618618
transform: postgres.camel
619619
})
620-
return [null, (await sql`select '[{"a_b":null},{"c_d":null}]'::jsonb as x`)[0].x.map(Object.keys).join('')]
620+
return [null, false, 'a', '1', (await sql`select '${ null }'::jsonb as x, '${ false }'::jsonb as x, '${ "a" }'::json as x, '${ 1 }'::json as x`)[0].x]
621621
})
622622

623623
t('unsafe', async() => {

0 commit comments

Comments
 (0)