Skip to content

Commit 8c4c68a

Browse files
test
1 parent 0fdec99 commit 8c4c68a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tests/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default function App() {
1111
const [results, setResults] = useState<any>([]);
1212

1313
useEffect(() => {
14+
console.log('Running Tests:');
1415
setResults([]);
1516
runTests(registerBaseTests).then((results) => {
1617
// Send results to host server
@@ -19,6 +20,7 @@ export default function App() {
1920
headers: { 'Content-Type': 'application/json' },
2021
body: JSON.stringify(results)
2122
});
23+
console.log(JSON.stringify(results, null, '\t'));
2224
setResults(results);
2325
});
2426
}, []);

tests/tests/sqlite/rawQueries.spec.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -392,22 +392,20 @@ export function registerBaseTests() {
392392
it('Should queue simultaneous executions', async () => {
393393
let order: number[] = [];
394394

395-
const operationCount = 20;
395+
const operationCount = 5;
396396
// This wont resolve or free until another connection free's it
397397
await db.writeLock(async (context) => {
398-
const fn = async (x: number, index: number) => {
399-
try {
400-
await context.execute('SELECT * FROM User');
401-
order.push(index);
402-
} catch (ex) {
403-
console.error(ex);
404-
}
405-
};
406-
407398
await Promise.all(
408399
Array(operationCount)
409400
.fill(0)
410-
.map((i, index) => fn(i, index))
401+
.map(async (x: number, index: number) => {
402+
try {
403+
await context.execute('SELECT * FROM User');
404+
order.push(index);
405+
} catch (ex) {
406+
console.error(ex);
407+
}
408+
})
411409
);
412410
});
413411

0 commit comments

Comments
 (0)