Skip to content

Commit 5d73037

Browse files
committed
Order tests with interpolation first
1 parent 690f730 commit 5d73037

3 files changed

Lines changed: 27 additions & 27 deletions

File tree

cjs/tests/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,16 @@ t('Json transform nested parameter keys', async() => {
131131
return ['2', x]
132132
})
133133

134-
t('Json transform result keys', async() => {
134+
t('Json transform typed json parameters', async() => {
135135
const sql = postgres({
136136
...options,
137137
transform: postgres.camel
138138
})
139-
const x = (await sql`select '{"a_test":1}'::jsonb as x`)[0].x
140-
return [1, x.aTest]
139+
const x = (await sql`select ${ sql.typed({ aTest: 1 }, 114) }->>'a_test' as x`)[0].x
140+
return ['1', x]
141141
})
142142

143-
t('Json transform implicit json parameters', async() => {
143+
t('Json transform implicit jsonb parameters', async() => {
144144
const sql = postgres({
145145
...options,
146146
transform: postgres.camel
@@ -149,7 +149,7 @@ t('Json transform implicit json parameters', async() => {
149149
return ['1', x]
150150
})
151151

152-
t('Json transform implicit json type parameters', async() => {
152+
t('Json transform implicit json parameters', async() => {
153153
const sql = postgres({
154154
...options,
155155
transform: postgres.camel
@@ -158,16 +158,16 @@ t('Json transform implicit json type parameters', async() => {
158158
return ['1', x]
159159
})
160160

161-
t('Json transform typed json parameters', async() => {
161+
t('Json transform result keys', async() => {
162162
const sql = postgres({
163163
...options,
164164
transform: postgres.camel
165165
})
166-
const x = (await sql`select ${ sql.typed({ aTest: 1 }, 114) }->>'a_test' as x`)[0].x
167-
return ['1', x]
166+
const x = (await sql`select '{"a_test":1}'::jsonb as x`)[0].x
167+
return [1, x.aTest]
168168
})
169169

170-
t('Json transform toJSON parameter values', async() => {
170+
t('Json transform does not transform parameter values with .toJSON()', async() => {
171171
const now = new Date()
172172
const sql = postgres({
173173
...options,

deno/tests/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,16 @@ t('Json transform nested parameter keys', async() => {
133133
return ['2', x]
134134
})
135135

136-
t('Json transform result keys', async() => {
136+
t('Json transform typed json parameters', async() => {
137137
const sql = postgres({
138138
...options,
139139
transform: postgres.camel
140140
})
141-
const x = (await sql`select '{"a_test":1}'::jsonb as x`)[0].x
142-
return [1, x.aTest]
141+
const x = (await sql`select ${ sql.typed({ aTest: 1 }, 114) }->>'a_test' as x`)[0].x
142+
return ['1', x]
143143
})
144144

145-
t('Json transform implicit json parameters', async() => {
145+
t('Json transform implicit jsonb parameters', async() => {
146146
const sql = postgres({
147147
...options,
148148
transform: postgres.camel
@@ -151,7 +151,7 @@ t('Json transform implicit json parameters', async() => {
151151
return ['1', x]
152152
})
153153

154-
t('Json transform implicit json type parameters', async() => {
154+
t('Json transform implicit json parameters', async() => {
155155
const sql = postgres({
156156
...options,
157157
transform: postgres.camel
@@ -160,16 +160,16 @@ t('Json transform implicit json type parameters', async() => {
160160
return ['1', x]
161161
})
162162

163-
t('Json transform typed json parameters', async() => {
163+
t('Json transform result keys', async() => {
164164
const sql = postgres({
165165
...options,
166166
transform: postgres.camel
167167
})
168-
const x = (await sql`select ${ sql.typed({ aTest: 1 }, 114) }->>'a_test' as x`)[0].x
169-
return ['1', x]
168+
const x = (await sql`select '{"a_test":1}'::jsonb as x`)[0].x
169+
return [1, x.aTest]
170170
})
171171

172-
t('Json transform toJSON parameter values', async() => {
172+
t('Json transform does not transform parameter values with .toJSON()', async() => {
173173
const now = new Date()
174174
const sql = postgres({
175175
...options,

tests/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,16 @@ t('Json transform nested parameter keys', async() => {
131131
return ['2', x]
132132
})
133133

134-
t('Json transform result keys', async() => {
134+
t('Json transform typed json parameters', async() => {
135135
const sql = postgres({
136136
...options,
137137
transform: postgres.camel
138138
})
139-
const x = (await sql`select '{"a_test":1}'::jsonb as x`)[0].x
140-
return [1, x.aTest]
139+
const x = (await sql`select ${ sql.typed({ aTest: 1 }, 114) }->>'a_test' as x`)[0].x
140+
return ['1', x]
141141
})
142142

143-
t('Json transform implicit json parameters', async() => {
143+
t('Json transform implicit jsonb parameters', async() => {
144144
const sql = postgres({
145145
...options,
146146
transform: postgres.camel
@@ -149,7 +149,7 @@ t('Json transform implicit json parameters', async() => {
149149
return ['1', x]
150150
})
151151

152-
t('Json transform implicit json type parameters', async() => {
152+
t('Json transform implicit json parameters', async() => {
153153
const sql = postgres({
154154
...options,
155155
transform: postgres.camel
@@ -158,16 +158,16 @@ t('Json transform implicit json type parameters', async() => {
158158
return ['1', x]
159159
})
160160

161-
t('Json transform typed json parameters', async() => {
161+
t('Json transform result keys', async() => {
162162
const sql = postgres({
163163
...options,
164164
transform: postgres.camel
165165
})
166-
const x = (await sql`select ${ sql.typed({ aTest: 1 }, 114) }->>'a_test' as x`)[0].x
167-
return ['1', x]
166+
const x = (await sql`select '{"a_test":1}'::jsonb as x`)[0].x
167+
return [1, x.aTest]
168168
})
169169

170-
t('Json transform toJSON parameter values', async() => {
170+
t('Json transform does not transform parameter values with .toJSON()', async() => {
171171
const now = new Date()
172172
const sql = postgres({
173173
...options,

0 commit comments

Comments
 (0)