summaryrefslogtreecommitdiffstats
path: root/test/fetch/about-uri.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/fetch/about-uri.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/fetch/about-uri.js b/test/fetch/about-uri.js
new file mode 100644
index 0000000..ac9cbf2
--- /dev/null
+++ b/test/fetch/about-uri.js
@@ -0,0 +1,21 @@
+'use strict'
+
+const { test } = require('tap')
+const { fetch } = require('../..')
+
+test('fetching about: uris', async (t) => {
+ t.test('about:blank', async (t) => {
+ await t.rejects(fetch('about:blank'))
+ })
+
+ t.test('All other about: urls should return an error', async (t) => {
+ try {
+ await fetch('about:config')
+ t.fail('fetching about:config should fail')
+ } catch (e) {
+ t.ok(e, 'this error was expected')
+ } finally {
+ t.end()
+ }
+ })
+})