Skip to content

Commit 099bab5

Browse files
Copilotmathiasrw
andcommitted
Address code review feedback - improve test maintainability
Co-authored-by: mathiasrw <[email protected]>
1 parent cc7887a commit 099bab5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/test2361.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ if (typeof exports === 'object') {
77
if (typeof exports != 'object') {
88
describe('Test 2361 - IndexedDB transactions support', function () {
99
const SCHEMA_NAME = 'test2361db';
10+
const TABLE_NAME = 'test_table';
1011

1112
before(function () {
1213
// Clean up any existing database
@@ -27,7 +28,7 @@ if (typeof exports != 'object') {
2728

2829
alasql
2930
.promise(queriesAttach)
30-
.then(() => alasql.promise('CREATE TABLE test_table'))
31+
.then(() => alasql.promise('CREATE TABLE ' + TABLE_NAME + ' (name STRING)'))
3132
.then(() => alasql.promise('BEGIN TRANSACTION'))
3233
.then(res => {
3334
assert.equal(res, 1);
@@ -67,7 +68,7 @@ if (typeof exports != 'object') {
6768
});
6869

6970
it('4. Full transaction workflow with INSERT', function (done) {
70-
const query = "INSERT INTO test_table VALUES ('test1'), ('test2')";
71+
const query = 'INSERT INTO ' + TABLE_NAME + " VALUES ('test1'), ('test2')";
7172

7273
alasql
7374
.promise('USE ' + SCHEMA_NAME)
@@ -86,7 +87,7 @@ if (typeof exports != 'object') {
8687
it('5. Transaction workflow as described in issue', function (done) {
8788
const queriesAttach = ['ATTACH INDEXEDDB DATABASE ' + SCHEMA_NAME, 'USE ' + SCHEMA_NAME];
8889

89-
const query = 'SELECT * FROM test_table';
90+
const query = 'SELECT * FROM ' + TABLE_NAME;
9091

9192
alasql
9293
.promise(queriesAttach)

0 commit comments

Comments
 (0)