3
3
require ( '../common' ) ;
4
4
const {
5
5
DatabaseSync,
6
- SQLITE_CHANGESET_OMIT ,
7
- SQLITE_CHANGESET_REPLACE ,
8
- SQLITE_CHANGESET_ABORT
6
+ constants,
9
7
} = require ( 'node:sqlite' ) ;
10
8
const { test, suite } = require ( 'node:test' ) ;
11
9
@@ -165,7 +163,7 @@ suite('conflict resolution', () => {
165
163
test ( 'database.applyChangeset() - conflict with SQLITE_CHANGESET_ABORT' , ( t ) => {
166
164
const { database2, changeset } = prepareConflict ( ) ;
167
165
const result = database2 . applyChangeset ( changeset , {
168
- onConflict : SQLITE_CHANGESET_ABORT
166
+ onConflict : constants . SQLITE_CHANGESET_ABORT
169
167
} ) ;
170
168
// When changeset is aborted due to a conflict, applyChangeset should return false
171
169
t . assert . strictEqual ( result , false ) ;
@@ -177,7 +175,7 @@ suite('conflict resolution', () => {
177
175
test ( 'database.applyChangeset() - conflict with SQLITE_CHANGESET_REPLACE' , ( t ) => {
178
176
const { database2, changeset } = prepareConflict ( ) ;
179
177
const result = database2 . applyChangeset ( changeset , {
180
- onConflict : SQLITE_CHANGESET_REPLACE
178
+ onConflict : constants . SQLITE_CHANGESET_REPLACE
181
179
} ) ;
182
180
// Not aborted due to conflict, so should return true
183
181
t . assert . strictEqual ( result , true ) ;
@@ -189,7 +187,7 @@ suite('conflict resolution', () => {
189
187
test ( 'database.applyChangeset() - conflict with SQLITE_CHANGESET_OMIT' , ( t ) => {
190
188
const { database2, changeset } = prepareConflict ( ) ;
191
189
const result = database2 . applyChangeset ( changeset , {
192
- onConflict : SQLITE_CHANGESET_OMIT
190
+ onConflict : constants . SQLITE_CHANGESET_OMIT
193
191
} ) ;
194
192
// Not aborted due to conflict, so should return true
195
193
t . assert . strictEqual ( result , true ) ;
@@ -199,12 +197,6 @@ suite('conflict resolution', () => {
199
197
} ) ;
200
198
} ) ;
201
199
202
- test ( 'session related constants are defined' , ( t ) => {
203
- t . assert . strictEqual ( SQLITE_CHANGESET_OMIT , 0 ) ;
204
- t . assert . strictEqual ( SQLITE_CHANGESET_REPLACE , 1 ) ;
205
- t . assert . strictEqual ( SQLITE_CHANGESET_ABORT , 2 ) ;
206
- } ) ;
207
-
208
200
test ( 'database.createSession() - filter changes' , ( t ) => {
209
201
const database1 = new DatabaseSync ( ':memory:' ) ;
210
202
const database2 = new DatabaseSync ( ':memory:' ) ;
0 commit comments