Skip to content

Commit a643bcb

Browse files
test: properly skip Database tests if sqlite is missing
The ESM imports prevent the `skipIfSQLiteMissing()` function from skipping exiting before accessing the unavailable `node:sqlite` module thus failing the test suite with an error instead of skipping it.
1 parent b2aeb3f commit a643bcb

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

test/parallel/test-sqlite-database-async.mjs renamed to test/parallel/test-sqlite-database-async.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { skipIfSQLiteMissing } from '../common/index.mjs';
2-
import tmpdir from '../common/tmpdir.js';
3-
import { existsSync } from 'node:fs';
4-
import { suite, test } from 'node:test';
5-
import { join } from 'node:path';
6-
import { Database, Statement } from 'node:sqlite';
1+
'use strict';
2+
const { skipIfSQLiteMissing } = require('../common');
73
skipIfSQLiteMissing();
4+
const tmpdir = require('../common/tmpdir');
5+
const { existsSync } = require('node:fs');
6+
const { join } = require('node:path');
7+
const { Database, Statement } = require('node:sqlite');
8+
const { suite, test } = require('node:test');
89

910
tmpdir.refresh();
1011

0 commit comments

Comments
 (0)