1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import test from "ava";
|
7 | import { BrowserCompatibility } from "..";
|
8 | import { UnsupportedBrowserError } from "./unsupportedBrowserError";
|
9 |
|
10 | test("constructor", t => {
|
11 | let browserCompatibility: BrowserCompatibility = {
|
12 | fullSupport: false,
|
13 | scannerSupport: false,
|
14 | missingFeatures: [BrowserCompatibility.Feature.BLOB]
|
15 | };
|
16 | let unsupportedBrowserError: UnsupportedBrowserError = new UnsupportedBrowserError(browserCompatibility);
|
17 | t.deepEqual(unsupportedBrowserError.name, "UnsupportedBrowserError");
|
18 | t.deepEqual(
|
19 | unsupportedBrowserError.message,
|
20 | "This OS / Browser has one or more missing features preventing it from working correctly"
|
21 | );
|
22 | t.deepEqual(unsupportedBrowserError.data, browserCompatibility);
|
23 | browserCompatibility = {
|
24 | fullSupport: true,
|
25 | scannerSupport: true,
|
26 | missingFeatures: []
|
27 | };
|
28 | unsupportedBrowserError = new UnsupportedBrowserError(browserCompatibility);
|
29 | t.deepEqual(unsupportedBrowserError.name, "UnsupportedBrowserError");
|
30 | t.deepEqual(
|
31 | unsupportedBrowserError.message,
|
32 | "This OS / Browser has one or more missing features preventing it from working correctly"
|
33 | );
|
34 | t.deepEqual(unsupportedBrowserError.data, browserCompatibility);
|
35 | });
|