Skip to content

Commit 015f7b0

Browse files
Eprince-hubporsager
authored andcommitted
Refactor test for json primitive
1 parent 65828bf commit 015f7b0

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
@@ -611,12 +611,12 @@ t('Transform nested json in arrays', async() => {
611611
return ['aBcD', (await sql`select '[{"a_b":1},{"c_d":2}]'::jsonb as x`)[0].x.map(Object.keys).join('')]
612612
})
613613

614-
t('Transform null json in arrays', async() => {
614+
t('Bypass transform for json primitive', async() => {
615615
const sql = postgres({
616616
...options,
617617
transform: postgres.camel
618618
})
619-
return [null, (await sql`select '[{"a_b":null},{"c_d":null}]'::jsonb as x`)[0].x.map(Object.keys).join('')]
619+
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]
620620
})
621621

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

0 commit comments

Comments
 (0)