| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4c978b4 commit c1627e9
1 file 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 | + })); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments