mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 13:40:37 +00:00

PR-URL: https://github.com/nodejs/node/pull/56295 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
17 lines
600 B
JavaScript
17 lines
600 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('node:assert');
|
|
|
|
const code = `const sqlite = require('node:sqlite');
|
|
const db = new sqlite.DatabaseSync(':memory:', { allowExtension: true });
|
|
db.loadExtension('nonexistent');`.replace(/\n/g, ' ');
|
|
|
|
common.spawnPromisified(
|
|
process.execPath,
|
|
['--permission', '--eval', code],
|
|
).then(common.mustCall(({ code, stderr }) => {
|
|
assert.match(stderr, /Error: Cannot load SQLite extensions when the permission model is enabled/);
|
|
assert.match(stderr, /code: 'ERR_LOAD_SQLITE_EXTENSION'/);
|
|
assert.strictEqual(code, 1);
|
|
}));
|