diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-08-02 13:30:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-02 13:30:55 -0400 |
commit | b1b33f8beb26f97d91cb282682472c65f6eccae8 (patch) | |
tree | 1a7b5027a0f5208135f856759cb7935beac7911a /test/test-database.js | |
parent | a562a1149808b49f60346c82409f292290fbdd77 (diff) |
Fix fetch requests (#708)
* Revert audio fetching functionality to use XMLHttpRequest
* Replace requestJson
* Replace requestJson
* Replace requestJson
* Replace requestJson and requestText
* Fix tests
* Include support for vulgar word searches
* Remove request.js
Diffstat (limited to 'test/test-database.js')
-rw-r--r-- | test/test-database.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test-database.js b/test/test-database.js index 3a090c1d..6d0aae07 100644 --- a/test/test-database.js +++ b/test/test-database.js @@ -30,7 +30,7 @@ const chrome = { removeListener() { /* NOP */ } }, getURL(path2) { - return url.pathToFileURL(path.join(__dirname, '..', 'ext', path2.replace(/^\//, ''))); + return url.pathToFileURL(path.join(__dirname, '..', 'ext', path2.replace(/^\//, ''))).href; }, sendMessage() { // NOP @@ -89,6 +89,9 @@ async function fetch(url2) { await Promise.resolve(); const content = fs.readFileSync(filePath, {encoding: null}); return { + ok: true, + status: 200, + statusText: 'OK', text: async () => Promise.resolve(content.toString('utf8')), json: async () => Promise.resolve(JSON.parse(content.toString('utf8'))) }; @@ -113,7 +116,6 @@ vm.execute([ 'bg/js/json-schema.js', 'bg/js/dictionary.js', 'bg/js/media-utility.js', - 'bg/js/request.js', 'bg/js/dictionary-importer.js', 'bg/js/database.js', 'bg/js/dictionary-database.js' |