A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nodejs/node/commit/c1627e9d19 below:

make `test-permission-sqlite-load-extension` more robust · nodejs/node@c1627e9 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+8

-10

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+8

-10

lines changed Original file line number Diff line number Diff line change

@@ -1,18 +1,16 @@

1 1

'use strict';

2 2

const common = require('../common');

3 3

const assert = require('node:assert');

4 -

const childProcess = require('child_process');

5 4 6 5

const code = `const sqlite = require('node:sqlite');

7 6

const db = new sqlite.DatabaseSync(':memory:', { allowExtension: true });

8 7

db.loadExtension('nonexistent');`.replace(/\n/g, ' ');

9 8 10 -

childProcess.exec(

11 -

`${process.execPath} --permission -e "${code}"`,

12 -

{},

13 -

common.mustCall((err, _, stderr) => {

14 -

assert.strictEqual(err.code, 1);

15 -

assert.match(stderr, /Error: Cannot load SQLite extensions when the permission model is enabled/);

16 -

assert.match(stderr, /code: 'ERR_LOAD_SQLITE_EXTENSION'/);

17 -

})

18 -

);

9 +

common.spawnPromisified(

10 +

process.execPath,

11 +

['--permission', '--eval', code],

12 +

).then(common.mustCall(({ code, stderr }) => {

13 +

assert.match(stderr, /Error: Cannot load SQLite extensions when the permission model is enabled/);

14 +

assert.match(stderr, /code: 'ERR_LOAD_SQLITE_EXTENSION'/);

15 +

assert.strictEqual(code, 1);

16 +

}));

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4