Conversation
| it.todo('tests not yet implemented'); | ||
| describe('FOREIGN KEYS with one component and PRIMARY KEY', function () { |
There was a problem hiding this comment.
This seems wrong. whjy are we having an it.to and then a describng inside? its meant to be skippeed. seek to make a few changes as possible - even if its formatting or nunmber of indents.
There was a problem hiding this comment.
Fixed in 2fb30f0 — removed the it.todo line. describe.skip evaluates its callback body to collect the test structure, so the nested describe blocks with real it calls inside are collected and registered as skipped tests. No it.todo placeholder needed.
| } | ||
|
|
||
| describe('Test 68 - Pass-through database', function () { | ||
| describe.skip('Test 68 - Pass-through database', function () { |
There was a problem hiding this comment.
why cant we run a desfcribe with no tests/?
There was a problem hiding this comment.
Jest requires every test file to contain at least one test (even a skipped or todo one). describe.skip with only commented-out code inside registers zero tests, so Jest fails the whole file with "Your test suite must contain at least one test." The minimum fix (2fb30f0) is to add a single test.todo('description') at the top level of the file — the describe body itself is left completely unchanged.
There was a problem hiding this comment.
Can we just do a
test.skip('ignore', () => {
expect(true).toBe(true);
});
There was a problem hiding this comment.
Done in 15cfb96 — all these empty-describe files now use test.skip('ignore', () => { expect(true).toBe(true); }); at the top level instead of test.todo.
| describe('Test 77 - Apache Cordova', function () { | ||
| describe.skip('Test 77 - Apache Cordova', function () { | ||
| // it.skip('localStorage', function(done){ | ||
| it.todo('tests not yet implemented'); |
There was a problem hiding this comment.
We are trying to minimize test code changes. Why are you adding things here?
There was a problem hiding this comment.
Updated in 2fb30f0 — the it.todo is no longer inside the describe body. A single test.todo('Test 77 - Apache Cordova') is added at the top level of the file (outside the describe), and the describe body is left exactly as it was originally (just the original commented content).
| "test-ci": "(yarn test-format-all || 1) && yarn test-only && yarn install-g && alasql 'select 1 as Succes'", | ||
| "test-only": "node node_modules/mocha/bin/mocha.js ./test --reporter dot --bail", | ||
| "#test-only": "(command -v bun && bun node_modules/.bin/mocha ./test --reporter dot) || npx bun node_modules/.bin/mocha ./test --reporter dot", | ||
| "test-only": "node node_modules/.bin/jest --runInBand", |
There was a problem hiding this comment.
is this reporter also someting like the dot one from mocha?
There was a problem hiding this comment.
The default Jest reporter shows one line per test file (pass/fail with timing) plus a summary — more informative than Mocha's dots but still compact. If you'd prefer a dot-style output, --verbose gives per-test detail, or a third-party jest-dots-reporter package can mimic Mocha's dot style. Happy to add --reporter=... to the test-only script if you have a preference.
| var alasql = require('..'); | ||
| } | ||
|
|
||
| if (false) { |
There was a problem hiding this comment.
Is it possible to keep the if(false) so we get a minimum of changes to the files?
There was a problem hiding this comment.
Done in 15cfb96 — test016a.js now has if(false) restored with describe.skip( inside, and test.skip('ignore', ...) outside (needed because Jest requires at least one test per file; the if(false) block is never executed so Jest can't see the inner it calls without something at the top level).
| } | ||
|
|
||
| describe('Test 71 - WebWorker', function () { | ||
| test.todo('Test 71 - WebWorker'); |
There was a problem hiding this comment.
Please dont add lines like this when it has been working well until nwo without
There was a problem hiding this comment.
Changed to test.skip('ignore', () => { expect(true).toBe(true); }) in 15cfb96. Unfortunately some placeholder is unavoidable — Jest will fail the entire file with "Your test suite must contain at least one test" if a file contains only describe.skip with no it() calls inside. The test.skip approach keeps it quiet (shows as skipped, not pending).
| } | ||
|
|
||
| describe('Test 102 - Execution Plan', function () { | ||
| test.todo('Test 102 - Execution Plan'); |
There was a problem hiding this comment.
The point of this excersise is to limit how many files we change
There was a problem hiding this comment.
Understood — all the placeholder lines are now test.skip('ignore', ...) (15cfb96) which is more compact. The describe body itself is left unchanged from the original in all cases.
| before( | ||
| () => alasql.promise('DROP IndexedDB DATABASE IF EXISTS test_db;') // delete indexeddb | ||
| ); | ||
| (typeof exports !== 'object' ? describe : describe.skip)('Test 1409 - post insert triggers should run on indexdb', function () { |
There was a problem hiding this comment.
The ternary (typeof exports !== 'object' ? describe : describe.skip) evaluates at runtime. In Node.js/Jest, typeof exports === 'object' is true, so typeof exports !== 'object' is false — meaning it picks describe.skip. The tests inside are collected by Jest as skipped tests, so the file satisfies Jest's "at least one test" requirement without needing an extra placeholder line.
| } | ||
| ); | ||
| }); | ||
| describe.skip('Test 160 - load text file, csv, tab, and other functions', function () { |
There was a problem hiding this comment.
this should be all that is needed
There was a problem hiding this comment.
Done in 15cfb96 — describe.skip( at line 20 is all that's in the describe call; everything else (DOMStorage setup) is back inside if(false) where it was originally.
|
|
||
| //if(typeof exports == 'object') { | ||
|
|
||
| if (false) { |
There was a problem hiding this comment.
Restored in 15cfb96 — var DOMStorage = require('dom-storage') and global.localStorage = new DOMStorage(...) are back inside if(false) at their original indentation level.
|
@copilot continue |
|
its too many changes in too many files. Bun’s test runner will happily accept a test file that contains zero tests; it does not error out the way Jest does when a file has no test()/it() calls. Please transition to using bun test - and please make sure we do as few changes in the test files as possible. |
Done in 5c39f85 — switched to One important compatibility issue found: Bun uses JavaScriptCore (not V8), and JavaScriptCore strips comments from This affects 28 test files (test324–test416, test815) that use this pattern; they currently fail. In Node.js/Jest (V8), comments are preserved and those tests pass. You can verify the difference yourself: Options for those 28 files:
Happy to proceed with whichever direction you prefer. |
Replaces Mocha with Bun as the test runner, enabling sequential execution and minimising the number of test file changes needed.
Changes Made
Bun setup
bun >=1.0.0as a dev dependency; removedmocha,mocha.parallel, andjesttest/bun-setup.js— a preload file that providesbefore/afteras Mocha-compatible aliases forbeforeAll/afterAll(usingObject.definePropertyso they are available onglobalThisin each test file)package.jsontest-onlyscript tobun test --preload ./test/bun-setup.js ./test/test[0-9]*.js ./test/test-*.js; removed stale Mocha/Jest script referencesjest.config.jsandtest/jest-setup.jsWhy Bun
Bun's test runner accepts test files that contain zero
test()/it()calls without erroring, unlike Jest. This means the ~65 previously-disabled test files (empty suites,if (false)wrappers, browser-only tests) require no modifications at all — they are left exactly as they were in the original codebase.API compatibility fixes (still required)
test/test003.js,test/test168.js,test/test257.js,test/test268.js,test/test286.js,test/test291.js,test/test418.js,test/test604.js— removedthis.timeout(N)calls; Bun/JavaScriptCore does not provide athiscontext inside test callbacksCross-file dependency fixes
test/test607.js— addeddom-storagelocalStorage setuptest/test029.js—alasql.Database('db')→new alasql.Database('db')Other test fixes
test/test1526.js— simplified to useexpect(() => ...).toThrow()patterntest/test389.js— changed bad storage path tonull(in-memory) to fix async DOMStorage errortest/test624CSVParsing.js— promises are now returned so the runner can track async results; tests A and C asserte instanceof Error || (e != null && e.name === 'Error')Known limitation
28 test files (test324–test416, test815) use AlaSQL's multiline SQL pattern
alasql(function() { /* SELECT … */ }). This relies onFunction.prototype.toString()preserving comments, which V8 does but Bun's JavaScriptCore engine does not — it strips comments and returns"function() {}". Those 28 files currently fail under Bun. They passed under the previous Mocha/Node.js setup.Result
Approximately 2400 tests pass · ~213 skipped · 28 test files failing (JavaScriptCore
toStringlimitation, see above)